i2cisolator5 2.1.0.0
I2C Isolator 5 Click Driver

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

Topics

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

Functions

void i2cisolator5_cfg_setup (i2cisolator5_cfg_t *cfg)
 I2C Isolator 5 configuration object setup function.
 
err_t i2cisolator5_init (i2cisolator5_t *ctx, i2cisolator5_cfg_t *cfg)
 I2C Isolator 5 initialization function.
 
err_t i2cisolator5_default_cfg (i2cisolator5_t *ctx)
 I2C Isolator 5 default configuration function.
 
err_t i2cisolator5_write (i2cisolator5_t *ctx, uint8_t *data_in, uint8_t len)
 I2C Isolator 5 I2C writing function.
 
err_t i2cisolator5_read (i2cisolator5_t *ctx, uint8_t *data_out, uint8_t len)
 I2C Isolator 5 I2C reading function.
 
err_t i2cisolator5_write_then_read (i2cisolator5_t *ctx, uint8_t *data_in, uint8_t data_in_len, uint8_t *data_out, uint8_t data_out_len)
 I2C Isolator 5 I2C write then read function.
 
err_t i2cisolator5_set_slave_address (i2cisolator5_t *ctx, uint8_t address)
 I2C Isolator 5 set I2C Slave address function.
 
void i2cisolator5_set_outa_state (i2cisolator5_t *ctx, uint8_t outa_state)
 I2C Isolator 5 set output A state function.
 
void i2cisolator5_set_outb_state (i2cisolator5_t *ctx, uint8_t outb_state)
 I2C Isolator 5 set output B state function.
 
uint8_t i2cisolator5_get_ina_state (i2cisolator5_t *ctx)
 I2C Isolator 5 get input A state function.
 

Detailed Description

API for configuring and manipulating I2C Isolator 5 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

◆ i2cisolator5_cfg_setup()

void i2cisolator5_cfg_setup ( i2cisolator5_cfg_t * cfg)

I2C Isolator 5 configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ i2cisolator5_default_cfg()

err_t i2cisolator5_default_cfg ( i2cisolator5_t * ctx)

I2C Isolator 5 default configuration function.

This function executes a default configuration of I2C Isolator 5 click board.

Parameters
[in]ctx: Click context object. See i2cisolator5_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
This function can consist any necessary configuration or setting to put device into operating mode.

◆ i2cisolator5_get_ina_state()

uint8_t i2cisolator5_get_ina_state ( i2cisolator5_t * ctx)

I2C Isolator 5 get input A state function.

This function reads the state of the input A pin.

Parameters
[in]ctx: Click context object. See i2cisolator5_t object definition for detailed explanation.
Returns
State of the input A pin.
Note
None.

◆ i2cisolator5_init()

err_t i2cisolator5_init ( i2cisolator5_t * ctx,
i2cisolator5_cfg_t * cfg )

I2C Isolator 5 initialization function.

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

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

◆ i2cisolator5_read()

err_t i2cisolator5_read ( i2cisolator5_t * ctx,
uint8_t * data_out,
uint8_t len )

I2C Isolator 5 I2C reading function.

This function reads a desired number of data bytes by using I2C serial interface.

Parameters
[in]ctx: Click context object. See i2cisolator5_t object definition for detailed explanation.
[out]data_out: Output read data.
[in]len: Number of bytes to be read.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ i2cisolator5_set_outa_state()

void i2cisolator5_set_outa_state ( i2cisolator5_t * ctx,
uint8_t outa_state )

I2C Isolator 5 set output A state function.

This function sets the state of the out A pin.

Parameters
[in]ctx: Click context object. See i2cisolator5_t object definition for detailed explanation.
[in]outa_state: Specified out A pin state.
Returns
Nothing.
Note
None.

◆ i2cisolator5_set_outb_state()

void i2cisolator5_set_outb_state ( i2cisolator5_t * ctx,
uint8_t outb_state )

I2C Isolator 5 set output B state function.

This function sets the state of the out B pin.

Parameters
[in]ctx: Click context object. See i2cisolator5_t object definition for detailed explanation.
[in]outb_state: Specified out B pin state.
Returns
Nothing.
Note
None.

◆ i2cisolator5_set_slave_address()

err_t i2cisolator5_set_slave_address ( i2cisolator5_t * ctx,
uint8_t address )

I2C Isolator 5 set I2C Slave address function.

This function sets I2C address of the subordinate I2C device to address which is targeted by read and write operations.

Parameters
[in]ctx: Click context object. See i2cisolator5_t object definition for detailed explanation.
[in]address: Specified I2C slave address.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ i2cisolator5_write()

err_t i2cisolator5_write ( i2cisolator5_t * ctx,
uint8_t * data_in,
uint8_t len )

I2C Isolator 5 I2C writing function.

This function writes a desired number of data bytes by using I2C serial interface.

Parameters
[in]ctx: Click context object. See i2cisolator5_t object definition for detailed explanation.
[in]data_in: Data to be written.
[in]len: Number of bytes to be written.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ i2cisolator5_write_then_read()

err_t i2cisolator5_write_then_read ( i2cisolator5_t * ctx,
uint8_t * data_in,
uint8_t data_in_len,
uint8_t * data_out,
uint8_t data_out_len )

I2C Isolator 5 I2C write then read function.

Function performs a write operation followed by a read operation on the bus. The operation consists of a start signal followed by a number of write operations ( data from data_in ), a restart signal followed by number of read operations ( placed in data_out ), finishing the operation with a stop signal.

Parameters
[in]ctx: Click context object. See i2cisolator5_t object definition for detailed explanation.
[in]data_in: Data to be written.
[in]data_in_len: Number of bytes to be written.
[out]data_out: Output read data.
[in]data_out_len: Number of bytes to be read.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None