adc8 2.0.0.0
|
Functions | |
void | adc8_cfg_setup (adc8_cfg_t *cfg) |
Config Object Initialization function. | |
ADC8_RETVAL | adc8_init (adc8_t *ctx, adc8_cfg_t *cfg) |
Initialization function. | |
void | adc8_default_cfg (adc8_t *ctx) |
Click Default Configuration function. | |
void | adc8_generic_write (adc8_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len) |
Generic write function. | |
void | adc8_generic_read (adc8_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len) |
Generic read function. | |
void | adc8_set_cfg_register (adc8_t *ctx, uint16_t cfg) |
Device configuration for measurement. | |
uint16_t | adc8_get_adc_value (adc8_t *ctx, uint8_t channel) |
Get ADC value on the channel. | |
float | adc8_get_voltage (adc8_t *ctx, uint8_t channel) |
Read Voltage in mV. | |
uint8_t | adc8_get_interrupt_state (adc8_t *ctx) |
Get interrupt pin state. | |
void | adc8_get_single_channel (adc8_t *ctx, adc8_single_volt_t *volt) |
Get [Package} Single channel voltage. | |
void | adc8_get_diff_channel (adc8_t *ctx, adc8_diff_volt_t *volt) |
Get [Package] Diff channel voltage. | |
void adc8_cfg_setup | ( | adc8_cfg_t * | cfg | ) |
Config Object Initialization function.
cfg | Click configuration structure. |
@description This function initializes click configuration structure to init state.
void adc8_default_cfg | ( | adc8_t * | ctx | ) |
Click Default Configuration function.
ctx | Click object. |
@description This function executes default configuration for Adc8 click.
- Set config register: - ADC8_CFG_GAIN_2048mV - ADC8_CFG_MODE_SINGLE - ADC8_CFG_SPS_8 - ADC8_CFG_COMP_MODE_TRADITIONAL - ADC8_CFG_COMP_POL_LOW - ADC8_CFG_COMP_LAT_ENABLE - ADC8_CFG_COMP_QUE_4_CONV
void adc8_generic_read | ( | adc8_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_buf, | ||
uint8_t | len ) |
Generic read function.
ctx | Click object. |
reg | Register address. |
data_buf | Output data buf |
len | Number of the bytes to be read |
@description This function reads data from the desired register.
void adc8_generic_write | ( | adc8_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_buf, | ||
uint8_t | len ) |
Generic write function.
ctx | Click object. |
reg | Register address. |
data_buf | Data buf to be written. |
len | Number of the bytes in data buf. |
@description This function writes data to the desired register.
uint16_t adc8_get_adc_value | ( | adc8_t * | ctx, |
uint8_t | channel ) |
Get ADC value on the channel.
ctx | Click object. |
channel | Channel (Single - 0,1,2 or 3 and diff 0-1, 0-3, 1-3, or 2-3) |
void adc8_get_diff_channel | ( | adc8_t * | ctx, |
adc8_diff_volt_t * | volt ) |
Get [Package] Diff channel voltage.
ctx | Click object. |
*volt | Voltage - on the channel ( 0-1, 0-3, 1-3 and 2-3 ) |
uint8_t adc8_get_interrupt_state | ( | adc8_t * | ctx | ) |
Get interrupt pin state.
ctx | Click object. |
void adc8_get_single_channel | ( | adc8_t * | ctx, |
adc8_single_volt_t * | volt ) |
Get [Package} Single channel voltage.
ctx | Click object. |
*volt | Voltage - on the channel ( 0, 1, 2 and 3 ) |
float adc8_get_voltage | ( | adc8_t * | ctx, |
uint8_t | channel ) |
Read Voltage in mV.
ctx | Click object. |
channel | Channel (Single - 0,1,2 or 3 and diff 0-1, 0-3, 1-3, or 2-3) |
ADC8_RETVAL adc8_init | ( | adc8_t * | ctx, |
adc8_cfg_t * | cfg ) |
Initialization function.
ctx | Click object. |
cfg | Click configuration structure. |
@description This function initializes all necessary pins and peripherals used for this click.
void adc8_set_cfg_register | ( | adc8_t * | ctx, |
uint16_t | cfg ) |
Device configuration for measurement.
ctx | Click object. |
cfg | Config data |
- Conversions (Enable or Disable) - Gain (256mV, 512mV, 1024mV and 2048mV - "4096mV and 6144mV" - can make a reading problem) - Mode (Single and continuous) - Data Rate ( 8 SPS ... 860 SPS) - Comparator mode (traditional or window) - Comparator polarity (LOW or HIGH) - Comparator Latching (Enable or Disable) - Comparator queue (1,2,4 or after ALERT)