i2cisolator3 2.0.0.0
I2C Isolator 3 Click Driver

API for configuring and manipulating I2C Isolator 3 Click driver. More...

Topics

 I2C Isolator 3 Registers Settings
 Settings for registers of I2C Isolator 3 Click driver.
 
 I2C Isolator 3 MikroBUS Map
 MikroBUS pin mapping of I2C Isolator 3 Click driver.
 

Functions

void i2cisolator3_cfg_setup (i2cisolator3_cfg_t *cfg)
 I2C Isolator 3 configuration object setup function.
 
err_t i2cisolator3_init (i2cisolator3_t *ctx, i2cisolator3_cfg_t *cfg)
 I2C Isolator 3 initialization function.
 
err_t i2cisolator3_generic_write (i2cisolator3_t *ctx, uint8_t reg, uint8_t *tx_buf, uint8_t tx_len)
 I2C Isolator 3 I2C writing function.
 
err_t i2cisolator3_generic_read (i2cisolator3_t *ctx, uint8_t reg, uint8_t *rx_buf, uint8_t rx_len)
 I2C Isolator 3 I2C reading function.
 
void i2cisolator3_send_cmd (i2cisolator3_t *ctx, uint8_t command)
 I2C Isolator 3 send command function.
 
void i2cisolator3_write_byte (i2cisolator3_t *ctx, uint8_t reg, uint8_t tx_data)
 I2C Isolator 3 write the byte of data function.
 
uint8_t i2cisolator3_read_byte (i2cisolator3_t *ctx, uint8_t reg)
 I2C Isolator 3 read the byte of data function.
 
err_t i2cisolator3_burst_write (i2cisolator3_t *ctx, uint8_t reg, uint8_t *p_tx_data, uint8_t n_bytes)
 I2C Isolator 3 burst write function.
 
err_t i2cisolator3_burst_read (i2cisolator3_t *ctx, uint8_t reg, uint8_t *p_rx_data, uint8_t n_bytes)
 I2C Isolator 3 burst read function.
 
err_t i2cisolator3_adv_write (i2cisolator3_t *ctx, uint8_t *p_reg, uint8_t n_reg_bytes, uint8_t *p_tx_data, uint8_t n_tx_data_bytes)
 I2C Isolator 3 advanced write function.
 
err_t i2cisolator3_adv_read (i2cisolator3_t *ctx, uint8_t *p_reg, uint8_t n_reg_bytes, uint8_t *p_rx_data, uint8_t n_rx_data_bytes)
 I2C Isolator 3 advanced read function.
 

Detailed Description

API for configuring and manipulating I2C Isolator 3 Click driver.

Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.

Function Documentation

◆ i2cisolator3_adv_read()

err_t i2cisolator3_adv_read ( i2cisolator3_t * ctx,
uint8_t * p_reg,
uint8_t n_reg_bytes,
uint8_t * p_rx_data,
uint8_t n_rx_data_bytes )

I2C Isolator 3 advanced read function.

The function advanced read, read sequential data starting from the targeted ( selectable ) register address of the remote device wired with CPC5902, Optically Isolated I2C Bus Repeater on I2C Isolator 3 click board.

Parameters
[in]ctx: Click context object. See i2cisolator3_t object definition for detailed explanation.
[in]p_reg: pointer to the memory address.
[in]n_reg_bytes: the number of bytes of the registry address.
[in]p_rx_data: pointer to the memory location where data be stored.
[in]n_rx_data_bytes: number of bytes to be read.
Returns
  • 0 - Success,
  • -1 - Error.
Note
None.

◆ i2cisolator3_adv_write()

err_t i2cisolator3_adv_write ( i2cisolator3_t * ctx,
uint8_t * p_reg,
uint8_t n_reg_bytes,
uint8_t * p_tx_data,
uint8_t n_tx_data_bytes )

I2C Isolator 3 advanced write function.

The function advanced write, writes sequential data starting of the targeted ( selectable ) register address of the remote device wired with CPC5902, Optically Isolated I2C Bus Repeater on I2C Isolator 3 click board.

Parameters
[in]ctx: Click context object. See i2cisolator3_t object definition for detailed explanation.
[in]p_reg: pointer to the memory address.
[in]n_reg_bytes: the number of bytes of the registry address.
[in]p_tx_data: pointer to the data to be written.
[in]n_tx_data_bytes: number of bytes to be written.
Returns
  • 0 - Success,
  • -1 - Error.
Note
None.

◆ i2cisolator3_burst_read()

err_t i2cisolator3_burst_read ( i2cisolator3_t * ctx,
uint8_t reg,
uint8_t * p_rx_data,
uint8_t n_bytes )

I2C Isolator 3 burst read function.

