adc26 2.1.0.0
|
API for configuring and manipulating ADC 26 Click driver. More...
Topics | |
ADC 26 Registers List | |
List of registers of ADC 26 Click driver. | |
ADC 26 Registers Settings | |
Settings for registers of ADC 26 Click driver. | |
ADC 26 MikroBUS Map | |
MikroBUS pin mapping of ADC 26 Click driver. | |
Functions | |
void | adc26_cfg_setup (adc26_cfg_t *cfg) |
ADC 26 configuration object setup function. | |
err_t | adc26_init (adc26_t *ctx, adc26_cfg_t *cfg) |
ADC 26 initialization function. | |
err_t | adc26_default_cfg (adc26_t *ctx) |
ADC 26 default configuration function. | |
err_t | adc26_write_reg (adc26_t *ctx, uint8_t reg, uint16_t data_in) |
ADC 26 write reg function. | |
err_t | adc26_read_reg (adc26_t *ctx, uint8_t reg, uint16_t *data_out) |
ADC 26 read reg function. | |
uint8_t | adc26_get_alert_pin (adc26_t *ctx) |
ADC 26 get alert pin function. | |
err_t | adc26_start_conversion (adc26_t *ctx, uint8_t mux, uint8_t pga) |
ADC 26 start conversion function. | |
err_t | adc26_write_threshold (adc26_t *ctx, int16_t lo_thresh, int16_t hi_thresh) |
ADC 26 write threshold function. | |
err_t | adc26_read_adc (adc26_t *ctx, int16_t *data_out) |
ADC 26 read ADC function. | |
err_t | adc26_read_voltage (adc26_t *ctx, float *voltage) |
ADC 26 read voltage function. | |
API for configuring and manipulating ADC 26 Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
void adc26_cfg_setup | ( | adc26_cfg_t * | cfg | ) |
ADC 26 configuration object setup function.
This function initializes Click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See adc26_cfg_t object definition for detailed explanation. |
err_t adc26_default_cfg | ( | adc26_t * | ctx | ) |
ADC 26 default configuration function.
This function executes a default configuration of ADC 26 Click board.
[in] | ctx | : Click context object. See adc26_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. uint8_t adc26_get_alert_pin | ( | adc26_t * | ctx | ) |
ADC 26 get alert pin function.
This function returns the ALERT (data ready) pin logic state.
[in] | ctx | : Click context object. See adc26_t object definition for detailed explanation. |
err_t adc26_init | ( | adc26_t * | ctx, |
adc26_cfg_t * | cfg ) |
ADC 26 initialization function.
This function initializes all necessary pins and peripherals used for this Click board.
[out] | ctx | : Click context object. See adc26_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See adc26_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t adc26_read_adc | ( | adc26_t * | ctx, |
int16_t * | data_out ) |
ADC 26 read ADC function.
This function reads the RAW ADC measurement.
[in] | ctx | : Click context object. See adc26_t object definition for detailed explanation. |
[out] | data_out | : RAW ADC data measurement [-2048,2047]. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t adc26_read_reg | ( | adc26_t * | ctx, |
uint8_t | reg, | ||
uint16_t * | data_out ) |
ADC 26 read reg function.
This function reads a desired data word from the selected register by using I2C serial interface.
[in] | ctx | : Click context object. See adc26_t object definition for detailed explanation. |
[in] | reg | : Register address. |
[out] | data_out | : Output read data word. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t adc26_read_voltage | ( | adc26_t * | ctx, |
float * | voltage ) |
ADC 26 read voltage function.
This function reads the RAW ADC measurement and converts it to a voltage level.
[in] | ctx | : Click context object. See adc26_t object definition for detailed explanation. |
[out] | voltage | : Voltage level output which is dependent on a PGA setting. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t adc26_start_conversion | ( | adc26_t * | ctx, |
uint8_t | mux, | ||
uint8_t | pga ) |
ADC 26 start conversion function.
This function starts a single-shot conversion for the selected MUX channel and gain level (full-scale range).
[in] | ctx | : Click context object. See adc26_t object definition for detailed explanation. |
[in] | mux | : MUX channel selection, see ADC26_MUX_x macros definition. |
[in] | pga | : Gain level or full-scale range selection, see ADC26_PGA_x macros definition. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t adc26_write_reg | ( | adc26_t * | ctx, |
uint8_t | reg, | ||
uint16_t | data_in ) |
ADC 26 write reg function.
This function writes a desired data word to the selected register by using I2C serial interface.
[in] | ctx | : Click context object. See adc26_t object definition for detailed explanation. |
[in] | reg | : Register address. |
[in] | data_in | : Data word to be written. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t adc26_write_threshold | ( | adc26_t * | ctx, |
int16_t | lo_thresh, | ||
int16_t | hi_thresh ) |
ADC 26 write threshold function.
This function writes the comparator upper and lower threshold ADC values.
[in] | ctx | : Click context object. See adc26_t object definition for detailed explanation. |
[in] | lo_thresh | : Lower threshold ADC value [-2048,2047]. |
[in] | hi_thresh | : Upper threshold ADC value [-2048,2047]. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation.