board.h
3.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
/*
* Copyright (C) 2014 Freie Universität Berlin
* Copyright (C) 2015 PHYTEC Messtechnik GmbH
*
* This file is subject to the terms and conditions of the GNU Lesser General
* Public License v2.1. See the file LICENSE in the top level directory for more
* details.
*/
/**
* @defgroup boards_pba-d-01-kw2x phyWAVE-KW22 Board
* @ingroup boards
* @brief Board specific implementations for the phyWAVE evaluation board
* @{
*
* @file
* @brief Board specific definitions for the phyWAVE evaluation board
*
* @author Johann Fischer <j.fischer@phytec.de>
* @author Sebastian Meiling <s@mlng.net>
*/
#ifndef BOARD_H
#define BOARD_H
#include "cpu.h"
#include "periph_conf.h"
#ifdef __cplusplus
extern "C"
{
#endif
/**
* @name LED pin definitions and handlers
* @{
*/
#define LED0_PIN GPIO_PIN(PORT_D, 6)
#define LED1_PIN GPIO_PIN(PORT_D, 4)
#define LED2_PIN GPIO_PIN(PORT_A, 4)
#define LED0_MASK (1 << 6)
#define LED1_MASK (1 << 4)
#define LED2_MASK (1 << 4)
#define LED0_ON (GPIOD->PCOR = LED0_MASK)
#define LED0_OFF (GPIOD->PSOR = LED0_MASK)
#define LED0_TOGGLE (GPIOD->PTOR = LED0_MASK)
#define LED1_ON (GPIOD->PCOR = LED1_MASK)
#define LED1_OFF (GPIOD->PSOR = LED1_MASK)
#define LED1_TOGGLE (GPIOD->PTOR = LED1_MASK)
#define LED2_ON (GPIOA->PCOR = LED2_MASK)
#define LED2_OFF (GPIOA->PSOR = LED2_MASK)
#define LED2_TOGGLE (GPIOA->PTOR = LED2_MASK)
/** @} */
/**
* @name Macro for button S1/S2.
* @{
*/
#define BTN0_PORT PORTD
#define BTN0_PIN GPIO_PIN(PORT_D, 1)
#define BTN0_MODE GPIO_IN_PU
/** @} */
/**
* @name Macro for capacitive sensor button.
* @{
*/
#define BTN1_PORT PORTC
#define BTN1_PIN GPIO_PIN(PORT_C, 6)
#define BTN1_MODE GPIO_IN
/** @} */
/**
* @name KW2XRF configuration
*
* {spi bus, cs pin, int pin, spi speed,}
*/
#define KW2XRF_PARAMS_BOARD {.spi = SPI_DEV(1), \
.spi_clk = SPI_CLK_10MHZ, \
.cs_pin = GPIO_PIN(KW2XDRF_PORT, KW2XDRF_PCS0_PIN), \
.int_pin = GPIO_PIN(KW2XDRF_PORT, KW2XDRF_IRQ_PIN) }
#define KW2XRF_SHARED_SPI 0
/** @}*/
/**
* @name Define the interface for the HDC1000 humidity sensor
* @{
*/
#define HDC1000_I2C (I2C_DEV(0))
#define HDC1000_ADDR (0x43)
/** @} */
/**
* @name Define the interface for the MAG3110 magnetometer sensor
* @{
*/
#define MAG3110_I2C (I2C_DEV(0))
#define MAG3110_ADDR (0x0E)
/** @} */
/**
* @name Define the interface for the MMA8652 tri-axis accelerometer sensor
* @{
*/
#define MMA8652_I2C (I2C_DEV(0))
#define MMA8652_ADDR (0x1D)
/** @} */
/**
* @name Define the interface for the MPL3115A2 pressure sensor
* @{
*/
#define MPL3115A2_I2C (I2C_DEV(0))
#define MPL3115A2_ADDR (0x60)
/** @} */
/**
* @name Define the interface for the TCS3772 light sensor
* @{
*/
#define TCS37727_PARAMS { .i2c = I2C_DEV(0), \
.addr = 0x29, \
.atime = TCS37727_PARAM_ATIME }
/** @} */
/**
* @name Define the interface for the TMP006 IR-Termopile sensor
* @{
*/
#define TMP006_I2C (I2C_DEV(0))
#define TMP006_ADDR (0x41)
/** @} */
/**
* @brief Initialize board specific hardware, including clock, LEDs and std-IO
*/
void board_init(void);
#ifdef __cplusplus
}
#endif
#endif /* BOARD_H */
/** @} */