The function read sequential data starting from the targeted 8-bit register address of the remote device wired with CPC5902, Optically Isolated I2C Bus Repeater on I2C Isolator 3 click board.

Parameters
[in]ctx: Click context object. See i2cisolator3_t object definition for detailed explanation.
[in]reg: 8-bit memory address.
[in]p_rx_data: pointer to the memory location where data be stored.
[in]n_bytes: number of bytes to be read.
Returns
  • 0 - Success,
  • -1 - Error.
Note
None.

◆ i2cisolator3_burst_write()

err_t i2cisolator3_burst_write ( i2cisolator3_t * ctx,
uint8_t reg,
uint8_t * p_tx_data,
uint8_t n_bytes )

I2C Isolator 3 burst write function.

The function writes sequential data starting to the targeted 8-bit register address of the remote device wired with CPC5902, Optically Isolated I2C Bus Repeater on I2C Isolator 3 click board.

Parameters
[in]ctx: Click context object. See i2cisolator3_t object definition for detailed explanation.
[in]reg: 8-bit register address.
[in]p_tx_data: pointer to the data to be written.
[in]n_bytes: number of bytes to be written.
Returns
  • 0 - Success,
  • -1 - Error.
Note
None.

◆ i2cisolator3_cfg_setup()

void i2cisolator3_cfg_setup ( i2cisolator3_cfg_t * cfg)

I2C Isolator 3 configuration object setup function.

This function initializes click configuration structure to initial values.

Parameters
[out]cfg: Click configuration structure. See i2cisolator3_cfg_t object definition for detailed explanation.
Returns
Nothing.
Note
The all used pins will be set to unconnected state.

◆ i2cisolator3_generic_read()

err_t i2cisolator3_generic_read ( i2cisolator3_t * ctx,
uint8_t reg,
uint8_t * rx_buf,
uint8_t rx_len )

I2C Isolator 3 I2C reading function.

This function reads a desired number of data bytes starting from the selected register by using I2C serial interface.

Parameters
[in]ctx: Click context object. See i2cisolator3_t object definition for detailed explanation.
[in]reg: Start register address.
[out]rx_buf: Output read data.
[in]rx_len: Number of bytes to be read.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ i2cisolator3_generic_write()

err_t i2cisolator3_generic_write ( i2cisolator3_t * ctx,
uint8_t reg,
uint8_t * tx_buf,
uint8_t tx_len )

I2C Isolator 3 I2C writing function.

This function writes a desired number of data bytes starting from the selected register by using I2C serial interface.

Parameters
[in]ctx: Click context object. See i2cisolator3_t object definition for detailed explanation.
[in]reg: Start register address.
[in]tx_buf: Data to be written.
[in]tx_len: Number of bytes to be written.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ i2cisolator3_init()

err_t i2cisolator3_init ( i2cisolator3_t * ctx,
i2cisolator3_cfg_t * cfg )

I2C Isolator 3 initialization function.

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

Parameters
[out]ctx: Click context object. See i2cisolator3_t object definition for detailed explanation.
[in]cfg: Click configuration structure. See i2cisolator3_cfg_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ i2cisolator3_read_byte()

uint8_t i2cisolator3_read_byte ( i2cisolator3_t * ctx,
uint8_t reg )

I2C Isolator 3 read the byte of data function.

The function read a the byte of data from the targeted 8-bit register address of the remote device wired with CPC5902, Optically Isolated I2C Bus Repeater on I2C Isolator 3 click board.

Parameters
[in]ctx: Click context object. See i2cisolator3_t object definition for detailed explanation.
[in]reg: 8-bit register address.
Returns
8-bit read data..
Note
None.

◆ i2cisolator3_send_cmd()

void i2cisolator3_send_cmd ( i2cisolator3_t * ctx,
uint8_t command )

I2C Isolator 3 send command function.

The function sends the desired command to a remote device wired with CPC5902, Optically Isolated I2C Bus Repeater on I2C Isolator 3 click board.

Parameters
[in]ctx: Click context object. See i2cisolator3_t object definition for detailed explanation.
[in]command: 8-bit commands instruction.
Returns
Nothing.
Note
None.

◆ i2cisolator3_write_byte()

void i2cisolator3_write_byte ( i2cisolator3_t * ctx,
uint8_t reg,
uint8_t tx_data )

I2C Isolator 3 write the byte of data function.

The function writes the byte of data to the targeted 8-bit register address of the remote device wired with CPC5902, Optically Isolated I2C Bus Repeater on I2C Isolator 3 click board.

Parameters
[in]ctx: Click context object. See i2cisolator3_t object definition for detailed explanation.
[in]reg: 8-bit register address.
[in]tx_data: 8-bit data to be written.
Returns
Nothing.
Note
None.