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 
23 #ifndef BOARD_H
24 #define BOARD_H
25 
26 #include "cpu.h"
27 #include "periph_conf.h"
28 
29 #ifdef __cplusplus
30 extern "C"
31 {
32 #endif
33 
38 #define LED0_PIN GPIO_PIN(PORT_D, 6)
39 #define LED1_PIN GPIO_PIN(PORT_D, 4)
40 #define LED2_PIN GPIO_PIN(PORT_A, 4)
41 
42 #define LED0_MASK (1 << 6)
43 #define LED1_MASK (1 << 4)
44 #define LED2_MASK (1 << 4)
45 
46 #define LED0_ON (GPIOD->PCOR = LED0_MASK)
47 #define LED0_OFF (GPIOD->PSOR = LED0_MASK)
48 #define LED0_TOGGLE (GPIOD->PTOR = LED0_MASK)
49 
50 #define LED1_ON (GPIOD->PCOR = LED1_MASK)
51 #define LED1_OFF (GPIOD->PSOR = LED1_MASK)
52 #define LED1_TOGGLE (GPIOD->PTOR = LED1_MASK)
53 
54 #define LED2_ON (GPIOA->PCOR = LED2_MASK)
55 #define LED2_OFF (GPIOA->PSOR = LED2_MASK)
56 #define LED2_TOGGLE (GPIOA->PTOR = LED2_MASK)
57 
63 #define BTN0_PORT PORTD
64 #define BTN0_PIN GPIO_PIN(PORT_D, 1)
65 #define BTN0_MODE GPIO_IN_PU
66 
72 #define BTN1_PORT PORTC
73 #define BTN1_PIN GPIO_PIN(PORT_C, 6)
74 #define BTN1_MODE GPIO_IN
75 
82 #define KW2XRF_PARAMS_BOARD {.spi = SPI_DEV(1), \
83  .spi_clk = SPI_CLK_10MHZ, \
84  .cs_pin = GPIO_PIN(KW2XDRF_PORT, KW2XDRF_PCS0_PIN), \
85  .int_pin = GPIO_PIN(KW2XDRF_PORT, KW2XDRF_IRQ_PIN) }
86 #define KW2XRF_SHARED_SPI 0
87 
93 #define HDC1000_I2C (I2C_DEV(0))
94 #define HDC1000_ADDR (0x43)
95 
101 #define MAG3110_I2C (I2C_DEV(0))
102 #define MAG3110_ADDR (0x0E)
103 
109 #define MMA8652_I2C (I2C_DEV(0))
110 #define MMA8652_ADDR (0x1D)
111 
117 #define MPL3115A2_I2C (I2C_DEV(0))
118 #define MPL3115A2_ADDR (0x60)
119 
125 #define TCS37727_PARAMS { .i2c = I2C_DEV(0), \
126  .addr = 0x29, \
127  .atime = TCS37727_PARAM_ATIME }
128 
134 #define TMP006_I2C (I2C_DEV(0))
135 #define TMP006_ADDR (0x41)
136 
141 void board_init(void);
142 
143 #ifdef __cplusplus
144 }
145 #endif
146 
147 #endif /* BOARD_H */
148 
void board_init(void)
Initialize board specific hardware, including clock, LEDs and std-IO.