c8pini2c 2.0.0.0
|
Functions | |
void | c8pini2c_cfg_setup (c8pini2c_cfg_t *cfg) |
Config Object Initialization function. | |
C8PINI2C_RETVAL | c8pini2c_init (c8pini2c_t *ctx, c8pini2c_cfg_t *cfg) |
Initialization function. | |
void | c8pini2c_generic_write (c8pini2c_t *ctx, uint8_t slave_addr, uint8_t reg, uint8_t *data_buf, uint8_t len) |
Generic write function. | |
void | c8pini2c_generic_read (c8pini2c_t *ctx, uint8_t slave_addr, uint8_t reg, uint8_t *data_buf, uint8_t len) |
Generic read function. | |
void c8pini2c_cfg_setup | ( | c8pini2c_cfg_t * | cfg | ) |
Config Object Initialization function.
cfg | Click configuration structure. |
@description This function initializes click configuration structure to init state.
void c8pini2c_generic_read | ( | c8pini2c_t * | ctx, |
uint8_t | slave_addr, | ||
uint8_t | reg, | ||
uint8_t * | data_buf, | ||
uint8_t | len ) |
Generic read function.
ctx | Click object. |
slave_addr | 7 bit slave addres without 0 bit (read/write bit) |
reg | Register address. |
data_buf | Output data buf |
len | Number of the bytes to be read |
@description This function reads data from the desired register.
void c8pini2c_generic_write | ( | c8pini2c_t * | ctx, |
uint8_t | slave_addr, | ||
uint8_t | reg, | ||
uint8_t * | data_buf, | ||
uint8_t | len ) |
Generic write function.
ctx | Click object. |
slave_addr | 7 bit slave addres without 0 bit (read/write bit) |
reg | Register address. |
data_buf | Data buf to be written. |
len | Number of the bytes in data buf. |
@description This function writes data to the desired register.
C8PINI2C_RETVAL c8pini2c_init | ( | c8pini2c_t * | ctx, |
c8pini2c_cfg_t * | cfg ) |
Initialization function.
c8pini2c | Click object. |
cfg | Click configuration structure. |
@description This function initializes all necessary pins and peripherals used for this click.