The friendly Operating System for the Internet of Things
pba-d-01-kw2x/include/board.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2014 Freie Universit├Ąt Berlin
3  * Copyright (C) 2015 PHYTEC Messtechnik GmbH
4  *
5  * This file is subject to the terms and conditions of the GNU Lesser General
6  * Public License v2.1. See the file LICENSE in the top level directory for more
7  * details.
8  */
9 
22 #ifndef BOARD_H
23 #define BOARD_H
24 
25 #include "cpu.h"
26 #include "periph_conf.h"
27 
28 #ifdef __cplusplus
29 extern "C"
30 {
31 #endif
32 
37 #define LED0_PIN GPIO_PIN(PORT_D, 6)
38 #define LED1_PIN GPIO_PIN(PORT_D, 4)
39 #define LED2_PIN GPIO_PIN(PORT_A, 4)
40 
41 #define LED0_MASK (1 << 6)
42 #define LED1_MASK (1 << 4)
43 #define LED2_MASK (1 << 4)
44 
45 #define LED0_ON (GPIOD->PCOR = LED0_MASK)
46 #define LED0_OFF (GPIOD->PSOR = LED0_MASK)
47 #define LED0_TOGGLE (GPIOD->PTOR = LED0_MASK)
48 
49 #define LED1_ON (GPIOD->PCOR = LED1_MASK)
50 #define LED1_OFF (GPIOD->PSOR = LED1_MASK)
51 #define LED1_TOGGLE (GPIOD->PTOR = LED1_MASK)
52 
53 #define LED2_ON (GPIOA->PCOR = LED2_MASK)
54 #define LED2_OFF (GPIOA->PSOR = LED2_MASK)
55 #define LED2_TOGGLE (GPIOA->PTOR = LED2_MASK)
56 
62 #define BUTTON_PORT PORTD
63 #define BUTTON_PIN 1
64 #define BUTTON_GPIO GPIO_PIN(PORT_D, BUTTON_PIN)
65 
72 #define KW2XRF_PARAMS_BOARD {.spi = SPI_DEV(1), \
73  .spi_clk = SPI_CLK_10MHZ, \
74  .cs_pin = GPIO_PIN(KW2XDRF_PORT, KW2XDRF_PCS0_PIN), \
75  .int_pin = GPIO_PIN(KW2XDRF_PORT, KW2XDRF_IRQ_PIN) }
76 #define KW2XRF_SHARED_SPI 0
77 
83 #define HDC1000_I2C (I2C_DEV(0))
84 #define HDC1000_ADDR (0x43)
85 
91 #define MAG3110_I2C (I2C_DEV(0))
92 #define MAG3110_ADDR (0x0E)
93 
99 #define MMA8652_I2C (I2C_DEV(0))
100 #define MMA8652_ADDR (0x1D)
101 
107 #define MPL3115A2_I2C (I2C_DEV(0))
108 #define MPL3115A2_ADDR (0x60)
109 
115 #define TCS37727_PARAMS { .i2c = I2C_DEV(0), \
116  .addr = 0x29, \
117  .atime = TCS37727_PARAM_ATIME }
118 
124 #define TMP006_I2C (I2C_DEV(0))
125 #define TMP006_ADDR (0x41)
126 
131 void board_init(void);
132 
133 #ifdef __cplusplus
134 }
135 #endif
136 
137 #endif /* BOARD_H */
138 
void board_init(void)
Initialize board specific hardware, including clock, LEDs and std-IO.