adc15
2.0.0.0
|
API for configuring and manipulating ADC 15 Click driver. More...
Modules | |
ADC 15 Registers List | |
List of registers of ADC 15 Click driver. | |
ADC 15 Registers Settings | |
Settings for registers of ADC 15 Click driver. | |
ADC 15 MikroBUS Map | |
MikroBUS pin mapping of ADC 15 Click driver. | |
Functions | |
void | adc15_cfg_setup (adc15_cfg_t *cfg) |
ADC 15 configuration object setup function. More... | |
err_t | adc15_init (adc15_t *ctx, adc15_cfg_t *cfg) |
ADC 15 initialization function. More... | |
err_t | adc15_default_cfg (adc15_t *ctx) |
ADC 15 default configuration function. More... | |
err_t | adc15_adc_write (adc15_t *ctx, uint8_t *data_in, uint8_t len) |
Data writing function. More... | |
err_t | adc15_reg_write (adc15_t *ctx, uint8_t reg, uint16_t data_in) |
Register writing function. More... | |
err_t | adc15_multiple_reg_write (adc15_t *ctx, uint8_t reg, uint16_t *data_in, uint8_t data_size) |
Multiple register writing function. More... | |
err_t | adc15_adc_read (adc15_t *ctx, uint8_t *data_out, uint8_t len) |
Data reading function. More... | |
err_t | adc15_reg_read (adc15_t *ctx, uint8_t reg, uint16_t *data_out) |
Register reading function. More... | |
err_t | adc15_multiple_reg_read (adc15_t *ctx, uint8_t reg, uint16_t *data_out, uint8_t data_size) |
Multiple registern reading function. More... | |
err_t | adc15_adc_transfer (adc15_t *ctx, uint8_t *data_in, uint8_t *data_out, uint8_t len) |
Data transfer function. More... | |
err_t | adc15_ltc_write (adc15_t *ctx, uint8_t oct, uint16_t dac, uint8_t cfg) |
LTC writing function. More... | |
err_t | adc15_set_frequency (adc15_t *ctx, uint32_t frequency) |
Set sampling frequency. More... | |
err_t | adc15_read_adc_value (adc15_t *ctx, uint16_t *status, int32_t *ch1_out, int32_t *ch2_out) |
Get raw adc value. More... | |
err_t | adc15_read_voltage (adc15_t *ctx, uint16_t *status, float *ch1_out, float *ch2_out) |
Get voltage value. More... | |
uint8_t | adc15_data_ready (adc15_t *ctx) |
Get data ready state. More... | |
err_t | adc15_set_gain (adc15_t *ctx, adc15_channel_t channel, adc15_gain_t gain) |
Set gain for channel. More... | |
err_t | adc15_set_word_len (adc15_t *ctx, adc15_word_t word_len) |
Set word len. More... | |
API for configuring and manipulating ADC 15 Click driver.
err_t adc15_adc_read | ( | adc15_t * | ctx, |
uint8_t * | data_out, | ||
uint8_t | len | ||
) |
Data reading function.
This function reads a desired number of data bytes by using SPI serial interface.
[in] | ctx | : Click context object. See adc15_t object definition for detailed explanation. |
[out] | data_out | : Output read data. |
[in] | len | : Number of bytes to be read. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t adc15_adc_transfer | ( | adc15_t * | ctx, |
uint8_t * | data_in, | ||
uint8_t * | data_out, | ||
uint8_t | len | ||
) |
Data transfer function.
This function transfers a desired number of data bytes by using SPI serial interface.
[in] | ctx | : Click context object. See adc15_t object definition for detailed explanation. |
[in] | data_in | : Data to be written. |
[out] | data_out | : Output read data. |
[in] | len | : Transfer size. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t adc15_adc_write | ( | adc15_t * | ctx, |
uint8_t * | data_in, | ||
uint8_t | len | ||
) |
Data writing function.
This function writes a desired number of data bytes by using SPI serial interface.
[in] | ctx | : Click context object. See adc15_t object definition for detailed explanation. |
[in] | data_in | : Data to be written. |
[in] | len | : Number of bytes to be written. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. void adc15_cfg_setup | ( | adc15_cfg_t * | cfg | ) |
ADC 15 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See adc15_cfg_t object definition for detailed explanation. |
uint8_t adc15_data_ready | ( | adc15_t * | ctx | ) |
Get data ready state.
This function reads drdy pin status.
[in] | ctx | : Click context object. See adc15_t object definition for detailed explanation. |
err_t adc15_default_cfg | ( | adc15_t * | ctx | ) |
ADC 15 default configuration function.
This function executes a default configuration of ADC 15 click board.
[in] | ctx | : Click context object. See adc15_t object definition for detailed explanation. |
0
- Success, -1
- Error.err_t adc15_init | ( | adc15_t * | ctx, |
adc15_cfg_t * | cfg | ||
) |
ADC 15 initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See adc15_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See adc15_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error.err_t adc15_ltc_write | ( | adc15_t * | ctx, |
uint8_t | oct, | ||
uint16_t | dac, | ||
uint8_t | cfg | ||
) |
LTC writing function.
This function writes a data to the LTC by using SPI serial interface.
[in] | ctx | : Click context object. See adc15_t object definition for detailed explanation. |
[in] | oct | : Octet. |
[in] | dac | : DAC. |
[in] | cfg | : Configuration. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t adc15_multiple_reg_read | ( | adc15_t * | ctx, |
uint8_t | reg, | ||
uint16_t * | data_out, | ||
uint8_t | data_size | ||
) |
Multiple registern reading function.
This function reads a desired number of data words starting from the selected register by using SPI serial interface.
[in] | ctx | : Click context object. See adc15_t object definition for detailed explanation. |
[in] | reg | : Start register address. |
[out] | data_out | : Output read data. |
[in] | data_size | : Number of bytes to be read. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t adc15_multiple_reg_write | ( | adc15_t * | ctx, |
uint8_t | reg, | ||
uint16_t * | data_in, | ||
uint8_t | data_size | ||
) |
Multiple register writing function.
This function writes a desired number of data words starting from the selected register by using SPI serial interface.
[in] | ctx | : Click context object. See adc15_t object definition for detailed explanation. |
[in] | reg | : Start register address. |
[in] | data_in | : Data to be written. |
[in] | data_size | : Number of bytes to be written. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t adc15_read_adc_value | ( | adc15_t * | ctx, |
uint16_t * | status, | ||
int32_t * | ch1_out, | ||
int32_t * | ch2_out | ||
) |
Get raw adc value.
This function reads status and raw adc data from both channels.
[in] | ctx | : Click context object. See adc15_t object definition for detailed explanation. |
[out] | status | : Output status. |
[out] | ch1_out | : Channel 1 raw adc output. |
[out] | ch2_out | : Channel 2 raw adc output. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t adc15_read_voltage | ( | adc15_t * | ctx, |
uint16_t * | status, | ||
float * | ch1_out, | ||
float * | ch2_out | ||
) |
Get voltage value.
This function reads status and voltage level from both channels.
[in] | ctx | : Click context object. See adc15_t object definition for detailed explanation. |
[out] | status | : Output status. |
[out] | ch1_out | : Channel 1 voltage value. |
[out] | ch2_out | : Channel 2 voltage value. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t adc15_reg_read | ( | adc15_t * | ctx, |
uint8_t | reg, | ||
uint16_t * | data_out | ||
) |
Register reading function.
This function reads a data from the selected register by using SPI serial interface.
[in] | ctx | : Click context object. See adc15_t object definition for detailed explanation. |
[in] | reg | : Register address. |
[out] | data_out | : Output read data. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t adc15_reg_write | ( | adc15_t * | ctx, |
uint8_t | reg, | ||
uint16_t | data_in | ||
) |
Register writing function.
This function writes a data to the selected register by using SPI serial interface.
[in] | ctx | : Click context object. See adc15_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. err_t adc15_set_frequency | ( | adc15_t * | ctx, |
uint32_t | frequency | ||
) |
Set sampling frequency.
This function sets output frequency of LTC that controls sample rate of ADS131M02.
[in] | ctx | : Click context object. See adc15_t object definition for detailed explanation. |
[in] | frequency | : Frequency to set. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t adc15_set_gain | ( | adc15_t * | ctx, |
adc15_channel_t | channel, | ||
adc15_gain_t | gain | ||
) |
Set gain for channel.
This function sets gain for channel selected channel.
[in,out] | ctx | : Click context object. See adc15_t object definition for detailed explanation. |
[in] | channel | : Channel to change gain. See adc15_channel_t enum definition for detailed explanation. |
[in] | gain | : Gain to set. See adc15_gain_t enum definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t adc15_set_word_len | ( | adc15_t * | ctx, |
adc15_word_t | word_len | ||
) |
Set word len.
This function sets communication word length.
[in,out] | ctx | : Click context object. See adc15_t object definition for detailed explanation. |
[in] | word_len | : Word len to set. See adc15_word_t enum definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation.