boards/ikea-tradfri/include/periph_conf.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2017 Bas Stottelaar <basstottelaar@gmail.com>
3  *
4  * This file is subject to the terms and conditions of the GNU Lesser
5  * General Public License v2.1. See the file LICENSE in the top level
6  * directory for more details.
7  */
8 
19 #ifndef PERIPH_CONF_H
20 #define PERIPH_CONF_H
21 
22 #include "cpu.h"
23 #include "periph_cpu.h"
24 #include "em_cmu.h"
25 
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
29 
33 #define PERIPH_NUMOF(config) (sizeof(config) / sizeof(config[0]))
34 
39 #ifndef CLOCK_HF
40 #define CLOCK_HF cmuSelect_HFRCO
41 #endif
42 #ifndef CLOCK_CORE_DIV
43 #define CLOCK_CORE_DIV cmuClkDiv_1
44 #endif
45 #ifndef CLOCK_LFA
46 #define CLOCK_LFA cmuSelect_LFRCO
47 #endif
48 #ifndef CLOCK_LFB
49 #define CLOCK_LFB cmuSelect_LFRCO
50 #endif
51 #ifndef CLOCK_LFE
52 #define CLOCK_LFE cmuSelect_LFRCO
53 #endif
54 
60 #define RTC_NUMOF (1U)
61 
67 #define RTT_NUMOF (1U)
68 
69 #define RTT_MAX_VALUE (0xFFFFFFFF)
70 #define RTT_FREQUENCY (1U)
71 
77 static const spi_dev_t spi_config[] = {
78  {
79  .dev = USART1,
80  .mosi_pin = GPIO_PIN(PD, 15),
81  .miso_pin = GPIO_PIN(PD, 14),
82  .clk_pin = GPIO_PIN(PD, 13),
83  .loc = USART_ROUTELOC0_RXLOC_LOC21 |
84  USART_ROUTELOC0_TXLOC_LOC23 |
85  USART_ROUTELOC0_CLKLOC_LOC19,
86  .cmu = cmuClock_USART1,
87  .irq = USART1_RX_IRQn
88  }
89 };
90 
91 #define SPI_NUMOF PERIPH_NUMOF(spi_config)
92 
100 static const timer_conf_t timer_config[] = {
101  {
102  {
103  .dev = TIMER0,
104  .cmu = cmuClock_TIMER0
105  },
106  {
107  .dev = TIMER1,
108  .cmu = cmuClock_TIMER1
109  },
110  .irq = TIMER1_IRQn
111  }
112 };
113 
114 #define TIMER_NUMOF PERIPH_NUMOF(timer_config)
115 #define TIMER_0_ISR isr_timer1
116 
122 static const uart_conf_t uart_config[] = {
123  {
124  .dev = USART0,
125  .rx_pin = GPIO_PIN(PB, 15),
126  .tx_pin = GPIO_PIN(PB, 14),
127  .loc = USART_ROUTELOC0_RXLOC_LOC9 |
128  USART_ROUTELOC0_TXLOC_LOC9,
129  .cmu = cmuClock_USART0,
130  .irq = USART0_RX_IRQn
131  }
132 };
133 
134 #define UART_NUMOF PERIPH_NUMOF(uart_config)
135 #define UART_0_ISR_RX isr_usart0_rx
136 
138 #ifdef __cplusplus
139 }
140 #endif
141 
142 #endif /* PERIPH_CONF_H */
143 
SPI device configuration.
cc2538_uart_t * dev
pointer to the used UART device
NRF_TIMER_Type * dev
timer device
UART device configuration.
#define GPIO_PIN(x, y)
Define a CPU specific GPIO pin generator macro.
USART_TypeDef * dev
USART device used.
Timer configuration.