periph_conf.h
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: 2014 Freie Universität Berlin
3  * SPDX-License-Identifier: LGPL-2.1-only
4  */
5 
6 #pragma once
7 
18 #include "periph_cpu.h"
19 #include "vendor/conf.h"
20 
21 #ifdef __cplusplus
22 extern "C" {
23 #endif
24 
29 #define TIMER_NUMOF (1U)
30 #define TIMER_IRQ_PRIO 1
31 
32 /* Timer 0 configuration */
33 #define TIMER_0_DEV LPC_TIM0
34 #define TIMER_0_CHANNELS 4
35 #define TIMER_0_FREQ (96000000ul)
36 #define TIMER_0_MAX_VALUE (0xffffffff)
37 #define TIMER_0_CLKEN() (LPC_SC->PCONP |= (1 << 1))
38 #define TIMER_0_CLKDIS() (LPC_SC->PCONP &= ~(1 << 1))
39 #define TIMER_0_PLKSEL() (LPC_SC->PCLKSEL0 |= (1 << 2))
40 #define TIMER_0_ISR isr_timer0
41 #define TIMER_0_IRQ TIMER0_IRQn
48 static const uart_conf_t uart_config[] = {
49  {
50  .dev = (LPC_UART_TypeDef*)LPC_UART0,
51  .irq_rx = UART0_IRQn,
52  .clk_offset = 3,
53  .pinsel = 0,
54  .pinsel_shift = 2,
55  .pinsel_af = 1,
56  },
57  {
58  .dev = (LPC_UART_TypeDef*)LPC_UART2,
59  .irq_rx = UART2_IRQn,
60  .clk_offset = 24,
61  .pinsel = 0,
62  .pinsel_shift = 10,
63  .pinsel_af = 1,
64  }
65 };
66 
67 #define UART_IRQ_PRIO 1
68 
69 #define UART_0_ISR isr_uart0
70 #define UART_1_ISR isr_uart2
71 
72 #define UART_NUMOF ARRAY_SIZE(uart_config)
75 #ifdef __cplusplus
76 }
77 #endif
78 
static const uart_conf_t uart_config[]
UART configuration.
Definition: periph_conf.h:35
@ UART0_IRQn
UART0
Definition: cc2538.h:49
UART device configuration.
Definition: periph_cpu.h:214
USART_t * dev
pointer to the used UART device
Definition: periph_cpu.h:215