periph_conf.h
Go to the documentation of this file.
1 #pragma once
2 
3  /*
4  * Copyright (C) 2025 Mesotic SAS
5  *
6  * This file is subject to the terms and conditions of the GNU Lesser
7  * General Public License v2.1. See the file LICENSE in the top level
8  * directory for more details.
9  */
10 
21 #include "periph_cpu.h"
22 
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26 
31 /* targeted system core clock */
32 #define CLOCK_CORECLOCK MHZ(120)
33 /* external oscillator clock */
34 #define CLOCK_EXT_OSC MHZ(12)
35 /* define PLL configuration
36  *
37  * The values must fulfill this equation:
38  * CORECLOCK = (EXT_OCS / PLL_DIV) * (PLL_MUL + 1)
39  */
40 #define CLOCK_PLL_MUL (9)
41 #define CLOCK_PLL_DIV (1)
42 
43 /* number of wait states before flash read and write operations */
44 #define CLOCK_FWS (5) /* 5 is safe for 120 MHz */
50 #define CLOCK_SCLK_XTAL (1)
51 
56 static const timer_conf_t timer_config[] = {
57  { .dev = TC0, .id_ch0 = ID_TC0 },
58  { .dev = TC1, .id_ch0 = ID_TC3 }
59 };
60 
61 #define TIMER_0_ISR isr_tc0
62 #define TIMER_1_ISR isr_tc3
63 
64 #define TIMER_NUMOF ARRAY_SIZE(timer_config)
71 static const uart_conf_t uart_config[] = {
72  {
73  .dev = (Uart *)UART1,
74  .rx_pin = GPIO_PIN(PB, 2),
75  .tx_pin = GPIO_PIN(PB, 3),
76  .mux = GPIO_MUX_A,
77  .pmc_id = ID_UART1,
78  .irqn = UART1_IRQn
79  }
80 };
81 
82 /* define interrupt vectors */
83 #define UART_0_ISR isr_uart1
84 
85 #define UART_NUMOF ARRAY_SIZE(uart_config)
88 #ifdef __cplusplus
89 }
90 #endif
91 
#define GPIO_PIN(x, y)
Define a CPU specific GPIO pin generator macro.
Definition: periph_cpu.h:45
static const uart_conf_t uart_config[]
UART configuration.
Definition: periph_conf.h:38
static const timer_conf_t timer_config[]
All timers on board.
Definition: periph_conf.h:39
@ 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
TC0_t * dev
Pointer to the used as Timer device.
Definition: periph_cpu.h:264
UART device configuration.
Definition: periph_cpu.h:217
USART_t * dev
pointer to the used UART device
Definition: periph_cpu.h:218