Loading...
Searching...
No Matches
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
18
19#include <stdint.h>
20
21#include "RP2350.h"
22#include "periph_cpu.h"
23
24#ifdef __cplusplus
25extern "C" {
26#endif
27
31typedef struct {
32 UART0_Type *dev;
33 gpio_t rx_pin;
34 gpio_t tx_pin;
35 IRQn_Type irqn;
37
38static 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
64static const timer_conf_t timer_config[] = {
65 {
66 .dev = TIMER0,
67 .irqn_base = TIMER0_IRQ_0_IRQn,
68 .ch_numof = TIMER_CHANNEL_NUMOF,
69 },
70 {
71 .dev = TIMER1,
72 .irqn_base = TIMER1_IRQ_0_IRQn,
73 .ch_numof = TIMER_CHANNEL_NUMOF,
74 }
75};
76
77#define TIMER_NUMOF ARRAY_SIZE(timer_config)
78
79#ifdef __cplusplus
80}
81#endif
82
#define TIMER_CHANNEL_NUMOF
Number of channels.
Definition periph_cpu.h:36
#define GPIO_PIN(x, y)
Define a CPU specific GPIO pin generator macro.
Definition periph_cpu.h:42
enum IRQn IRQn_Type
Interrupt Number Definition.
#define UART0
UART0 register bank.
#define UART1
UART1 register bank.
Timer device configuration.
Definition periph_cpu.h:260
UART device configuration.
Definition periph_cpu.h:214