digiisolator 2.1.0.0
DIGI Isolator Click Driver

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

Topics

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

Functions

void digiisolator_cfg_setup (digiisolator_cfg_t *cfg)
 DIGI Isolator configuration object setup function.
 
err_t digiisolator_init (digiisolator_t *ctx, digiisolator_cfg_t *cfg)
 DIGI Isolator initialization function.
 
err_t digiisolator_spi_write (digiisolator_t *ctx, uint8_t *data_in, uint8_t len)
 DIGI Isolator SPI data writing function.
 
err_t digiisolator_spi_read (digiisolator_t *ctx, uint8_t *data_out, uint8_t len)
 DIGI Isolator SPI data reading function.
 
err_t digiisolator_spi_write_read (digiisolator_t *ctx, uint8_t *data_in, uint8_t len_in, uint8_t *data_out, uint8_t len_out)
 DIGI Isolator SPI write then read function.
 
err_t digiisolator_spi_transfer (digiisolator_t *ctx, uint8_t *data_in, uint8_t *data_out, uint8_t len)
 DIGI Isolator SPI transfer function.
 
err_t digiisolator_uart_write (digiisolator_t *ctx, char *data_in, uint16_t len)
 DIGI Isolator UART data writing function.
 
err_t digiisolator_uart_read (digiisolator_t *ctx, char *data_out, uint16_t len)
 DIGI Isolator UART data reading function.
 
err_t digiisolator_get_d1_pin_value (digiisolator_t *ctx, uint16_t *data_out)
 DIGI Isolator read D1 pin value function.
 
err_t digiisolator_get_d1_pin_voltage (digiisolator_t *ctx, float *data_out)
 DIGI Isolator read D1 pin voltage level function.
 
uint8_t digiisolator_get_d2 (digiisolator_t *ctx)
 DIGI Isolator get D2 function.
 

Detailed Description

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

◆ digiisolator_cfg_setup()

void digiisolator_cfg_setup ( digiisolator_cfg_t * cfg)

DIGI Isolator configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ digiisolator_get_d1_pin_value()

err_t digiisolator_get_d1_pin_value ( digiisolator_t * ctx,
uint16_t * data_out )

DIGI Isolator read D1 pin value function.

This function reads results of AD conversion of the D1 pin.

Parameters
[in]ctx: Click context object. See digiisolator_t object definition for detailed explanation.
[out]data_out: Output ADC result.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ digiisolator_get_d1_pin_voltage()

err_t digiisolator_get_d1_pin_voltage ( digiisolator_t * ctx,
float * data_out )

DIGI Isolator read D1 pin voltage level function.

This function reads results of AD conversion of the D1 pin and converts them to proportional voltage level.

Parameters
[in]ctx: Click context object. See digiisolator_t object definition for detailed explanation.
[out]data_out: Output voltage level of the analog pin [V].
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
The conversion to voltage depends on the entered configuration of the ADC (resolution, reference voltage).

◆ digiisolator_get_d2()

uint8_t digiisolator_get_d2 ( digiisolator_t * ctx)

DIGI Isolator get D2 function.

This function get states of the D2 ( INT ) pin.

Parameters
[in]ctx: Click context object. See digiisolator_t object definition for detailed explanation.
Returns
  • 0 - Low pin state,
  • 1 - High pin state.
Note
None.

◆ digiisolator_init()

err_t digiisolator_init ( digiisolator_t * ctx,
digiisolator_cfg_t * cfg )

DIGI Isolator initialization function.

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

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

◆ digiisolator_spi_read()

err_t digiisolator_spi_read ( digiisolator_t * ctx,
uint8_t * data_out,
uint8_t len )

DIGI Isolator SPI data reading function.

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

Parameters
[in]ctx: Click context object. See digiisolator_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.

◆ digiisolator_spi_transfer()

err_t digiisolator_spi_transfer ( digiisolator_t * ctx,
uint8_t * data_in,
uint8_t * data_out,
uint8_t len )

DIGI Isolator SPI transfer function.

This function writes and reads a desired number of data bytes by using SPI serial interface.

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

◆ digiisolator_spi_write()

err_t digiisolator_spi_write ( digiisolator_t * ctx,
uint8_t * data_in,
uint8_t len )

DIGI Isolator SPI data writing function.

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

Parameters
[in]ctx: Click context object. See digiisolator_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.

◆ digiisolator_spi_write_read()

err_t digiisolator_spi_write_read ( digiisolator_t * ctx,
uint8_t * data_in,
uint8_t len_in,
uint8_t * data_out,
uint8_t len_out )

DIGI Isolator SPI write then read function.

This function writes and then reads a desired number of data bytes by using SPI serial interface.

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

◆ digiisolator_uart_read()

err_t digiisolator_uart_read ( digiisolator_t * ctx,
char * data_out,
uint16_t len )

DIGI Isolator UART data reading function.

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

Parameters
[in]ctx: Click context object. See digiisolator_t object definition for detailed explanation.
[out]data_out: Output read data.
[in]len: Number of bytes to be read.
Returns
  • >0 - Number of data bytes read,
  • <=0 - Error/Empty Ring buffer. See #err_t definition for detailed explanation.
Note
None.

◆ digiisolator_uart_write()

err_t digiisolator_uart_write ( digiisolator_t * ctx,
char * data_in,
uint16_t len )

DIGI Isolator UART data writing function.

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

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