F439_CPP_SPI_RA8875_TFT_LCD_04 1.0
STM32F439 SPI RA8875 7-inch TFT display with FRAM-backed touch calibration, built on the STM32_GFX, STM32_RA8875 and STM32_MB85RS64V libraries
Loading...
Searching...
No Matches
main.c File Reference

: Main program body More...

#include "main.h"
#include <stdio.h>
#include "string.h"
#include "stdbool.h"
#include "entryPointCPP.hpp"

Go to the source code of this file.

Functions

void HAL_UART_RxCpltCallback (UART_HandleTypeDef *huart)
 UART receive-complete callback, called by the HAL from the USART interrupt.
 
void HAL_UART_ErrorCallback (UART_HandleTypeDef *huart)
 UART error callback (overrun, noise, framing or parity error).
 
int main (void)
 The application entry point.
 

Variables

volatile uint8_t uartRxChar = 0
 The one character the interrupt receive is currently waiting for.
 
volatile uint8_t uartKeyPressed = 0
 Set by HAL_UART_RxCpltCallback(): 0 = no key yet, otherwise ' ' (space) or 0x1B (Esc).
 

Detailed Description

: Main program body

Attention

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.

Function Documentation

◆ HAL_UART_ErrorCallback()

void HAL_UART_ErrorCallback ( UART_HandleTypeDef * huart)

UART error callback (overrun, noise, framing or parity error).

Parameters
huartThe UART that reported the error.

The HAL has already cleared the error; a new one-character receive is started so a stray error on the line does not stop the space bar or Esc from working.

Definition at line 119 of file main.c.

References uartRxChar.

◆ HAL_UART_RxCpltCallback()

void HAL_UART_RxCpltCallback ( UART_HandleTypeDef * huart)

UART receive-complete callback, called by the HAL from the USART interrupt.

Parameters
huartThe UART that received a character.

A space or an Esc is stored in uartKeyPressed. Any other character is ignored and the next one-character receive is started. If that cannot be started the calibration could never be advanced, so Error_Handler() is called.

Definition at line 99 of file main.c.

References uartKeyPressed, and uartRxChar.

◆ main()

int main ( void )

The application entry point.

Return values
int

Definition at line 134 of file main.c.

References initFRAM(), initTest(), initTouchCalibration(), testFRAM(), testLCD(), and testTouch().

Variable Documentation

◆ uartKeyPressed

volatile uint8_t uartKeyPressed = 0

Set by HAL_UART_RxCpltCallback(): 0 = no key yet, otherwise ' ' (space) or 0x1B (Esc).

Set by HAL_UART_RxCpltCallback() in main.c: 0 = none yet, otherwise ' ' or 0x1B (Esc).

Definition at line 89 of file main.c.

Referenced by HAL_UART_RxCpltCallback().

◆ uartRxChar

volatile uint8_t uartRxChar = 0

The one character the interrupt receive is currently waiting for.

The one character the interrupt receive waits for (see main.c).

Definition at line 87 of file main.c.

Referenced by HAL_UART_ErrorCallback(), and HAL_UART_RxCpltCallback().