Sound Byte Libs 0.5.1-340-gab5b79a
C++ firmware library for audio applications on 32-bit ARM Cortex-M processors
Loading...
Searching...
No Matches
handle.hpp
Go to the documentation of this file.
1/**
2 * @file handle.hpp
3 * @brief UART handle type for hardware abstraction
4 * @ingroup hal
5 *
6 * Canonical definition of UartHandle - the primary way to reference
7 * UART peripherals in SBL. Used by drivers, generated hardware configs,
8 * and user code.
9 */
10
11#ifndef SBL_HW_HAL_UART_HANDLE_HPP_
12#define SBL_HW_HAL_UART_HANDLE_HPP_
13
14#include <cstdint>
15
16namespace sbl {
17
18/**
19 * @brief UART peripheral handle
20 *
21 * Represents a UART configuration as resolved from hardware manifests.
22 * Includes peripheral number, pin mappings, and default baud rate.
23 *
24 * Examples:
25 * - STM32H7 USART1 on PA9/PA10: UartHandle{1, 0, 9, 7, 0, 10, 7, 115200}
26 */
27struct UartHandle {
28 uint32_t peripheral; /**< UART peripheral number (e.g., 1 for USART1) */
29 uint32_t tx_port; /**< TX GPIO port number */
30 uint32_t tx_pin; /**< TX GPIO pin number */
31 uint32_t tx_af; /**< TX alternate function (STM32), 0 for simpler MCUs */
32 uint32_t rx_port; /**< RX GPIO port number */
33 uint32_t rx_pin; /**< RX GPIO pin number */
34 uint32_t rx_af; /**< RX alternate function (STM32), 0 for simpler MCUs */
35 uint32_t baud; /**< Default baud rate */
36};
37
38} // namespace sbl
39
40#endif // SBL_HW_HAL_UART_HANDLE_HPP_
Root namespace for all Sound Byte Libs code.
UART peripheral handle.
Definition handle.hpp:27
uint32_t tx_af
Definition handle.hpp:31
uint32_t tx_pin
Definition handle.hpp:30
uint32_t rx_af
Definition handle.hpp:34
uint32_t rx_pin
Definition handle.hpp:33
uint32_t tx_port
Definition handle.hpp:29
uint32_t baud
Definition handle.hpp:35
uint32_t rx_port
Definition handle.hpp:32
uint32_t peripheral
Definition handle.hpp:28