I2C

Functions

KI2CStatus kprv_i2c_dev_init (KI2CNum i2c)
 Setup and enable i2c bus. More...
 
KI2CStatus kprv_i2c_dev_terminate (KI2CNum i2c)
 i2c hardware cleanup and disabling More...
 
KI2CStatus kprv_i2c_master_write (KI2CNum i2c, uint16_t addr, uint8_t *ptr, int len)
 Write data over i2c bus as master. More...
 
KI2CStatus kprv_i2c_master_read (KI2CNum i2c, uint16_t addr, uint8_t *ptr, int len)
 Read data over i2c bus as master. More...
 

Function Documentation

KI2CStatus kprv_i2c_dev_init ( KI2CNum  i2c)

Setup and enable i2c bus.

Parameters
i2ci2c bus to initialize
Returns
KI2CStatus I2C_OK if success, otherwise a specific error flag
KI2CStatus kprv_i2c_dev_terminate ( KI2CNum  i2c)

i2c hardware cleanup and disabling

Parameters
i2cbus num to terminate
Returns
KI2CStatus I2C_OK if success, otherwise a specific error flag
KI2CStatus kprv_i2c_master_read ( KI2CNum  i2c,
uint16_t  addr,
uint8_t *  ptr,
int  len 
)

Read data over i2c bus as master.

Parameters
i2ci2c bus to read from
addri2c address to write to
ptrpointer to data buffer
lenlength of data to read
Returns
KI2CStatus I2C_OK on success, otherwise failure
KI2CStatus kprv_i2c_master_write ( KI2CNum  i2c,
uint16_t  addr,
uint8_t *  ptr,
int  len 
)

Write data over i2c bus as master.

Parameters
i2ci2c bus to write to
addri2c address to write to
ptrpointer to data buffer
lenlength of data to write
Returns
KI2CStatus I2C_OK on success, otherwise failure