periph_conf.h
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 
9 #include <stdint.h>
10 
11 #include "RP2350.h"
12 #include "periph_cpu.h"
13 
14 #ifdef __cplusplus
15 extern "C" {
16 #endif
17 
22 typedef struct {
23  UART0_Type *dev;
24  gpio_t rx_pin;
25  gpio_t tx_pin;
26  IRQn_Type irqn;
27 } uart_conf_t;
28 
29 static const uart_conf_t uart_config[] = {
30  {
31  .dev = UART0,
32  .rx_pin = GPIO_PIN(0, 1),
33  .tx_pin = GPIO_PIN(0, 0),
34  .irqn = UART0_IRQ_IRQn
35  },
36  {
37  .dev = UART1,
38  .rx_pin = GPIO_PIN(0, 9),
39  .tx_pin = GPIO_PIN(0, 8),
40  .irqn = UART1_IRQ_IRQn
41  }
42 };
43 
44 #define UART_0_ISR (isr_uart0)
45 #define UART_1_ISR (isr_uart1)
46 
47 #define UART_NUMOF ARRAY_SIZE(uart_config)
48 
49 #ifdef __cplusplus
50 }
51 #endif
#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