Loading...
Searching...
No Matches
periph_conf.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2025 Mesotic SAS
3 * SPDX-License-Identifier: LGPL-2.1-only
4 */
5
6#pragma once
7
17
18#include "periph_cpu.h"
19
20#ifdef __cplusplus
21extern "C" {
22#endif
23
28/* targeted system core clock */
29#define CLOCK_CORECLOCK MHZ(120)
30/* external oscillator clock */
31#define CLOCK_EXT_OSC MHZ(12)
32/* define PLL configuration
33 *
34 * The values must fulfill this equation:
35 * CORECLOCK = (EXT_OCS / PLL_DIV) * (PLL_MUL + 1)
36 */
37#define CLOCK_PLL_MUL (9)
38#define CLOCK_PLL_DIV (1)
39
40/* number of wait states before flash read and write operations */
41#define CLOCK_FWS (5) /* 5 is safe for 120 MHz */
43
47#define CLOCK_SCLK_XTAL (1)
48
53static const timer_conf_t timer_config[] = {
54 { .dev = TC0, .id_ch0 = ID_TC0 },
55 { .dev = TC1, .id_ch0 = ID_TC3 }
56};
57
58#define TIMER_0_ISR isr_tc0
59#define TIMER_1_ISR isr_tc3
60
61#define TIMER_NUMOF ARRAY_SIZE(timer_config)
63
68static const uart_conf_t uart_config[] = {
69 {
70 .dev = (Uart *)UART1,
71 .rx_pin = GPIO_PIN(PB, 2),
72 .tx_pin = GPIO_PIN(PB, 3),
73 .mux = GPIO_MUX_A,
74 .pmc_id = ID_UART1,
75 .irqn = UART1_IRQn
76 }
77};
78
79/* define interrupt vectors */
80#define UART_0_ISR isr_uart1
81
82#define UART_NUMOF ARRAY_SIZE(uart_config)
84
85#ifdef __cplusplus
86}
87#endif
88
#define GPIO_PIN(x, y)
Define a CPU specific GPIO pin generator macro.
Definition periph_cpu.h:45
@ UART1_IRQn
UART1.
Definition cc2538.h:53
#define UART1
UART1 register bank.
@ PB
port B
@ GPIO_MUX_A
select peripheral function A
Timer device configuration.
Definition periph_cpu.h:263
UART device configuration.
Definition periph_cpu.h:217