Initial (empty) Si7021 driver

This commit is contained in:
Pim van Pelt
2018-04-02 17:59:41 +02:00
parent 27bba32bd9
commit 2899ee59de
5 changed files with 187 additions and 9 deletions

46
include/mgos_si7021.h Normal file
View File

@ -0,0 +1,46 @@
#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