turbidity 2.0.0.0
Turbidity Click Driver

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.
 

Detailed Description

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.

Function Documentation

◆ turbidity_cfg_setup()

void turbidity_cfg_setup ( turbidity_cfg_t * cfg)

Turbidity configuration object setup function.

This function initializes click configuration structure to initial values.

Parameters
[out]cfg: Click configuration structure. See turbidity_cfg_t object definition for detailed explanation.
Returns
Nothing.
Note
The all used pins will be set to unconnected state.

◆ turbidity_default_cfg()

err_t turbidity_default_cfg ( turbidity_t * ctx)

Turbidity default configuration function.

This function executes a default configuration of Turbidity click board.

Parameters
[in]ctx: Click context object. See turbidity_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
This function can consist any necessary configuration or setting to put device into operating mode.

◆ turbidity_generic_read()

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.

Parameters
[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.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ turbidity_get_adc_voltage()

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â„¢.

Parameters
[in]ctx: Click context object. See turbidity_t object definition for detailed explanation.
[out]voltage: Voltage ( mV ).
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ turbidity_get_ntu()

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â„¢.

Parameters
[in]ctx: Click context object. See turbidity_t object definition for detailed explanation.
[out]ntu: NTU data ( from 0 to 4000 ).
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ turbidity_init()

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.

Parameters
[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.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ turbidity_read_adc()

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â„¢.

Parameters
[in]ctx: Click context object. See turbidity_t object definition for detailed explanation.
[out]adc_val: Output 12-bit ADC data.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.