digiin2  2.1.0.0
Modules | Functions
DIGI IN 2 Click Driver

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

Modules

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

Functions

void digiin2_cfg_setup (digiin2_cfg_t *cfg)
 DIGI IN 2 configuration object setup function. More...
 
err_t digiin2_init (digiin2_t *ctx, digiin2_cfg_t *cfg)
 DIGI IN 2 initialization function. More...
 
err_t digiin2_default_cfg (digiin2_t *ctx)
 DIGI IN 2 default configuration function. More...
 
void digiin2_set_dev_address (digiin2_t *ctx, uint8_t device_address)
 DIGI IN 2 set device address function. More...
 
err_t digiin2_generic_write (digiin2_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len)
 DIGI IN 2 data writing function. More...
 
err_t digiin2_generic_read (digiin2_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len)
 DIGI IN 2 data reading function. More...
 
void digiin2_set_ltc_pin (digiin2_t *ctx, uint8_t pin_state)
 DIGI IN 2 set LTC pin function. More...
 
uint8_t digiin2_get_rdy_pin (digiin2_t *ctx)
 DIGI IN 2 get RDY pin state function. More...
 
uint8_t digiin2_get_flt_pin (digiin2_t *ctx)
 DIGI IN 2 get FLT pin state function. More...
 
err_t digiin2_write_reg (digiin2_t *ctx, uint8_t reg, uint8_t data_in)
 DIGI IN 2 register write function. More...
 
err_t digiin2_read_reg (digiin2_t *ctx, uint8_t reg, uint8_t *data_out)
 DIGI IN 2 register reading function. More...
 
err_t digiin2_read_ch_counter (digiin2_t *ctx, uint8_t channel_sel, uint16_t *data_out)
 DIGI IN 2 channel counter reading function. More...
 
void digiin2_pulse_latch (digiin2_t *ctx)
 DIGI IN 2 send latch pulse function. More...
 

Detailed Description

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

◆ digiin2_cfg_setup()

void digiin2_cfg_setup ( digiin2_cfg_t cfg)

DIGI IN 2 configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ digiin2_default_cfg()

err_t digiin2_default_cfg ( digiin2_t ctx)

DIGI IN 2 default configuration function.

This function executes a default configuration of DIGI IN 2 click board.

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

◆ digiin2_generic_read()

err_t digiin2_generic_read ( digiin2_t ctx,
uint8_t  reg,
uint8_t *  data_out,
uint8_t  len 
)

DIGI IN 2 data reading function.

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

Parameters
[in]ctx: Click context object. See digiin2_t object definition for detailed explanation.
[in]reg: Start register address.
[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.

◆ digiin2_generic_write()

err_t digiin2_generic_write ( digiin2_t ctx,
uint8_t  reg,
uint8_t *  data_in,
uint8_t  len 
)

DIGI IN 2 data writing function.

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

Parameters
[in]ctx: Click context object. See digiin2_t object definition for detailed explanation.
[in]reg: Start register address.
[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.

◆ digiin2_get_flt_pin()

uint8_t digiin2_get_flt_pin ( digiin2_t ctx)

DIGI IN 2 get FLT pin state function.

This function is used to get state of the FLT pin.

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

◆ digiin2_get_rdy_pin()

uint8_t digiin2_get_rdy_pin ( digiin2_t ctx)

DIGI IN 2 get RDY pin state function.

This function is used to get state of the RDY pin.

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

◆ digiin2_init()

err_t digiin2_init ( digiin2_t ctx,
digiin2_cfg_t cfg 
)

DIGI IN 2 initialization function.

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

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

◆ digiin2_pulse_latch()

void digiin2_pulse_latch ( digiin2_t ctx)

DIGI IN 2 send latch pulse function.

This function is used to generate LATCH pulse for capturing channel data.

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

◆ digiin2_read_ch_counter()

err_t digiin2_read_ch_counter ( digiin2_t ctx,
uint8_t  channel_sel,
uint16_t *  data_out 
)

DIGI IN 2 channel counter reading function.

This function counter data from the selected channel by using SPI serial interface.

Parameters
[in]ctx: Click context object. See digiin2_t object definition for detailed explanation.
[in]channel_sel: Register address.
[out]data_out: Output read data.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ digiin2_read_reg()

err_t digiin2_read_reg ( digiin2_t ctx,
uint8_t  reg,
uint8_t *  data_out 
)

DIGI IN 2 register reading function.

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

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

◆ digiin2_set_dev_address()

void digiin2_set_dev_address ( digiin2_t ctx,
uint8_t  device_address 
)

DIGI IN 2 set device address function.

This function is used to set device address.

Parameters
[in]ctx: Click context object. See digiin2_t object definition for detailed explanation.
[in]device_address: Selected device address.
Returns
Nothing.
Note
None.

◆ digiin2_set_ltc_pin()

void digiin2_set_ltc_pin ( digiin2_t ctx,
uint8_t  pin_state 
)

DIGI IN 2 set LTC pin function.

This function is used to set state of the LTC pin.

Parameters
[in]ctx: Click context object. See digiin2_t object definition for detailed explanation.
[in]pin_state: State of the LTC pin.
Returns
Nothing.
Note
None.

◆ digiin2_write_reg()

err_t digiin2_write_reg ( digiin2_t ctx,
uint8_t  reg,
uint8_t  data_in 
)

DIGI IN 2 register write function.

This function is used to write data into the selected register by using SPI serial interface.

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