BME280 Driver 2.0.x
Driver for BME280 sensor
Loading...
Searching...
No Matches
main.c File Reference

: Main program body More...

#include "main.h"
#include "spi.h"
#include "gpio.h"
#include "bme280.h"
Include dependency graph for main.c:

Data Structures

struct  spi_bus_data
 

Functions

void SystemClock_Config (void)
 System Clock Configuration.
 
int8_t bme280_read_platform_spec (uint8_t reg_addr, uint8_t *rxbuff, uint8_t rxlen, void *driver)
 
int8_t bme280_write_platform_spec (uint8_t reg_addr, uint8_t value, void *driver)
 
void bme280_delay_platform_spec (uint8_t delay_time)
 
int main (void)
 The application entry point.
 
void Error_Handler (void)
 This function is executed in case of error occurrence.
 

Variables

BME280_t bme1
 
struct spi_bus_data bme1_spi
 
BME280_Driver_t bme1_driver
 
BME280_Config_t bme1_config
 
BME280_Data_t bme1_data
 

Detailed Description

: Main program body

This is an example of use BME280_driver with STM32 platform and HAL library. 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 infite loop single measure is forced once per 500ms.

Function Documentation

◆ Error_Handler()

void Error_Handler ( void  )

This function is executed in case of error occurrence.

Return values
None

◆ main()

int main ( void  )

The application entry point.

Return values
int
Here is the call graph for this function:

◆ SystemClock_Config()

void SystemClock_Config ( void  )

System Clock Configuration.

Return values
None

Configure LSE Drive Capability

Configure the main internal regulator output voltage

Initializes the RCC Oscillators according to the specified parameters in the RCC_OscInitTypeDef structure.

Activate the Over-Drive mode

Initializes the CPU, AHB and APB buses clocks

Here is the call graph for this function: