|
tds 2.2.0
|
API for configuring and manipulating TDS Click driver. More...
Topics | |
| TDS Settings | |
| Settings of TDS Click driver. | |
| TDS MikroBUS Map | |
| MikroBUS pin mapping of TDS Click driver. | |
Functions | |
| void | tds_cfg_setup (tds_cfg_t *cfg) |
| TDS configuration object setup function. | |
| void | tds_drv_interface_sel (tds_cfg_t *cfg, tds_drv_t drv_sel) |
| TDS driver interface setup function. | |
| err_t | tds_init (tds_t *ctx, tds_cfg_t *cfg) |
| TDS initialization function. | |
| err_t | tds_read_raw_adc (tds_t *ctx, uint16_t *raw_adc) |
| TDS read raw ADC value function. | |
| err_t | tds_read_voltage (tds_t *ctx, float *voltage) |
| TDS read voltage level function. | |
| err_t | tds_read_voltage_avg (tds_t *ctx, uint16_t num_conv, float *voltage_avg) |
| TDS read average voltage level function. | |
| err_t | tds_set_vref (tds_t *ctx, float vref) |
| TDS set vref function. | |
| err_t | tds_read_ppm (tds_t *ctx, float *data_out) |
| TDS read ppm function. | |
API for configuring and manipulating TDS Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
| void tds_cfg_setup | ( | tds_cfg_t * | cfg | ) |
TDS configuration object setup function.
This function initializes Click configuration structure to initial values.
| [out] | cfg | : Click configuration structure. See tds_cfg_t object definition for detailed explanation. |
TDS driver interface setup function.
This function sets a serial driver interface which will be used further in the Click driver.
| [out] | cfg | : Click configuration structure. See tds_cfg_t object definition for detailed explanation. |
| [in] | drv_sel | : Driver interface selection. See tds_drv_t object definition for detailed explanation. |
TDS initialization function.
This function initializes all necessary pins and peripherals used for this Click board.
| [out] | ctx | : Click context object. See tds_t object definition for detailed explanation. |
| [in] | cfg | : Click configuration structure. See tds_cfg_t object definition for detailed explanation. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | err_t tds_read_ppm | ( | tds_t * | ctx, |
| float * | data_out ) |
TDS read ppm function.
This function reads the TDS measurement value in ppm.
| [in] | ctx | : Click context object. See tds_t object definition for detailed explanation. |
| [out] | data_out | : Pointer to store the measured TDS value in ppm. |
0 - Success, -1 - Error. | err_t tds_read_raw_adc | ( | tds_t * | ctx, |
| uint16_t * | raw_adc ) |
TDS read raw ADC value function.
This function reads raw ADC value.
| [in] | ctx | : Click context object. See tds_t object definition for detailed explanation. |
| [out] | raw_adc | : Output ADC result. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | err_t tds_read_voltage | ( | tds_t * | ctx, |
| float * | voltage ) |
TDS read voltage level function.
This function reads raw ADC value and converts it to proportional voltage level.
| [in] | ctx | : Click context object. See tds_t object definition for detailed explanation. |
| [out] | voltage | : Output voltage level [V]. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | err_t tds_read_voltage_avg | ( | tds_t * | ctx, |
| uint16_t | num_conv, | ||
| float * | voltage_avg ) |
TDS read average voltage level function.
This function reads a desired number of ADC samples and calculates the average voltage level.
| [in] | ctx | : Click context object. See tds_t object definition for detailed explanation. |
| [in] | num_conv | : Number of ADC samples. |
| [out] | voltage_avg | : Average output voltage level [V]. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | err_t tds_set_vref | ( | tds_t * | ctx, |
| float | vref ) |
TDS set vref function.
This function sets the voltage reference for TDS Click driver.
| [in] | ctx | : Click context object. See tds_t object definition for detailed explanation. |
| [in] | vref | : Reference voltage (volts). |
0 - Success, -1 - Error. See #err_t definition for detailed explanation.