humidity 2.0.0.0
humidity.h File Reference

This file contains API for Humidity Click Driver. More...

#include "drv_digital_out.h"
#include "drv_digital_in.h"
#include "drv_analog_in.h"
#include "drv_i2c_master.h"

Go to the source code of this file.

Data Structures

struct  humidity_t
 Humidity Click context object. More...
 
struct  humidity_cfg_t
 Humidity Click configuration object. More...
 

Macros

#define HUMIDITY_SET_DEV_ADDR   0x4D
 Humidity device address setting.
 
#define HUMIDITY_ADC_RESOLUTION   0x0FFF
 Humidity ADC setting.
 
#define HUMIDITY_VREF_3V3   3.3
 
#define HUMIDITY_VREF_5V   5.0
 
#define HUMIDITY_DIVISOR   0.00636
 Humidity constants.
 
#define HUMIDITY_SUBTRAHEND   0.1515
 
#define HUMIDITY_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Enumerations

enum  humidity_drv_t { HUMIDITY_DRV_SEL_ADC , HUMIDITY_DRV_SEL_I2C }
 Humidity Click driver selector. More...
 
enum  humidity_return_value_t { HUMIDITY_OK = 0 , HUMIDITY_ERROR = -1 }
 Humidity Click return value data. More...
 

Functions

void humidity_cfg_setup (humidity_cfg_t *cfg)
 Humidity configuration object setup function.
 
void humidity_drv_interface_selection (humidity_cfg_t *cfg, humidity_drv_t drv_sel)
 Humidity driver interface setup function.
 
err_t humidity_init (humidity_t *ctx, humidity_cfg_t *cfg)
 Humidity initialization function.
 
err_t humidity_read_raw_adc (humidity_t *ctx, uint16_t *raw_adc)
 Humidity read raw ADC value function.
 
err_t humidity_read_voltage (humidity_t *ctx, float *voltage)
 Humidity read voltage level function.
 
err_t humidity_set_vref (humidity_t *ctx, float vref)
 Humidity set vref function.
 
float humidity_voltage_to_rh (humidity_t *ctx, float voltage)
 Humidity voltage to relative humidity function.
 

Detailed Description

This file contains API for Humidity Click Driver.

Enumeration Type Documentation

◆ humidity_drv_t

Humidity Click driver selector.

Selects target driver interface of Humidity Click driver.

Enumerator
HUMIDITY_DRV_SEL_ADC 

ADC driver descriptor.

HUMIDITY_DRV_SEL_I2C 

I2C driver descriptor.

◆ humidity_return_value_t

Humidity Click return value data.

Predefined enum values for driver return values.

Enumerator
HUMIDITY_OK 
HUMIDITY_ERROR