L14-Click 1.0
STM32WLE5CC LoRaWAN Sensor Platform
Loading...
Searching...
No Matches
usart_if.h File Reference

Header for USART interface configuration. More...

#include "stm32_adv_trace.h"
#include "usart.h"
#include "dma.h"
Include dependency graph for usart_if.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define __USART_IF_H__

Functions

UTIL_ADV_TRACE_Status_t vcom_Init (void(*cb)(void *))
 Init the UART and associated DMA.
UTIL_ADV_TRACE_Status_t vcom_ReceiveInit (void(*RxCb)(uint8_t *rxChar, uint16_t size, uint8_t error))
 init receiver of vcom
UTIL_ADV_TRACE_Status_t vcom_DeInit (void)
 DeInit the UART and associated DMA.
void vcom_Trace (uint8_t *p_data, uint16_t size)
 send buffer p_data of size size to vcom in polling mode
UTIL_ADV_TRACE_Status_t vcom_Trace_DMA (uint8_t *p_data, uint16_t size)
 send buffer p_data of size size to vcom using DMA
void vcom_IRQHandler (void)
 last byte has been sent on the uart line
void vcom_DMA_TX_IRQHandler (void)
 last byte has been sent from memory to uart data register
void vcom_Resume (void)
 Resume the UART and associated DMA (used by LPM).
UTIL_ADV_TRACE_Status_t Uart_Info (const char *strInfo)
 Write to UART1.
UTIL_ADV_TRACE_Status_t Uart_StartReceving (UART_HandleTypeDef *uart)
 start reading
UTIL_ADV_TRACE_Status_t Uart_NextReceving ()
 continue with next reading if data arrived
int HAL_UART_RxCharMT (UART_HandleTypeDef *huart, uint8_t charRx)
 called if char is ready from UART

Variables

volatile uint8_t uart_data_ready
char uart_req_buf []

Detailed Description

Header for USART interface configuration.

Author
MCD Application Team
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 usart_if.h.

Macro Definition Documentation

◆ __USART_IF_H__

#define __USART_IF_H__

Definition at line 27 of file usart_if.h.

Function Documentation

◆ HAL_UART_RxCharMT()

int HAL_UART_RxCharMT ( UART_HandleTypeDef * huart,
uint8_t charRx )

called if char is ready from UART

Return values
-1- other UART, 0 - char is accepted, next receiving must start, 1 - data ready

Definition at line 279 of file usart_if.c.

References _curUart, CFG_SEQ_Prio_0, CFG_SEQ_Task_Uart_RX, charRx, uart_req_buf, and uart_req_w_ptr.

Referenced by HAL_UART_RxCpltCallback().

Here is the caller graph for this function:

◆ Uart_Info()

UTIL_ADV_TRACE_Status_t Uart_Info ( const char * strInfo)

Write to UART1.

Definition at line 299 of file usart_if.c.

References vcom_Trace().

Referenced by writeLogNL().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Uart_NextReceving()

UTIL_ADV_TRACE_Status_t Uart_NextReceving ( )

continue with next reading if data arrived

Definition at line 306 of file usart_if.c.

References uart_req_buf, and uart_req_w_ptr.

Referenced by Uart_RxProcessing(), and Uart_StartReceving().

Here is the caller graph for this function:

◆ Uart_StartReceving()

UTIL_ADV_TRACE_Status_t Uart_StartReceving ( UART_HandleTypeDef * uart)

start reading

Parameters
uart- handle for the uart being used

Definition at line 313 of file usart_if.c.

References _curUart, Uart_NextReceving(), and vcom_ReceiveInit().

Referenced by uart_Start().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ vcom_DeInit()

UTIL_ADV_TRACE_Status_t vcom_DeInit ( void )

DeInit the UART and associated DMA.

Returns
UTIL_ADV_TRACE_Status_t

Definition at line 120 of file usart_if.c.

References HAL_UART_MspDeInit(), and huart1.

Here is the call graph for this function:

◆ vcom_DMA_TX_IRQHandler()

void vcom_DMA_TX_IRQHandler ( void )

last byte has been sent from memory to uart data register

References charRx.

◆ vcom_Init()

UTIL_ADV_TRACE_Status_t vcom_Init ( void(* cb )(void *))

Init the UART and associated DMA.

Parameters
cbTxCpltCallback
Returns
UTIL_ADV_TRACE_Status_t

Definition at line 105 of file usart_if.c.

References MX_DMA_Init(), MX_USART1_UART_Init(), and TxCpltCallback.

Here is the call graph for this function:

◆ vcom_IRQHandler()

void vcom_IRQHandler ( void )

last byte has been sent on the uart line

◆ vcom_ReceiveInit()

UTIL_ADV_TRACE_Status_t vcom_ReceiveInit ( void(* RxCb )(uint8_t *rxChar, uint16_t size, uint8_t error))

init receiver of vcom

Parameters
RxCbcallback when Rx char is received
Returns
UTIL_ADV_TRACE_Status_t

Definition at line 177 of file usart_if.c.

References charRx, huart1, and RxCpltCallback.

Referenced by Uart_StartReceving().

Here is the caller graph for this function:

◆ vcom_Resume()

void vcom_Resume ( void )

Resume the UART and associated DMA (used by LPM).

Definition at line 217 of file usart_if.c.

References Error_Handler(), hdma_usart1_tx, and huart1.

Referenced by PWR_ExitStopMode().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ vcom_Trace()

void vcom_Trace ( uint8_t * p_data,
uint16_t size )

send buffer p_data of size size to vcom in polling mode

Parameters
p_datadata to be sent
sizeof buffer p_data to be sent

Definition at line 145 of file usart_if.c.

References huart1.

Referenced by Uart_Info().

Here is the caller graph for this function:

◆ vcom_Trace_DMA()

UTIL_ADV_TRACE_Status_t vcom_Trace_DMA ( uint8_t * p_data,
uint16_t size )

send buffer p_data of size size to vcom using DMA

Parameters
p_datadata to be sent
sizeof buffer p_data to be sent
Returns
UTIL_ADV_TRACE_Status_t

Definition at line 158 of file usart_if.c.

References HAL_UART_TxCpltCallback(), and huart1.

Here is the call graph for this function:

Variable Documentation

◆ uart_data_ready

volatile uint8_t uart_data_ready
extern

◆ uart_req_buf

char uart_req_buf[]
extern

Definition at line 46 of file usart_if.c.

Referenced by HAL_UART_RxCharMT(), and Uart_NextReceving().