adc10 2.0.0.0
|
API for configuring and manipulating ADC 10 Click driver. More...
Topics | |
ADC 10 Commands List | |
List of commands of ADC 10 Click driver. | |
ADC 10 Device Settings | |
Settings for registers of ADC 10 Click driver. | |
ADC 10 MikroBUS Map | |
MikroBUS pin mapping of ADC 10 Click driver. | |
Functions | |
void | adc10_cfg_setup (adc10_cfg_t *cfg) |
ADC 10 configuration object setup function. | |
err_t | adc10_init (adc10_t *ctx, adc10_cfg_t *cfg) |
ADC 10 initialization function. | |
void | adc10_default_cfg (adc10_t *ctx) |
ADC 10 default configuration function. | |
err_t | adc10_generic_write (adc10_t *ctx, char *data_buf, uint16_t len) |
ADC 10 data writing function. | |
err_t | adc10_generic_read (adc10_t *ctx, char *data_buf, uint16_t max_len) |
ADC 10 data reading function. | |
void | adc10_hw_reset (adc10_t *ctx) |
ADC 10 Hardware reset function. | |
uint8_t | adc10_check_drdy (adc10_t *ctx) |
ADC 10 Check DRDY function. | |
void | adc10_send_command (adc10_t *ctx, uint8_t cmd) |
ADC 10 Send command function. | |
void | adc10_reset (adc10_t *ctx) |
ADC 10 Software reset function. | |
void | adc10_start_sync (adc10_t *ctx) |
ADC 10 Start the synchronization function. | |
void | adc10_shutdown (adc10_t *ctx) |
ADC 10 Shutdown function. | |
void | adc10_write_reg (adc10_t *ctx, uint8_t reg, uint8_t tx_data) |
ADC 10 Write register function. | |
uint8_t | adc10_read_reg (adc10_t *ctx, uint8_t reg) |
ADC 10 Read register function. | |
int32_t | adc10_get_ch_output (adc10_t *ctx, uint8_t sel_ch) |
ADC 10 Get the channel output function. | |
float | adc10_calc_voltage (adc10_t *ctx, int32_t adc_data, float vref, uint8_t gain) |
ADC 10 Calculate the voltage function. | |
void | adc10_set_config (adc10_t *ctx, adc10_settings_t cfg_data) |
ADC 10 Set configuration function. | |
void | adc10_get_config (adc10_t *ctx, adc10_settings_t *cfg_data) |
ADC 10 Get configuration function. | |
API for configuring and manipulating ADC 10 Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
float adc10_calc_voltage | ( | adc10_t * | ctx, |
int32_t | adc_data, | ||
float | vref, | ||
uint8_t | gain ) |
ADC 10 Calculate the voltage function.
This function reads the ADC output of the channel ADS122U04 24-Bit, 4-Channel, 2-kSPS, Delta-Sigma ADC With UART Interface on the ADC 10 click board.
[in] | ctx | : Click context object. See adc10_t object definition for detailed explanation. |
[in] | adc_data | : 24-bits of data ( two's complement format ) ADC data. |
[in] | vref | : Voltage reference ( mV ). |
[in] | gain | : Gain. |
void adc10_cfg_setup | ( | adc10_cfg_t * | cfg | ) |
ADC 10 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See adc10_cfg_t object definition for detailed explanation. |
uint8_t adc10_check_drdy | ( | adc10_t * | ctx | ) |
ADC 10 Check DRDY function.
This function indicates when a new conversion result is ready for retrieval of the ADS122U04 24-Bit, 4-Channel, 2-kSPS, Delta-Sigma ADC With UART Interface on the ADC 10 click board.
[in] | ctx | : Click context object. See adc10_t object definition for detailed explanation. |
0x00
( ADC10_NEW_DATA_IS_READY ) - Data ready, 0x01
( ADC10_NEW_DATA_NOT_READY ) - No new data.void adc10_default_cfg | ( | adc10_t * | ctx | ) |
ADC 10 default configuration function.
This function executes a default configuration of ADC 10 click board.
[in] | ctx | : Click context object. See adc10_t object definition for detailed explanation. |
err_t adc10_generic_read | ( | adc10_t * | ctx, |
char * | data_buf, | ||
uint16_t | max_len ) |
ADC 10 data reading function.
This function reads a desired number of data bytes by using UART serial interface.
[in] | ctx | : Click context object. See adc10_t object definition for detailed explanation. |
[out] | data_buf | : Output read data. |
[in] | max_len | : Number of bytes to be read. |
>0
- Number of data bytes read, <=0
- Error/Empty Ring buffer.err_t adc10_generic_write | ( | adc10_t * | ctx, |
char * | data_buf, | ||
uint16_t | len ) |
ADC 10 data writing function.
This function writes a desired number of data bytes by using UART serial interface.
[in] | ctx | : Click context object. See adc10_t object definition for detailed explanation. |
[in] | data_buf | : Data buffer for sending. |
[in] | len | : Number of bytes for sending. |
>=0
- Success, <0
- Error.int32_t adc10_get_ch_output | ( | adc10_t * | ctx, |
uint8_t | sel_ch ) |
ADC 10 Get the channel output function.
This function reads the ADC output of the channel ADS122U04 24-Bit, 4-Channel, 2-kSPS, Delta-Sigma ADC With UART Interface on the ADC 10 click board.
[in] | ctx | : Click context object. See adc10_t object definition for detailed explanation. |
[in] | sel_ch | :
|
void adc10_get_config | ( | adc10_t * | ctx, |
adc10_settings_t * | cfg_data ) |
ADC 10 Get configuration function.
This function get configuration data of the ADS122U04 24-Bit, 4-Channel, 2-kSPS, Delta-Sigma ADC With UART Interface on the ADC 10 click board.
[in] | ctx | : Click context object. See adc10_t object definition for detailed explanation. |
[out] | adc10_settings_t | : Click settings configuration object. |
void adc10_hw_reset | ( | adc10_t * | ctx | ) |
ADC 10 Hardware reset function.
This function perform a hardware reset the ADS122U04 24-Bit, 4-Channel, 2-kSPS, Delta-Sigma ADC With UART Interface on the ADC 10 click board.
[in] | ctx | : Click context object. See adc10_t object definition for detailed explanation. |
err_t adc10_init | ( | adc10_t * | ctx, |
adc10_cfg_t * | cfg ) |
ADC 10 initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See adc10_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See adc10_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error.uint8_t adc10_read_reg | ( | adc10_t * | ctx, |
uint8_t | reg ) |
ADC 10 Read register function.
This function perform a read the byte of data to the targeted 8-bit register address of the ADS122U04 24-Bit, 4-Channel, 2-kSPS, Delta-Sigma ADC With UART Interface on the ADC 10 click board.
[in] | ctx | : Click context object. See adc10_t object definition for detailed explanation. |
[in] | reg | : Register address. |
void adc10_reset | ( | adc10_t * | ctx | ) |
ADC 10 Software reset function.
This function perform a software reset ADS122U04 24-Bit, 4-Channel, 2-kSPS, Delta-Sigma ADC With UART Interface on the ADC 10 click board.
[in] | ctx | : Click context object. See adc10_t object definition for detailed explanation. |
void adc10_send_command | ( | adc10_t * | ctx, |
uint8_t | cmd ) |
ADC 10 Send command function.
This function sends the desired command to the ADS122U04 24-Bit, 4-Channel, 2-kSPS, Delta-Sigma ADC With UART Interface on the ADC 10 click board.
[in] | ctx | : Click context object. See adc10_t object definition for detailed explanation. |
[in] | cmd | : Commands instruction. |
void adc10_set_config | ( | adc10_t * | ctx, |
adc10_settings_t | cfg_data ) |
ADC 10 Set configuration function.
This function set configuration data of the ADS122U04 24-Bit, 4-Channel, 2-kSPS, Delta-Sigma ADC With UART Interface on the ADC 10 click board.
[in] | ctx | : Click context object. See adc10_t object definition for detailed explanation. |
[in] | adc10_settings_t | : Click settings configuration object. |
void adc10_shutdown | ( | adc10_t * | ctx | ) |
ADC 10 Shutdown function.
This function perform a shutdown of the ADS122U04 24-Bit, 4-Channel, 2-kSPS, Delta-Sigma ADC With UART Interface on the ADC 10 click board.
[in] | ctx | : Click context object. See adc10_t object definition for detailed explanation. |
void adc10_start_sync | ( | adc10_t * | ctx | ) |
ADC 10 Start the synchronization function.
This function send start sync command to the ADS122U04 24-Bit, 4-Channel, 2-kSPS, Delta-Sigma ADC With UART Interface on the ADC 10 click board.
[in] | ctx | : Click context object. See adc10_t object definition for detailed explanation. |
void adc10_write_reg | ( | adc10_t * | ctx, |
uint8_t | reg, | ||
uint8_t | tx_data ) |
ADC 10 Write register function.
This function perform a writes the byte of data to the targeted 8-bit register address of the ADS122U04 24-Bit, 4-Channel, 2-kSPS, Delta-Sigma ADC With UART Interface on the ADC 10 click board.
[in] | ctx | : Click context object. See adc10_t object definition for detailed explanation. |
[in] | reg | : Register address. |
[in] | tx_data | : Data to be written. |