User manual
312
mikoBasic PRO for PIC32
MikroElektronika
I2Cx_Restart
Prototype
sub procedure I2Cx_Restart()
Description Issues repeated START signal.
Parameters None.
Returns Nothing.
Requires MCU with at least one I²C module.
Used I²C module must be initialized before using this function. See I2Cx_Init routine.
Example
‘ Issue RESTART signal
I2C1_Restart()
Notes - I²C library routines require you to specify the module you want to use. To select the desired I²C
module, simply change the letter x in the routine prototype for a number from 1 to 5.
- Number of I²C modules per MCU differs from chip to chip. Please, read the appropriate datasheet
before utilizing this library.
I2Cx_Is_Idle
Prototype
sub function I2Cx_Is_Idle() as word
Description Waits for the I²C bus to become free. This is a blocking function.
Parameters None.
Returns - 0 if I²C bus is free.
- 1 if I²C bus is not free.
Requires MCU with at least one I²C module.
Used I²C module must be initialized before using this function. See I2Cx_Init routine.
Example
dim data_ as byte
...
if I2C1_Is_Idle() then
I2C1_Write(data_)
end if
...
Notes - I²C library routines require you to specify the module you want to use. To select the desired I²C
module, simply change the letter x in the routine prototype for a number from 1 to 5.
- Number of I²C modules per MCU differs from chip to chip. Please, read the appropriate datasheet
before utilizing this library.