digiin2
2.1.0.0
|
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... | |
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.
void digiin2_cfg_setup | ( | digiin2_cfg_t * | cfg | ) |
DIGI IN 2 configuration object setup function.
This function initializes Click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See digiin2_cfg_t object definition for detailed explanation. |
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.
[in] | ctx | : Click context object. See digiin2_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. 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.
[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. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. 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.
[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. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. 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.
[in] | ctx | : Click context object. See digiin2_t object definition for detailed explanation. |
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.
[in] | ctx | : Click context object. See digiin2_t object definition for detailed explanation. |
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.
[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. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. 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.
[in] | ctx | : Click context object. See digiin2_t object definition for detailed explanation. |
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.
[in] | ctx | : Click context object. See digiin2_t object definition for detailed explanation. |
[in] | channel_sel | : Register address. |
[out] | data_out | : Output read data. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. 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.
[in] | ctx | : Click context object. See digiin2_t object definition for detailed explanation. |
[in] | reg | : Register address. |
[out] | data_out | : Output read data. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. 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.
[in] | ctx | : Click context object. See digiin2_t object definition for detailed explanation. |
[in] | device_address | : Selected device address. |
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.
[in] | ctx | : Click context object. See digiin2_t object definition for detailed explanation. |
[in] | pin_state | : State of the LTC pin. |
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.
[in] | ctx | : Click context object. See digiin2_t object definition for detailed explanation. |
[in] | reg | : Register address. |
[in] | data_in | : Data to be written. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation.