adc16 2.0.0.0
|
API for configuring and manipulating ADC 16 Click driver. More...
Topics | |
ADC 16 Registers List | |
List of registers of ADC 16 Click driver. | |
ADC 16 Registers Settings | |
Settings for registers of ADC 16 Click driver. | |
ADC 16 MikroBUS Map | |
MikroBUS pin mapping of ADC 16 Click driver. | |
Functions | |
void | adc16_cfg_setup (adc16_cfg_t *cfg) |
ADC 16 configuration object setup function. | |
err_t | adc16_init (adc16_t *ctx, adc16_cfg_t *cfg) |
ADC 16 initialization function. | |
err_t | adc16_default_cfg (adc16_t *ctx) |
ADC 16 default configuration function. | |
err_t | adc16_single_register_write (adc16_t *ctx, uint8_t reg, uint8_t data_in) |
ADC 16 single register write function. | |
err_t | adc16_single_register_read (adc16_t *ctx, uint8_t reg, uint8_t *data_out) |
ADC 16 single register read function. | |
err_t | adc16_set_register_bits (adc16_t *ctx, uint8_t reg, uint8_t bit_mask) |
ADC 16 set register bits function. | |
err_t | adc16_clear_register_bits (adc16_t *ctx, uint8_t reg, uint8_t bit_mask) |
ADC 16 clear register bits function. | |
err_t | adc16_continuous_register_write (adc16_t *ctx, uint8_t reg, uint8_t *tx_buf, uint8_t tx_len) |
ADC 16 continuous register write function. | |
err_t | adc16_continuous_register_read (adc16_t *ctx, uint8_t reg, uint8_t *rx_buf, uint8_t rx_len) |
ADC 16 continuous register read function. | |
uint8_t | adc16_get_rdy_pin (adc16_t *ctx) |
ADC 16 get rdy pin function. | |
uint8_t | adc16_get_alr_pin (adc16_t *ctx) |
ADC 16 get alr pin function. | |
err_t | adc16_get_voltage (adc16_t *ctx, float *ain0_voltage, float *ain1_voltage) |
ADC 16 get voltage function. | |
API for configuring and manipulating ADC 16 Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
void adc16_cfg_setup | ( | adc16_cfg_t * | cfg | ) |
ADC 16 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See adc16_cfg_t object definition for detailed explanation. |
err_t adc16_clear_register_bits | ( | adc16_t * | ctx, |
uint8_t | reg, | ||
uint8_t | bit_mask ) |
ADC 16 clear register bits function.
This function clears desired bits of the selected register. Bits with value as 1 in register data are cleared and bits with value as 0 in register data are not changed.
[in] | ctx | : Click context object. See adc16_t object definition for detailed explanation. |
[in] | reg | : Register address. |
[in] | bit_mask | : Bit mask. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t adc16_continuous_register_read | ( | adc16_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | rx_buf, | ||
uint8_t | rx_len ) |
ADC 16 continuous register read function.
This function reads a desired number of data bytes starting from the selected register by using I2C serial interface.
[in] | ctx | : Click context object. See adc16_t object definition for detailed explanation. |
[in] | reg | : Start register address. |
[out] | rx_buf | : Output read data. |
[in] | rx_len | : Number of bytes to be read. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t adc16_continuous_register_write | ( | adc16_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | tx_buf, | ||
uint8_t | tx_len ) |
ADC 16 continuous register write 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 adc16_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. See #err_t definition for detailed explanation. err_t adc16_default_cfg | ( | adc16_t * | ctx | ) |
ADC 16 default configuration function.
This function executes a default configuration of ADC 16 click board.
[in] | ctx | : Click context object. See adc16_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. uint8_t adc16_get_alr_pin | ( | adc16_t * | ctx | ) |
ADC 16 get alr pin function.
This function returns the ALR pin logic state.
[in] | ctx | : Click context object. See adc16_t object definition for detailed explanation. |
uint8_t adc16_get_rdy_pin | ( | adc16_t * | ctx | ) |
ADC 16 get rdy pin function.
This function returns the RDY pin logic state.
[in] | ctx | : Click context object. See adc16_t object definition for detailed explanation. |
err_t adc16_get_voltage | ( | adc16_t * | ctx, |
float * | ain0_voltage, | ||
float * | ain1_voltage ) |
ADC 16 get voltage function.
This function reads the voltage from two analog input single-ended channels.
[in] | ctx | : Click context object. See adc16_t object definition for detailed explanation. |
[out] | ain0_voltage | : AIN0 voltage value [V]. |
[out] | ain1_voltage | : AIN1 voltage value [V]. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t adc16_init | ( | adc16_t * | ctx, |
adc16_cfg_t * | cfg ) |
ADC 16 initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See adc16_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See adc16_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t adc16_set_register_bits | ( | adc16_t * | ctx, |
uint8_t | reg, | ||
uint8_t | bit_mask ) |
ADC 16 set register bits function.
This function sets desired bits of the selected register. Bits with value as 1 in register data are set and bits with value as 0 in register data are not changed.
[in] | ctx | : Click context object. See adc16_t object definition for detailed explanation. |
[in] | reg | : Register address. |
[in] | bit_mask | : Bit mask. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t adc16_single_register_read | ( | adc16_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_out ) |
ADC 16 single register read function.
This function reads a single data from the selected register.
[in] | ctx | : Click context object. See adc16_t object definition for detailed explanation. |
[in] | reg | : Register address. |
[out] | data_out | : Data read from register. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t adc16_single_register_write | ( | adc16_t * | ctx, |
uint8_t | reg, | ||
uint8_t | data_in ) |
ADC 16 single register write function.
This function writes a single data to the selected register.
[in] | ctx | : Click context object. See adc16_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.