ESP32-PaxCounter/include/bme680mems.h

31 lines
1.1 KiB
C
Raw Normal View History

2018-11-22 23:37:53 +01:00
#ifndef _BME680MEMS_H
#define _BME680MEMS_H
#include "globals.h"
#include <Wire.h>
2018-11-25 11:48:03 +01:00
#include "bsec_integration.h"
2018-11-22 23:37:53 +01:00
2018-11-25 20:56:14 +01:00
extern const uint8_t bsec_config_iaq[454];
2018-11-22 23:37:53 +01:00
extern bmeStatus_t
bme_status; // Make struct for storing gps data globally available
2018-11-25 16:05:30 +01:00
extern TaskHandle_t BmeTask;
2018-11-22 23:37:53 +01:00
2018-11-25 11:48:03 +01:00
int bme_init();
2018-11-25 16:05:30 +01:00
void bme_loop(void *pvParameters);
int8_t i2c_read(uint8_t dev_id, uint8_t reg_addr, uint8_t *reg_data,
uint16_t len);
int8_t i2c_write(uint8_t dev_id, uint8_t reg_addr, uint8_t *reg_data,
uint16_t len);
void output_ready(int64_t timestamp, float iaq, uint8_t iaq_accuracy,
float temperature, float humidity, float pressure,
float raw_temperature, float raw_humidity, float gas,
bsec_library_return_t bsec_status, float static_iaq,
float co2_equivalent, float breath_voc_equivalent);
2018-11-25 11:48:03 +01:00
uint32_t state_load(uint8_t *state_buffer, uint32_t n_buffer);
void state_save(const uint8_t *state_buffer, uint32_t length);
uint32_t config_load(uint8_t *config_buffer, uint32_t n_buffer);
2018-11-25 16:05:30 +01:00
void user_delay_ms(uint32_t period);
int64_t get_timestamp_us();
2018-11-25 11:48:03 +01:00
2018-11-22 23:37:53 +01:00
#endif