User manual

mikroBasic PRO for dsPIC30/33 and PIC24
MikroElektronika
451
Soft_I2C_Init
Soft_I2C_Start
Prototype
sub procedure Soft_I2C_Init()
Description Congures the software I²C module.
Parameters None.
Returns Nothing.
Requires Global variables:
- Soft_I2C_Scl: Soft I²C clock line
- Soft_I2C_Sda: Soft I²C data line
- Soft_I2C_Scl_Pin_Direction: Direction of the Soft I²C clock pin
- Soft_I2C_Sda_Pin_Direction: Direction of the Soft I²C data pin
must be dened before using this function.
Example
‘ Software I2C connections
dim Soft_I2C_Scl as sbit at RF3_bit
Soft_I2C_Sda as sbit at RF2_bit
Soft_I2C_Scl_Direction as sbit at TRISF3_bit
Soft_I2C_Sda_Direction as sbit at TRISF2_bit
‘ End Software I2C connections
...
Soft_I2C_Init()
Notes None
Prototype
sub procedure Soft_I2C_Start()
Description Determines if the I²C bus is free and issues START signal.
Parameters None.
Returns Nothing.
Requires Software I²C must be congured before using this function. See Soft_I2C_Init routine.
Example
‘ Issue START signal
Soft_I2C_Start()
Notes None