c8pini2c 2.0.0.0
Public function

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.
 

Detailed Description

Function Documentation

◆ c8pini2c_cfg_setup()

void c8pini2c_cfg_setup ( c8pini2c_cfg_t * cfg)

Config Object Initialization function.

Parameters
cfgClick configuration structure.

@description This function initializes click configuration structure to init state.

Note
All used pins will be set to unconnected state.

◆ c8pini2c_generic_read()

void c8pini2c_generic_read ( c8pini2c_t * ctx,
uint8_t slave_addr,
uint8_t reg,
uint8_t * data_buf,
uint8_t len )

Generic read function.

Parameters
ctxClick object.
slave_addr7 bit slave addres without 0 bit (read/write bit)
regRegister address.
data_bufOutput data buf
lenNumber of the bytes to be read

@description This function reads data from the desired register.

◆ c8pini2c_generic_write()

void c8pini2c_generic_write ( c8pini2c_t * ctx,
uint8_t slave_addr,
uint8_t reg,
uint8_t * data_buf,
uint8_t len )

Generic write function.

Parameters
ctxClick object.
slave_addr7 bit slave addres without 0 bit (read/write bit)
regRegister address.
data_bufData buf to be written.
lenNumber of the bytes in data buf.

@description This function writes data to the desired register.

◆ c8pini2c_init()

C8PINI2C_RETVAL c8pini2c_init ( c8pini2c_t * ctx,
c8pini2c_cfg_t * cfg )

Initialization function.

Parameters
c8pini2cClick object.
cfgClick configuration structure.

@description This function initializes all necessary pins and peripherals used for this click.