47 lines
585 B
C
47 lines
585 B
C
#pragma once
|
|
|
|
#include "mgos.h"
|
|
#include "mgos_i2c.h"
|
|
|
|
#define MGOS_SI7021_READ_DELAY (2)
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
struct mgos_si7021;
|
|
|
|
/*
|
|
*
|
|
*/
|
|
struct mgos_si7021 *mgos_si7021_create(struct mgos_i2c *i2c, uint8_t i2caddr);
|
|
|
|
/*
|
|
*
|
|
*/
|
|
void mgos_si7021_destroy(struct mgos_si7021 **sensor);
|
|
|
|
/*
|
|
*
|
|
*/
|
|
bool mgos_si7021_read(struct mgos_si7021 *sensor);
|
|
|
|
/*
|
|
*
|
|
*/
|
|
float mgos_si7021_getTemperature(struct mgos_si7021 *sensor);
|
|
|
|
/*
|
|
*
|
|
*/
|
|
float mgos_si7021_getHumidity(struct mgos_si7021 *sensor);
|
|
|
|
/*
|
|
*
|
|
*/
|
|
bool mgos_si7021_i2c_init(void);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|