daq 2.0.0.0
|
API for configuring and manipulating DAQ Click driver. More...
Topics | |
DAQ Registers List | |
List of registers of DAQ Click driver. | |
DAQ Registers Settings | |
Settings for registers of DAQ Click driver. | |
DAQ MikroBUS Map | |
MikroBUS pin mapping of DAQ Click driver. | |
Functions | |
void | daq_cfg_setup (daq_cfg_t *cfg) |
DAQ configuration object setup function. | |
err_t | daq_init (daq_t *ctx, daq_cfg_t *cfg) |
DAQ initialization function. | |
err_t | daq_default_cfg (daq_t *ctx) |
DAQ default configuration function. | |
err_t | daq_generic_write (daq_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len) |
DAQ data writing function. | |
err_t | daq_byte_write (daq_t *ctx, uint8_t reg, uint8_t data_in) |
DAQ byte writing function. | |
err_t | daq_mask_write (daq_t *ctx, uint8_t reg, uint8_t mask, uint8_t data_in) |
DAQ byte writing function with mask. | |
err_t | daq_generic_read (daq_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len) |
DAQ data reading function. | |
err_t | daq_byte_read (daq_t *ctx, uint8_t reg, uint8_t *data_out) |
DAQ byte reading function. | |
err_t | daq_mask_read (daq_t *ctx, uint8_t reg, uint8_t mask, uint8_t *data_out) |
DAQ byte reading function with mask. | |
err_t | daq_raw_read (daq_t *ctx, uint8_t *data_out, uint8_t len) |
DAQ reading function. | |
void | daq_reset (daq_t *ctx) |
Reset function. | |
uint8_t | daq_data_ready (daq_t *ctx) |
Get data ready pin. | |
void | daq_set_io3 (daq_t *ctx, uint8_t state) |
Set io3 pin. | |
uint8_t | daq_get_iot3 (daq_t *ctx) |
Get io3 pin. | |
err_t | daq_set_gain (daq_t *ctx, daq_gain gain) |
Set gain range. | |
err_t | daq_read_data (daq_t *ctx, int32_t *adc_data) |
Reading adc data. | |
void | daq_calculate_voltage (daq_t *ctx, int32_t adc_data, float *voltage) |
Convert data from raw ADC to voltage. | |
API for configuring and manipulating DAQ Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
err_t daq_byte_read | ( | daq_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_out ) |
DAQ byte reading function.
This function reads a byte from the selected register.
[in] | ctx | : Click context object. See daq_t object definition for detailed explanation. |
[in] | reg | : Register address. |
[out] | data_out | : Output read data. |
0
- Success, -1
- Error.err_t daq_byte_write | ( | daq_t * | ctx, |
uint8_t | reg, | ||
uint8_t | data_in ) |
DAQ byte writing function.
This function writes a byte to the selected register.
[in] | ctx | : Click context object. See daq_t object definition for detailed explanation. |
[in] | reg | : Register address. |
[in] | data_in | : Data to be written. |
0
- Success, -1
- Error.void daq_calculate_voltage | ( | daq_t * | ctx, |
int32_t | adc_data, | ||
float * | voltage ) |
Convert data from raw ADC to voltage.
This function calculates voltage data from raw adc_data and gain value from ctx object.
[in] | ctx | : Click context object. See daq_t object definition for detailed explanation. |
[in] | adc_data | : ADC data from device. |
[out] | voltage | : Calculated data in V. |
void daq_cfg_setup | ( | daq_cfg_t * | cfg | ) |
DAQ configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See daq_cfg_t object definition for detailed explanation. |
uint8_t daq_data_ready | ( | daq_t * | ctx | ) |
Get data ready pin.
This function reads data ready pin state.
[in] | ctx | : Click context object. See daq_t object definition for detailed explanation. |
err_t daq_default_cfg | ( | daq_t * | ctx | ) |
DAQ default configuration function.
This function executes a default configuration of DAQ click board.
[in] | ctx | : Click context object. See daq_t object definition for detailed explanation. |
0
- Success, -1
- Error.err_t daq_generic_read | ( | daq_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_out, | ||
uint8_t | len ) |
DAQ data reading function.
This function reads a desired number of data bytes starting from the selected register by using SPI serial interface.
[in] | ctx | : Click context object. See daq_t object definition for detailed explanation. |
[in] | reg | : Start register address. |
[out] | data_out | : Output read data. |
[in] | len | : Number of bytes to be read. |
0
- Success, -1
- Error.err_t daq_generic_write | ( | daq_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_in, | ||
uint8_t | len ) |
DAQ data writing function.
This function writes a desired number of data bytes starting from the selected register by using SPI serial interface.
[in] | ctx | : Click context object. See daq_t object definition for detailed explanation. |
[in] | reg | : Start register address. |
[in] | data_in | : Data to be written. |
[in] | len | : Number of bytes to be written. |
0
- Success, -1
- Error.uint8_t daq_get_iot3 | ( | daq_t * | ctx | ) |
Get io3 pin.
This function reads io3 pin state.
[in] | ctx | : Click context object. See daq_t object definition for detailed explanation. |
DAQ initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See daq_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See daq_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error.err_t daq_mask_read | ( | daq_t * | ctx, |
uint8_t | reg, | ||
uint8_t | mask, | ||
uint8_t * | data_out ) |
DAQ byte reading function with mask.
This function reads a byte from the selected register by using mask.
[in] | ctx | : Click context object. See daq_t object definition for detailed explanation. |
[in] | reg | : Register address. |
[in] | mask | : Mask. |
[out] | data_out | : Output read data. |
0
- Success, -1
- Error.err_t daq_mask_write | ( | daq_t * | ctx, |
uint8_t | reg, | ||
uint8_t | mask, | ||
uint8_t | data_in ) |
DAQ byte writing function with mask.
This function writes a byte to the selected register by using mask.
[in] | ctx | : Click context object. See daq_t object definition for detailed explanation. |
[in] | reg | : Register address. |
[in] | mask | : Mask. |
[in] | data_in | : Register data. |
0
- Success, -1
- Error.err_t daq_raw_read | ( | daq_t * | ctx, |
uint8_t * | data_out, | ||
uint8_t | len ) |
DAQ reading function.
This function reads a desired number of data bytes by using SPI serial interface.
[in] | ctx | : Click context object. See daq_t object definition for detailed explanation. |
[out] | data_out | : Output read data. |
[in] | len | : Number of bytes to be read. |
0
- Success, -1
- Error.err_t daq_read_data | ( | daq_t * | ctx, |
int32_t * | adc_data ) |
Reading adc data.
This function reads a ADC_DATA register using it with DAQ_CONV_ONE_SHOT conversion.
[in] | ctx | : Click context object. See daq_t object definition for detailed explanation. |
[out] | adc_data | : Output read data. |
0
- Success, -1
- Error.void daq_reset | ( | daq_t * | ctx | ) |
Reset function.
This function resets device by toggling rst pin.
[in] | ctx | : Click context object. See daq_t object definition for detailed explanation. |
Set gain range.
This function sets gain pins and with that sets ADC range.
[in] | ctx | : Click context object. See daq_t object definition for detailed explanation. |
[in] | gain | : Gain range. See daq_gain enum definition for detailed explanation. |
0
- Success, -1
- Error.