BME280 Driver 2.0.x
Driver for BME280 sensor
|
Data Fields | |
SPI_HandleTypeDef * | spi_handle |
GPIO_TypeDef * | NCS_gpio |
uint16_t | NCS_pin |
SemaphoreHandle_t | spi_mutex |
File Name : freertos.c Description : Code for freertos applications
This is an example of use BME280_driver with STM32 platform and HAL library placed in Freertos enviroment. Functions of this driver are not reentrant so user is obligated to use mutexes to protect sensor's structure and communication peripherials. Here we use only one sensor in one task so mutex for BME280_t structure was skipped. There is one sensor connected to SPI1 in 4-wire mode, chip select pin is defined as BME280_NCS and driven by software. Results are stored as integers inside bme1_data structure. Sensor if initialized, then configured. Inside BME280_Task single measure is forced every 500ms.