digiisolator2 2.1.0.0
DIGI Isolator 2 Click Driver

API for configuring and manipulating DIGI Isolator 2 Click driver. More...

Topics

 DIGI Isolator 2 Registers List
 List of registers of DIGI Isolator 2 Click driver.
 
 DIGI Isolator 2 Registers Settings
 Settings for registers of DIGI Isolator 2 Click driver.
 
 DIGI Isolator 2 MikroBUS Map
 MikroBUS pin mapping of DIGI Isolator 2 Click driver.
 

Functions

void digiisolator2_cfg_setup (digiisolator2_cfg_t *cfg)
 DIGI Isolator 2 configuration object setup function.
 
void digiisolator2_drv_interface_sel (digiisolator2_cfg_t *cfg, digiisolator2_drv_t drv_sel)
 DIGI Isolator 2 driver interface setup function.
 
err_t digiisolator2_init (digiisolator2_t *ctx, digiisolator2_cfg_t *cfg)
 DIGI Isolator 2 initialization function.
 
err_t digiisolator2_spi_write (digiisolator2_t *ctx, uint8_t reg, uint8_t data_in)
 DIGI Isolator 2 SPI writing function.
 
err_t digiisolator2_spi_read (digiisolator2_t *ctx, uint8_t reg, uint8_t *data_out)
 DIGI Isolator 2 SPI reading function.
 
void digiisolator2_set_rst_pin (digiisolator2_t *ctx, uint8_t state)
 DIGI Isolator 2 set rst pin function.
 
uint8_t digiisolator2_get_int_pin (digiisolator2_t *ctx)
 DIGI Isolator 2 get int pin function.
 
uint8_t digiisolator2_get_sync_pin (digiisolator2_t *ctx)
 DIGI Isolator 2 get sync pin function.
 
err_t digiisolator2_read_inputs (digiisolator2_t *ctx, uint8_t *data_out)
 DIGI Isolator 2 read inputs function.
 
uint8_t digiisolator2_get_out1_pin (digiisolator2_t *ctx)
 DIGI Isolator 2 get out1 pin function.
 
uint8_t digiisolator2_get_out2_pin (digiisolator2_t *ctx)
 DIGI Isolator 2 get out2 pin function.
 
uint8_t digiisolator2_get_out3_pin (digiisolator2_t *ctx)
 DIGI Isolator 2 get out3 pin function.
 
uint8_t digiisolator2_get_out4_pin (digiisolator2_t *ctx)
 DIGI Isolator 2 get out4 pin function.
 
uint8_t digiisolator2_get_out5_pin (digiisolator2_t *ctx)
 DIGI Isolator 2 get out5 pin function.
 
uint8_t digiisolator2_get_out6_pin (digiisolator2_t *ctx)
 DIGI Isolator 2 get out6 pin function.
 
uint8_t digiisolator2_get_out8_pin (digiisolator2_t *ctx)
 DIGI Isolator 2 get out8 pin function.
 
void digiisolator2_enable_output (digiisolator2_t *ctx)
 DIGI Isolator 2 enable output function.
 
void digiisolator2_disable_output (digiisolator2_t *ctx)
 DIGI Isolator 2 disable output function.
 

Detailed Description

API for configuring and manipulating DIGI Isolator 2 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

◆ digiisolator2_cfg_setup()

void digiisolator2_cfg_setup ( digiisolator2_cfg_t * cfg)

DIGI Isolator 2 configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ digiisolator2_disable_output()

void digiisolator2_disable_output ( digiisolator2_t * ctx)

DIGI Isolator 2 disable output function.

This function disables output by setting the EN pin to low state.

Parameters
[in]ctx: Click context object. See digiisolator2_t object definition for detailed explanation.
Returns
None.
Note
None.

◆ digiisolator2_drv_interface_sel()

void digiisolator2_drv_interface_sel ( digiisolator2_cfg_t * cfg,
digiisolator2_drv_t drv_sel )

DIGI Isolator 2 driver interface setup function.

This function sets a serial driver interface which will be used further in the click driver.

Parameters
[out]cfg: Click configuration structure. See digiisolator2_cfg_t object definition for detailed explanation.
[in]drv_sel: Driver interface selection. See digiisolator2_drv_t object definition for detailed explanation.
Returns
Nothing.
Note
This driver selection should be called before init function to configure the driver to work with the serial interface which is consistent with the real state of the hardware. If this function is not called, the default driver interface will be set.

◆ digiisolator2_enable_output()

void digiisolator2_enable_output ( digiisolator2_t * ctx)

DIGI Isolator 2 enable output function.

This function enables output by setting the EN pin to high state.

Parameters
[in]ctx: Click context object. See digiisolator2_t object definition for detailed explanation.
Returns
None.
Note
None.

◆ digiisolator2_get_int_pin()

uint8_t digiisolator2_get_int_pin ( digiisolator2_t * ctx)

DIGI Isolator 2 get int pin function.

This function returns the INT pin logic state.

Parameters
[in]ctx: Click context object. See digiisolator2_t object definition for detailed explanation.
Returns
Pin logic state.
Note
This function is used only in SPI mode.

