boards/mbed_lpc1768/include/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 
19 #ifndef PERIPH_CONF_H
20 #define PERIPH_CONF_H
21 
22 #ifdef __cplusplus
23 extern "C" {
24 #endif
25 
30 #define TIMER_NUMOF (1U)
31 #define TIMER_0_EN 1
32 #define TIMER_IRQ_PRIO 1
33 
34 /* Timer 0 configuration */
35 #define TIMER_0_DEV LPC_TIM0
36 #define TIMER_0_CHANNELS 4
37 #define TIMER_0_FREQ (96000000ul)
38 #define TIMER_0_MAX_VALUE (0xffffffff)
39 #define TIMER_0_CLKEN() (LPC_SC->PCONP |= (1 << 1))
40 #define TIMER_0_CLKDIS() (LPC_SC->PCONP &= ~(1 << 1))
41 #define TIMER_0_PLKSEL() (LPC_SC->PCLKSEL0 |= (1 << 2))
42 #define TIMER_0_ISR isr_timer0
43 #define TIMER_0_IRQ TIMER0_IRQn
44 
50 #define UART_NUMOF (2U)
51 #define UART_0_EN 1
52 #define UART_1_EN 1
53 #define UART_IRQ_PRIO 1
54 
55 /* UART 0 device configuration */
56 #define UART_0_DEV LPC_UART0
57 #define UART_0_CLKSEL() (LPC_SC->PCLKSEL0 &= ~(0x3 << 6)) /* PCLK := CCLK / 4 */
58 #define UART_0_CLKEN() (LPC_SC->PCONP |= (1 << 3))
59 #define UART_0_CLKDIS() (LPC_SC->PCONP &= ~(1 << 3))
60 #define UART_0_IRQ UART0_IRQn
61 #define UART_0_ISR isr_uart0
62 /* UART 0 pin configuration */
63 #define UART_0_TX_PINSEL (LPC_PINCON->PINSEL0)
64 #define UART_0_RX_PINSEL (LPC_PINCON->PINSEL0)
65 #define UART_0_TX_PINMODE (LPC_PINCON->PINMODE0)
66 #define UART_0_RX_PINMODE (LPC_PINCON->PINMODE0)
67 #define UART_0_TX_PIN (3)
68 #define UART_0_RX_PIN (2)
69 #define UART_0_AF (1)
70 
71 /* UART 1 device configuration */
72 #define UART_1_DEV LPC_UART3
73 #define UART_1_CLKSEL() (LPC_SC->PCLKSEL1 &= ~(0x3 << 18)) /* PCLK := CCLK / 4 */
74 #define UART_1_CLKEN() (LPC_SC->PCONP |= (1 << 25))
75 #define UART_1_CLKDIS() (LPC_SC->PCONP &= ~(1 << 25))
76 #define UART_1_IRQ UART3_IRQn
77 #define UART_1_ISR isr_uart3
78 /* UART 1 pin configuration */
79 #define UART_1_TX_PINSEL (LPC_PINCON->PINSEL0)
80 #define UART_1_RX_PINSEL (LPC_PINCON->PINSEL0)
81 #define UART_1_TX_PINMODE (LPC_PINCON->PINMODE0)
82 #define UART_1_RX_PINMODE (LPC_PINCON->PINMODE0)
83 #define UART_1_RX_PIN (0)
84 #define UART_1_TX_PIN (1)
85 #define UART_1_AF (2)
86 
88 #ifdef __cplusplus
89 }
90 #endif
91 
92 #endif /* PERIPH_CONF_H */
93