|
F439_CPP_MPL3115A2_Project_01 1.0
STM32F439 MPL3115A2 pressure and temperature tutorial
|
: MPL3115A2 pressure and temperature tutorial application More...
Go to the source code of this file.
Functions | |
| void | SystemClock_Config (void) |
| System Clock Configuration. | |
| static void | MX_GPIO_Init (void) |
| GPIO Initialization Function. | |
| static void | MX_I2C1_Init (void) |
| I2C1 Initialization Function. | |
| static void | MX_USART1_UART_Init (void) |
| USART1 Initialization Function. | |
| void | reset_I2C (void) |
| Enable printf redirection through USART1 when REDIRECT_PRINTF is defined. | |
| int | main (void) |
| The application entry point. | |
| void | Error_Handler (void) |
| This function is executed in case of error occurrence. | |
Variables | |
| I2C_HandleTypeDef | hi2c1 |
| UART_HandleTypeDef | huart1 |
: MPL3115A2 pressure and temperature tutorial application
Copyright (c) 2026 STMicroelectronics. All rights reserved.
This software is licensed under terms that can be found in the LICENSE file in the root directory of this software component. If no LICENSE file comes with this software, it is provided AS-IS.
Definition in file main.c.
| void Error_Handler | ( | void | ) |
This function is executed in case of error occurrence.
| None |
Definition at line 416 of file main.c.
Referenced by main(), MPL3115A2_Init(), MX_I2C1_Init(), MX_USART1_UART_Init(), and SystemClock_Config().
| int main | ( | void | ) |
The application entry point.
| int |
Definition at line 125 of file main.c.
References Error_Handler(), MPL3115A2_GetStatus(), MPL3115A2_Init(), MPL3115A2_ReadPressure(), MPL3115A2_ReadTemperature(), MX_GPIO_Init(), MX_I2C1_Init(), MX_USART1_UART_Init(), and SystemClock_Config().
|
static |
|
static |
I2C1 Initialization Function.
| None |
| None |
Configure Analogue filter
Configure Digital filter
Definition at line 310 of file main.c.
References Error_Handler().
Referenced by main(), and reset_I2C().
|
static |
USART1 Initialization Function.
| None |
| None |
Definition at line 358 of file main.c.
References Error_Handler().
Referenced by main().
| void reset_I2C | ( | void | ) |
Enable printf redirection through USART1 when REDIRECT_PRINTF is defined.
Recover and reinitialize the I2C1 bus.
Recover the I2C1 bus by manually clocking SCL before reinitialization.
This helper is used when the MPL3115A2 does not immediately respond during startup. PB8 is temporarily configured as an open-drain GPIO and toggled to help release a stuck slave before I2C1 is initialized again.
Definition at line 97 of file main.c.
References MX_I2C1_Init().
Referenced by MPL3115A2_Init().
| void SystemClock_Config | ( | void | ) |
System Clock Configuration.
| None |
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
Definition at line 256 of file main.c.
References Error_Handler().
Referenced by main().