UART driver for the STM32H7 USART and UART.
More...
|
| #define | PBL_UART_STM32_DEFINE(sym, _name, _base, _irq, _clk, _baudrate, _pinctrl) |
| | Define a serial port on an STM32 USART or UART.
|
| |
UART driver for the STM32H7 USART and UART.
Bytes are sent polled and received from the receive interrupt, with the FIFOs off. The baud rate comes from the kernel clock of the port. An instance connects its interrupt itself, with priority CONFIG_UART_STM32_IRQ_PRIO:
&s_usart1_default);
#define STM32H7_RCC
Clock controller.
Definition stm32h7.h:33
#define STM32H7_CLK_USART1_CK
USART1 kernel clock.
Definition stm32h7.h:96
#define PBL_CLK(_ctrl, _id)
Initializer for a struct pbl_clk.
Definition clk.h:132
#define PBL_UART_STM32_DEFINE(sym, _name, _base, _irq, _clk, _baudrate, _pinctrl)
Define a serial port on an STM32 USART or UART.
Definition stm32.h:67
◆ pbl_uart_stm32
| Data Fields |
|
uintptr_t |
base |
Registers. |
|
struct pbl_clk |
clk |
Kernel clock. |
|
pbl_irq_t |
irq |
Interrupt line. |
|
struct pbl_pinctrl |
pinctrl |
Pins. |
|
struct pbl_uart_stm32_state * |
state |
Driver runtime state. |
|
struct pbl_uart |
uart |
Serial port. |
◆ PBL_UART_STM32_DEFINE
| #define PBL_UART_STM32_DEFINE |
( |
|
sym, |
|
|
|
_name, |
|
|
|
_base, |
|
|
|
_irq, |
|
|
|
_clk, |
|
|
|
_baudrate, |
|
|
|
_pinctrl |
|
) |
| |
Value:
static struct pbl_uart_stm32_state sym##_stm32_state; \
.uart =
PBL_UART_INIT(sym, _name,
nullptr, &pbl_uart_stm32_ops, _baudrate), \
.state = &sym##_stm32_state, \
.base = (_base), \
.irq = (_irq), \
.clk = _clk, \
}; \
#define PBL_PINCTRL(_default, _sleep, _reg)
Initializer for a struct pbl_pinctrl.
Definition pinctrl.h:132
STM32 serial port.
Definition stm32.h:37
void pbl_uart_stm32_irq_handler(const struct pbl_uart_stm32 *uart)
USART interrupt handler, connected by PBL_UART_STM32_DEFINE().
A serial port.
Definition uart.h:135
#define PBL_UART_STATE_DEFINE(sym)
Define the class state of port sym, for the PBL_UART_*_DEFINE() macro of a driver.
Definition uart.h:151
#define PBL_UART_INIT(sym, _name, _parent, _ops, _baudrate)
Initializer for the struct pbl_uart of port sym.
Definition uart.h:164
Define a serial port on an STM32 USART or UART.
- Parameters
-
| sym | Symbol of the port. |
| _name | Name. |
| _base | Registers. |
| _irq | Interrupt line. |
| _clk | Kernel clock, from PBL_CLK(). |
| _baudrate | Initial baud rate, in bits per second. |
| _pinctrl | Default pin control state. |
◆ pbl_uart_stm32_irq_handler()