42#ifdef PREINIT_SUPPORTED
46#ifdef MikroCCoreVersion
47 #if MikroCCoreVersion >= 1
52#include "drv_digital_out.h"
53#include "drv_digital_in.h"
54#include "drv_i2c_master.h"
67#define TEMPHUM5_MAP_MIKROBUS( cfg, mikrobus ) \
68 cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \
69 cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA ); \
70 cfg.all = MIKROBUS( mikrobus, MIKROBUS_PWM ); \
71 cfg.alh = MIKROBUS( mikrobus, MIKROBUS_INT )
78#define TEMPHUM5_RETVAL uint8_t
80#define TEMPHUM5_OK 0x00
81#define TEMPHUM5_INIT_ERROR 0xFF
88#define TEMPHUM5_DEVICE_SLAVE_ADDRESS 0x27
95#define TEMPHUM5_TEMP_DATA_IN_CELSIUS 0x01
96#define TEMPHUM5_TEMP_DATA_IN_KELVIN 0x02
97#define TEMPHUM5_TEMP_DATA_IN_FAHRENHEIT 0x03
105#define TEMPHUM5_STATUS_NORMAL_OPERATION 0x00
106#define TEMPHUM5_STATUS_STALE_DATA 0x01
107#define TEMPHUM5_STATUS_COMMAND_MODE 0x02
114#define TEMPHUM5_ALARM_OUTPUT_HIGH 0x01
115#define TEMPHUM5_ALARM_OUTPUT_LOW 0x02
#define TEMPHUM5_RETVAL
Definition temphum5.h:78
void temphum5_generic_write(temphum5_t *ctx, uint8_t cmd)
Generic write function.
float temphum5_get_temperature(temphum5_t *ctx, uint8_t temp_in)
Functions for read Temperature data.
uint8_t temphum5_get_alarm(temphum5_t *ctx, uint8_t alarm)
Functions for get output Alarm.
void temphum5_generic_read(temphum5_t *ctx, uint8_t *data_out)
Generic read function.
float temphum5_get_humidity(temphum5_t *ctx)
Functions for read Relative Huminidy data.
TEMPHUM5_RETVAL temphum5_init(temphum5_t *ctx, temphum5_cfg_t *cfg)
Initialization function.
uint8_t temphum5_start_measurement(temphum5_t *ctx)
Functions for start measurement.
void temphum5_cfg_setup(temphum5_cfg_t *cfg)
Config Object Initialization function.
Click configuration structure definition.
Definition temphum5.h:152
pin_name_t all
Definition temphum5.h:160
uint32_t i2c_speed
Definition temphum5.h:165
uint16_t dev_temperature
Definition temphum5.h:168
pin_name_t alh
Definition temphum5.h:161
uint16_t dev_humidity
Definition temphum5.h:169
pin_name_t scl
Definition temphum5.h:155
pin_name_t sda
Definition temphum5.h:156
uint8_t i2c_address
Definition temphum5.h:166
Click ctx object definition.
Definition temphum5.h:129
uint16_t humidity
Definition temphum5.h:144
digital_in_t all
Definition temphum5.h:132
uint16_t temperature
Definition temphum5.h:143
i2c_master_t i2c
Definition temphum5.h:137
digital_in_t alh
Definition temphum5.h:133
uint8_t slave_address
Definition temphum5.h:141