periph_conf.h
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: 2025 Tom Hert <git@annsann.eu>
3  * SPDX-FileCopyrightText: 2025 HAW Hamburg
4  * SPDX-License-Identifier: LGPL-2.1-only
5  */
6 
7 #pragma once
8 
19 #include <stdint.h>
20 
21 #include "RP2350.h"
22 #include "periph_cpu.h"
23 
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
27 
31 typedef struct {
32  UART0_Type *dev;
33  gpio_t rx_pin;
34  gpio_t tx_pin;
35  IRQn_Type irqn;
36 } uart_conf_t;
37 
38 static const uart_conf_t uart_config[] = {
39  {
40  .dev = UART0,
41  .rx_pin = GPIO_PIN(0, 1),
42  .tx_pin = GPIO_PIN(0, 0),
43  .irqn = UART0_IRQ_IRQn
44  },
45  {
46  .dev = UART1,
47  .rx_pin = GPIO_PIN(0, 9),
48  .tx_pin = GPIO_PIN(0, 8),
49  .irqn = UART1_IRQ_IRQn
50  }
51 };
52 
53 #define UART_0_ISR (isr_uart0)
54 #define UART_1_ISR (isr_uart1)
55 
56 #define UART_NUMOF ARRAY_SIZE(uart_config)
57 
58 #ifdef __cplusplus
59 }
60 #endif
61 
#define GPIO_PIN(x, y)
Define a CPU specific GPIO pin generator macro.
Definition: periph_cpu.h:42
static const uart_conf_t uart_config[]
UART configuration.
Definition: periph_conf.h:35
enum IRQn IRQn_Type
Interrupt Number Definition.
#define UART0
UART0 register bank.
#define UART1
UART1 register bank.
UART device configuration.
Definition: periph_cpu.h:214
USART_t * dev
pointer to the used UART device
Definition: periph_cpu.h:215