mulle/include/board.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2014 Eistec AB
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 
21 #ifndef BOARD_H
22 #define BOARD_H
23 
24 #include "cpu.h"
25 #include "periph_conf.h"
26 #include "mulle-nvram.h"
27 #include "mtd.h"
28 
29 /* Use the on board RTC 32kHz clock for LPTMR clocking. */
30 #undef LPTIMER_CLKSRC
31 
32 #define LPTIMER_CLKSRC LPTIMER_CLKSRC_ERCLK32K
33 
35 #define DISABLE_WDOG 1
36 
40 #define UART_STDIO_DEV UART_DEV(1)
41 
46 #if 0
47 /* LPTMR xtimer configuration */
48 /* WIP, Use PIT for now */
49 #define XTIMER_DEV (TIMER_LPTMR_DEV(0))
50 /* LPTMR is 16 bits wide */
51 #define XTIMER_WIDTH (16)
52 #define XTIMER_BACKOFF (4)
53 #define XTIMER_ISR_BACKOFF (4)
54 #define XTIMER_OVERHEAD (3)
55 #define XTIMER_HZ (32768ul)
56 #else
57 /* PIT xtimer configuration */
58 #define XTIMER_DEV (TIMER_PIT_DEV(0))
59 #define XTIMER_CHAN (0)
60 #define XTIMER_BACKOFF (40)
61 #define XTIMER_ISR_BACKOFF (40)
62 #define XTIMER_OVERHEAD (30)
63 #endif
64 
70 #define LED_PORT PTC
71 #define LED0_BIT (15)
72 #define LED1_BIT (14)
73 #define LED2_BIT (13)
74 
75 #define LED0_PIN GPIO_PIN(PORT_C, LED0_BIT)
76 #define LED1_PIN GPIO_PIN(PORT_C, LED1_BIT)
77 #define LED2_PIN GPIO_PIN(PORT_C, LED2_BIT)
78 
79 #define LED0_ON (LED_PORT->PSOR = (1 << LED0_BIT))
80 #define LED0_OFF (LED_PORT->PCOR = (1 << LED0_BIT))
81 #define LED0_TOGGLE (LED_PORT->PTOR = (1 << LED0_BIT))
82 
83 #define LED1_ON (LED_PORT->PSOR = (1 << LED1_BIT))
84 #define LED1_OFF (LED_PORT->PCOR = (1 << LED1_BIT))
85 #define LED1_TOGGLE (LED_PORT->PTOR = (1 << LED1_BIT))
86 
87 #define LED2_ON (LED_PORT->PSOR = (1 << LED2_BIT))
88 #define LED2_OFF (LED_PORT->PCOR = (1 << LED2_BIT))
89 #define LED2_TOGGLE (LED_PORT->PTOR = (1 << LED2_BIT))
90 
92 #ifdef __cplusplus
93 extern "C" {
94 #endif
95 
99 void board_init(void);
100 
101 #ifdef __cplusplus
102 }
103 #endif
104 
112 #define AT86RF2XX_PARAMS_BOARD {.spi = SPI_DEV(0), \
113  .spi_clk = SPI_CLK_5MHZ, \
114  .cs_pin = SPI_HWCS(1), \
115  .int_pin = GPIO_PIN(PORT_B, 9), \
116  .sleep_pin = GPIO_PIN(PORT_E, 6), \
117  .reset_pin = GPIO_PIN(PORT_C, 12)}
118 
119 
124 #define LIS3DH_INT1 GPIO_PIN(PORT_C, 18)
125 #define LIS3DH_INT2 GPIO_PIN(PORT_C, 17)
126 #define LIS3DH_CS SPI_HWCS(0)
127 #define LIS3DH_CLK SPI_CLK_5MHZ
128 #define LIS3DH_SPI SPI_DEV(0)
129 
135 #define MULLE_POWER_AVDD GPIO_PIN(PORT_B, 17)
136 #define MULLE_POWER_VPERIPH GPIO_PIN(PORT_D, 7)
137 #define MULLE_POWER_VSEC GPIO_PIN(PORT_B, 16)
144 #define MULLE_NVRAM_SPI_DEV SPI_DEV(0)
145 #define MULLE_NVRAM_SPI_CLK SPI_CLK_5MHZ
146 #define MULLE_NVRAM_SPI_CS SPI_HWCS(3)
147 #define MULLE_NVRAM_CAPACITY 512
148 #define MULLE_NVRAM_SPI_ADDRESS_COUNT 1
155 #define MULLE_NOR_SPI_DEV SPI_DEV(0)
156 #define MULLE_NOR_SPI_CLK SPI_CLK_5MHZ
157 #define MULLE_NOR_SPI_CS SPI_HWCS(2)
163 extern mtd_dev_t *mtd0;
164 #define MTD_0 mtd0
165 
171 #define MULLE_VBAT_ADC_LINE ADC_LINE(6)
172 #define MULLE_VCHR_ADC_LINE ADC_LINE(7)
173 
174 #endif /* BOARD_H */
175 
NVRAM offsets for the Eistec Mulle IoT board.
void board_init(void)
Initialize board specific hardware, including clock, LEDs and std-IO.