periph_conf.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2014 Freie Universität Berlin
3  *
4  * This file is subject to the terms and conditions of the GNU Lesser General
5  * Public License v2.1. See the file LICENSE in the top level directory for more
6  * details.
7  */
8 
9 #pragma once
10 
21 #include "periph_cpu.h"
22 #include "vendor/conf.h"
23 
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
27 
32 #define TIMER_NUMOF (1U)
33 #define TIMER_IRQ_PRIO 1
34 
35 /* Timer 0 configuration */
36 #define TIMER_0_DEV LPC_TIM0
37 #define TIMER_0_CHANNELS 4
38 #define TIMER_0_FREQ (96000000ul)
39 #define TIMER_0_MAX_VALUE (0xffffffff)
40 #define TIMER_0_CLKEN() (LPC_SC->PCONP |= (1 << 1))
41 #define TIMER_0_CLKDIS() (LPC_SC->PCONP &= ~(1 << 1))
42 #define TIMER_0_PLKSEL() (LPC_SC->PCLKSEL0 |= (1 << 2))
43 #define TIMER_0_ISR isr_timer0
44 #define TIMER_0_IRQ TIMER0_IRQn
51 static const uart_conf_t uart_config[] = {
52  {
53  .dev = (LPC_UART_TypeDef*)LPC_UART0,
54  .irq_rx = UART0_IRQn,
55  .clk_offset = 3,
56  .pinsel = 0,
57  .pinsel_shift = 2,
58  .pinsel_af = 1,
59  },
60  {
61  .dev = (LPC_UART_TypeDef*)LPC_UART2,
62  .irq_rx = UART2_IRQn,
63  .clk_offset = 24,
64  .pinsel = 0,
65  .pinsel_shift = 10,
66  .pinsel_af = 1,
67  }
68 };
69 
70 #define UART_IRQ_PRIO 1
71 
72 #define UART_0_ISR isr_uart0
73 #define UART_1_ISR isr_uart2
74 
75 #define UART_NUMOF ARRAY_SIZE(uart_config)
78 #ifdef __cplusplus
79 }
80 #endif
81 
static const uart_conf_t uart_config[]
UART configuration.
Definition: periph_conf.h:38
@ UART0_IRQn
UART0
Definition: cc2538.h:52
UART device configuration.
Definition: periph_cpu.h:217
USART_t * dev
pointer to the used UART device
Definition: periph_cpu.h:218