39#ifdef PREINIT_SUPPORTED
43#ifdef MikroCCoreVersion
44 #if MikroCCoreVersion >= 1
49#include "drv_digital_out.h"
50#include "drv_digital_in.h"
51#include "drv_i2c_master.h"
79#define TURBIDITY_SET_DEV_ADDR 0x4D
97#define TURBIDITY_MAP_MIKROBUS( cfg, mikrobus ) \
98 cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \
99 cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA )
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_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.
err_t turbidity_read_adc(turbidity_t *ctx, uint16_t *adc_val)
Turbidity read ADC 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.
Turbidity Click configuration object.
Definition turbidity.h:123
uint32_t i2c_speed
Definition turbidity.h:127
pin_name_t scl
Definition turbidity.h:124
pin_name_t sda
Definition turbidity.h:125
uint8_t i2c_address
Definition turbidity.h:128
Turbidity Click context object.
Definition turbidity.h:109
i2c_master_t i2c
Definition turbidity.h:111
uint8_t slave_address
Definition turbidity.h:114
turbidity_return_value_t
Turbidity Click return value data.
Definition turbidity.h:137
@ TURBIDITY_OK
Definition turbidity.h:138
@ TURBIDITY_ERROR
Definition turbidity.h:139