turbidity 2.0.0.0
|
API for configuring and manipulating Turbidity Click driver. More...
Topics | |
Turbidity Registers List | |
List of registers of Turbidity Click driver. | |
Turbidity Registers Settings | |
Settings for registers of Turbidity Click driver. | |
Turbidity MikroBUS Map | |
MikroBUS pin mapping of Turbidity Click driver. | |
Functions | |
void | turbidity_cfg_setup (turbidity_cfg_t *cfg) |
Turbidity configuration object setup function. | |
err_t | turbidity_init (turbidity_t *ctx, turbidity_cfg_t *cfg) |
Turbidity initialization function. | |
err_t | turbidity_default_cfg (turbidity_t *ctx) |
Turbidity default configuration function. | |
err_t | turbidity_generic_read (turbidity_t *ctx, uint8_t *rx_buf, uint8_t rx_len) |
Turbidity I2C reading function. | |
err_t | turbidity_read_adc (turbidity_t *ctx, uint16_t *adc_val) |
Turbidity read ADC function. | |
err_t | turbidity_get_adc_voltage (turbidity_t *ctx, float *voltage) |
Turbidity get voltage function. | |
err_t | turbidity_get_ntu (turbidity_t *ctx, float *ntu) |
Turbidity get NTU function. | |
API for configuring and manipulating Turbidity Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
void turbidity_cfg_setup | ( | turbidity_cfg_t * | cfg | ) |
Turbidity configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See turbidity_cfg_t object definition for detailed explanation. |
err_t turbidity_default_cfg | ( | turbidity_t * | ctx | ) |
Turbidity default configuration function.
This function executes a default configuration of Turbidity click board.
[in] | ctx | : Click context object. See turbidity_t object definition for detailed explanation. |
0
- Success, -1
- Error.err_t turbidity_generic_read | ( | turbidity_t * | ctx, |
uint8_t * | rx_buf, | ||
uint8_t | rx_len ) |
Turbidity I2C reading function.
This function reads a desired number of data bytes starting by using I2C serial interface.
[in] | ctx | : Click context object. See turbidity_t object definition for detailed explanation. |
[out] | rx_buf | : Output read data. |
[in] | rx_len | : Number of bytes to be read. |
0
- Success, -1
- Error.err_t turbidity_get_adc_voltage | ( | turbidity_t * | ctx, |
float * | voltage ) |
Turbidity get voltage function.
This function reads 12-bit ADC data and calculate the voltage of the TSD-10 Turbidity Sensor on the Turbidity click boardâ„¢.
[in] | ctx | : Click context object. See turbidity_t object definition for detailed explanation. |
[out] | voltage | : Voltage ( mV ). |
0
- Success, -1
- Error.err_t turbidity_get_ntu | ( | turbidity_t * | ctx, |
float * | ntu ) |
Turbidity get NTU function.
This function reads 12-bit ADC data and calculate the Nephelometric Turbidity Units ( NTU ) of the TSD-10 Turbidity Sensor on the Turbidity click boardâ„¢.
[in] | ctx | : Click context object. See turbidity_t object definition for detailed explanation. |
[out] | ntu | : NTU data ( from 0 to 4000 ). |
0
- Success, -1
- Error.err_t turbidity_init | ( | turbidity_t * | ctx, |
turbidity_cfg_t * | cfg ) |
Turbidity initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See turbidity_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See turbidity_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error.err_t turbidity_read_adc | ( | turbidity_t * | ctx, |
uint16_t * | adc_val ) |
Turbidity read ADC function.
This function reads 12-bit ADC data of the TSD-10 Turbidity Sensor on the Turbidity click boardâ„¢.
[in] | ctx | : Click context object. See turbidity_t object definition for detailed explanation. |
[out] | adc_val | : Output 12-bit ADC data. |
0
- Success, -1
- Error.