/* * bme680.h * * Created on: Feb 11, 2020 * Author: KamilB */ #include "main.h" #include #include #ifndef INC_BME680_H_ #define INC_BME680_H_ //registers uint16_t par_g[3]; uint8_t res_heat_range; int8_t res_heat_val; double const_array1[]={1, 1, 1, 1, 1, 0.99, 1, 0.992, 1, 1, 0.998, 0.995, 1, 0.99, 1,1}; double const_array2[] = {8000000, 4000000, 2000000, 1000000, 499500.4995, 248262.1648, 125000, 63004.03226, 31281.28128, 15625, 7812.5, 3906.25, 1953.125, 976.5625, 488.28125, 244.140625}; extern SPI_HandleTypeDef hspi2; #define SPI_HANDLE &hspi2; #define NSS_PIN GPIO_PIN_8 #define NSS_PORT GPIOC #define RESET_REG 0x60 #define ID_REG 0x50 #define CONFIG_REG 0x75 #define CTRL_MEAS_REG 0x74 #define CTRL_HUM_REG 0x72 #define CTRL_GAS1_REG 0x71 #define CTRL_GAS0_REG 0x70 #define GAS_WAIT0_REG 0x64 //to 0x6D #define RES_HEAT0_REG 0x5A // to 0x63 #define IDAC_HEAT0_REG 0x50 // to ox59 #define GAS_R_LSB_REG 0x2B #define GAS_R_MSB_REG 0x2A //modes #define SOFT_RESET_MODE 0xB6 void BME680_write8(uint8_t reg, uint8_t val); uint8_t BME680_read8(uint8_t reg); bool BME680_begin(); uint8_t BME680_sample(); uint8_t BME680_readgas(); #endif /* INC_BME680_H_ */