i2cisolator2 2.0.0.0

Functions

void i2cisolator2_cfg_setup (i2cisolator2_cfg_t *cfg)
 Config Object Initialization function.
 
err_t i2cisolator2_init (i2cisolator2_t *ctx, i2cisolator2_cfg_t *cfg)
 Initialization function.
 
void i2cisolator2_enable_power (i2cisolator2_t *ctx, uint8_t state)
 This function sets PDIS pin state.
 
err_t i2cisolator2_write (i2cisolator2_t *ctx, uint8_t *data_in, uint16_t len)
 Generic write function.
 
err_t i2cisolator2_read (i2cisolator2_t *ctx, uint8_t *data_out, uint16_t len)
 Generic read function.
 
err_t i2cisolator2_write_then_read (i2cisolator2_t *ctx, uint8_t *data_in, uint16_t in_len, uint8_t *data_out, uint16_t out_len)
 Generic write then read function.
 
err_t i2cisolator2_set_slave_address (i2cisolator2_t *ctx, uint8_t slave_addr)
 Set slave address function.
 

Detailed Description

Function Documentation

◆ i2cisolator2_cfg_setup()

void i2cisolator2_cfg_setup ( i2cisolator2_cfg_t * cfg)

Config Object Initialization function.

Parameters
cfgClick configuration structure.

This function initializes click configuration structure to init state.

Note
All used pins will be set to unconnected state.

◆ i2cisolator2_enable_power()

void i2cisolator2_enable_power ( i2cisolator2_t * ctx,
uint8_t state )

This function sets PDIS pin state.

Parameters
ctxClick object.
statePDIS pin state.

This function sets the state of PDIS pin.

◆ i2cisolator2_init()

err_t i2cisolator2_init ( i2cisolator2_t * ctx,
i2cisolator2_cfg_t * cfg )

Initialization function.

Parameters
ctxClick object.
cfgClick configuration structure.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
This function initializes all necessary pins and peripherals used for this click.

◆ i2cisolator2_read()

err_t i2cisolator2_read ( i2cisolator2_t * ctx,
uint8_t * data_out,
uint16_t len )

Generic read function.

Parameters
ctxClick object.
data_outOutput data buf
lenNumber of bytes to be read
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
This function reads a desired number of data bytes from I2C bus.

◆ i2cisolator2_set_slave_address()

err_t i2cisolator2_set_slave_address ( i2cisolator2_t * ctx,
uint8_t slave_addr )

Set slave address function.

Parameters
ctxClick object.
slave_addrSlave address.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
This function sets the slave address.

◆ i2cisolator2_write()

err_t i2cisolator2_write ( i2cisolator2_t * ctx,
uint8_t * data_in,
uint16_t len )

Generic write function.

Parameters
ctxClick object.
data_inData buf to be written.
lenNumber of bytes in data buf.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
This function writes a desired data to I2C bus.

◆ i2cisolator2_write_then_read()

err_t i2cisolator2_write_then_read ( i2cisolator2_t * ctx,
uint8_t * data_in,
uint16_t in_len,
uint8_t * data_out,
uint16_t out_len )

Generic write then read function.

Parameters
ctxClick object.
data_inData buf to be written.
in_lenNumber of bytes in data in buffer.
data_outOutput data buf
out_lenNumber of bytes in data out buffer.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
This function writes a desired number of data bytes to I2C bus and then reads a desired number of data bytes from I2C bus.