ME 507 Romi++
Cylindrical Differential Drive Robot created for ME 507 at Cal Poly in Spring 2025
Loading...
Searching...
No Matches
uart_dma_idle.h
Go to the documentation of this file.
1/*
2 * uart_dma_idle.h
3 *
4 * Created on: Jun 9, 2025
5 * Author: jacka
6 */
7
8#ifndef INC_UART_DMA_IDLE_H_
9#define INC_UART_DMA_IDLE_H_
10
17
18#ifdef __cplusplus
19extern "C" {
20#endif
21
22#include "stm32f4xx_hal.h"
23
25#define BUFFER_SIZE 64
26
28extern uint8_t rx_buffer[BUFFER_SIZE];
29
31extern uint8_t buffer_index;
32
34extern volatile uint8_t command_ready;
35
40void UART_DMA_IDLE_Init(UART_HandleTypeDef *huart);
41
47void UART_DMA_IDLE_IRQHandler(UART_HandleTypeDef *huart);
48
49#ifdef __cplusplus
50}
51#endif
52
53#endif /* INC_UART_DMA_IDLE_H_ */
uint8_t buffer_index
Current write index into rx_buffer.
Definition main.cpp:106
#define BUFFER_SIZE
Maximum buffer size for incoming UART command stream.
Definition command_parser.h:27
volatile uint8_t command_ready
Flag indicating a complete command is available.
Definition main.cpp:107
uint8_t rx_buffer[BUFFER_SIZE]
DMA-compatible receive buffer for UART.
Definition main.cpp:105
void UART_DMA_IDLE_Init(UART_HandleTypeDef *huart)
Initializes UART DMA reception with idle line detection.
Definition uart_dma_idle.c:21
void UART_DMA_IDLE_IRQHandler(UART_HandleTypeDef *huart)
UART interrupt handler for idle line detection.
Definition uart_dma_idle.c:34