isoadc3 2.0.0.0
|
API for configuring and manipulating ISO ADC 3 Click driver. More...
Topics | |
ISO ADC 3 Registers Settings | |
Settings for registers of ISO ADC 3 Click driver. | |
ISO ADC 3 MikroBUS Map | |
MikroBUS pin mapping of ISO ADC 3 Click driver. | |
Functions | |
void | isoadc3_cfg_setup (isoadc3_cfg_t *cfg) |
ISO ADC 3 configuration object setup function. | |
err_t | isoadc3_init (isoadc3_t *ctx, isoadc3_cfg_t *cfg) |
ISO ADC 3 initialization function. | |
err_t | isoadc3_generic_write (isoadc3_t *ctx, uint8_t reg, uint8_t *tx_buf, uint8_t tx_len) |
ISO ADC 3 I2C writing function. | |
err_t | isoadc3_generic_read (isoadc3_t *ctx, uint8_t reg, uint8_t *rx_buf, uint8_t rx_len) |
ISO ADC 3 I2C reading function. | |
uint16_t | isoadc3_read_adc (isoadc3_t *ctx) |
Read ADC function. | |
uint16_t | isoadc3_get_adc_voltage (isoadc3_t *ctx, uint16_t v_ref) |
Read ADC voltage function. | |
uint16_t | isoadc3_read_voltage (isoadc3_t *ctx, uint16_t v_ref) |
Read voltage function. | |
API for configuring and manipulating ISO ADC 3 Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
void isoadc3_cfg_setup | ( | isoadc3_cfg_t * | cfg | ) |
ISO ADC 3 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See isoadc3_cfg_t object definition for detailed explanation. |
err_t isoadc3_generic_read | ( | isoadc3_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | rx_buf, | ||
uint8_t | rx_len ) |
ISO ADC 3 I2C reading function.
This function reads a desired number of data bytes starting from the selected register by using I2C serial interface.
[in] | reg | : Start register address. |
[out] | rx_buf | : Output read data. |
[in] | rx_len | : Number of bytes to be read. |
0
- Success, -1
- Error.err_t isoadc3_generic_write | ( | isoadc3_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | tx_buf, | ||
uint8_t | tx_len ) |
ISO ADC 3 I2C writing function.
This function writes a desired number of data bytes starting from the selected register by using I2C serial interface.
[in] | ctx | : Click context object. See isoadc3_t object definition for detailed explanation. |
[in] | reg | : Start register address. |
[in] | tx_buf | : Data to be written. |
[in] | tx_len | : Number of bytes to be written. |
0
- Success, -1
- Error.uint16_t isoadc3_get_adc_voltage | ( | isoadc3_t * | ctx, |
uint16_t | v_ref ) |
Read ADC voltage function.
Function is used to read raw voltage data from MCP3221.
[in] | ctx | : Click context object. See isoadc3_t object definition for detailed explanation. |
[in] | v_ref | : 16-bit value representing power supply voltage. |
err_t isoadc3_init | ( | isoadc3_t * | ctx, |
isoadc3_cfg_t * | cfg ) |
ISO ADC 3 initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See isoadc3_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See isoadc3_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error.uint16_t isoadc3_read_adc | ( | isoadc3_t * | ctx | ) |
Read ADC function.
Function is used to read raw ADC data from MCP3221.
[in] | ctx | : Click context object. See isoadc3_t object definition for detailed explanation. |
uint16_t isoadc3_read_voltage | ( | isoadc3_t * | ctx, |
uint16_t | v_ref ) |
Read voltage function.
Function is used to calculate voltage of the connected battery.
[in] | ctx | : Click context object. See isoadc3_t object definition for detailed explanation. |
[in] | v_ref | : 16-bit value representing power supply voltage. |