◆ digiisolator2_get_out1_pin()

uint8_t digiisolator2_get_out1_pin ( digiisolator2_t * ctx)

DIGI Isolator 2 get out1 pin function.

This function returns the OUT1 pin logic state.

Parameters
[in]ctx: Click context object. See digiisolator2_t object definition for detailed explanation.
Returns
Pin logic state.
Note
This function is used only in GPIO mode.

◆ digiisolator2_get_out2_pin()

uint8_t digiisolator2_get_out2_pin ( digiisolator2_t * ctx)

DIGI Isolator 2 get out2 pin function.

This function returns the OUT2 pin logic state.

Parameters
[in]ctx: Click context object. See digiisolator2_t object definition for detailed explanation.
Returns
Pin logic state.
Note
This function is used only in GPIO mode.

◆ digiisolator2_get_out3_pin()

uint8_t digiisolator2_get_out3_pin ( digiisolator2_t * ctx)

DIGI Isolator 2 get out3 pin function.

This function returns the OUT3 pin logic state.

Parameters
[in]ctx: Click context object. See digiisolator2_t object definition for detailed explanation.
Returns
Pin logic state.
Note
This function is used only in GPIO mode.

◆ digiisolator2_get_out4_pin()

uint8_t digiisolator2_get_out4_pin ( digiisolator2_t * ctx)

DIGI Isolator 2 get out4 pin function.

This function returns the OUT4 pin logic state.

Parameters
[in]ctx: Click context object. See digiisolator2_t object definition for detailed explanation.
Returns
Pin logic state.
Note
This function is used only in GPIO mode.

◆ digiisolator2_get_out5_pin()

uint8_t digiisolator2_get_out5_pin ( digiisolator2_t * ctx)

DIGI Isolator 2 get out5 pin function.

This function returns the OUT5 pin logic state.

Parameters
[in]ctx: Click context object. See digiisolator2_t object definition for detailed explanation.
Returns
Pin logic state.
Note
This function is used only in GPIO mode.

◆ digiisolator2_get_out6_pin()

uint8_t digiisolator2_get_out6_pin ( digiisolator2_t * ctx)

DIGI Isolator 2 get out6 pin function.

This function returns the OUT6 pin logic state.

Parameters
[in]ctx: Click context object. See digiisolator2_t object definition for detailed explanation.
Returns
Pin logic state.
Note
This function is used only in GPIO mode.

◆ digiisolator2_get_out8_pin()

uint8_t digiisolator2_get_out8_pin ( digiisolator2_t * ctx)

DIGI Isolator 2 get out8 pin function.

This function returns the OUT8 pin logic state.

Parameters
[in]ctx: Click context object. See digiisolator2_t object definition for detailed explanation.
Returns
Pin logic state.
Note
This function is used only in GPIO mode.

◆ digiisolator2_get_sync_pin()

uint8_t digiisolator2_get_sync_pin ( digiisolator2_t * ctx)

DIGI Isolator 2 get sync pin function.

This function returns the SYNC pin logic state.

Parameters
[in]ctx: Click context object. See digiisolator2_t object definition for detailed explanation.
Returns
Pin logic state.
Note
This function is used only in SPI mode.

◆ digiisolator2_init()

err_t digiisolator2_init ( digiisolator2_t * ctx,
digiisolator2_cfg_t * cfg )

DIGI Isolator 2 initialization function.

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

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

◆ digiisolator2_read_inputs()

err_t digiisolator2_read_inputs ( digiisolator2_t * ctx,
uint8_t * data_out )

DIGI Isolator 2 read inputs function.

This function reads all inputs state via the selected driver interface.

Parameters
[in]ctx: Click context object. See digiisolator2_t object definition for detailed explanation.
[out]data_out: Inputs state read.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ digiisolator2_set_rst_pin()

void digiisolator2_set_rst_pin ( digiisolator2_t * ctx,
uint8_t state )

DIGI Isolator 2 set rst pin function.

This function sets the RST pin logic state.

Parameters
[in]ctx: Click context object. See digiisolator2_t object definition for detailed explanation.
[in]state: Pin logic state.
Returns
None.
Note
This function is used only in SPI mode.

◆ digiisolator2_spi_read()

err_t digiisolator2_spi_read ( digiisolator2_t * ctx,
uint8_t reg,
uint8_t * data_out )

DIGI Isolator 2 SPI reading function.

This function reads data from the selected register by using SPI serial interface.

Parameters
[in]ctx: Click context object. See digiisolator2_t object definition for detailed explanation.
[in]reg: Register address.
[out]data_out: Output read data.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
This function is used only in SPI mode.

◆ digiisolator2_spi_write()

err_t digiisolator2_spi_write ( digiisolator2_t * ctx,
uint8_t reg,
uint8_t data_in )

DIGI Isolator 2 SPI writing function.

This function writes data to the selected register by using SPI serial interface.

Parameters
[in]ctx: Click context object. See digiisolator2_t object definition for detailed explanation.
[in]reg: Register address.
[in]data_in: Data to be written.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
This function is used only in SPI mode.