-
Notifications
You must be signed in to change notification settings - Fork 2k
/
board.h
138 lines (122 loc) · 3.08 KB
/
board.h
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
/*
* Copyright (C) 2015-2020 Freie Universität Berlin
*
* 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.
*/
/**
* @ingroup boards_slstk3701a
* @{
*
* @file
* @brief Board specific definitions for the SLSTK3701A starter kit
*
* @author Hauke Petersen <hauke.petersen@fu-berlin.de>
* @author Bas Stottelaar <basstottelaar@gmail.com>
*/
#ifndef BOARD_H
#define BOARD_H
#include "cpu.h"
#include "periph_conf.h"
#include "periph/gpio.h"
#include "periph/spi.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* @name Xtimer configuration
*
* The timer runs at 1000 kHz to increase accuracy, or at 32.768 kHz if
* LETIMER is used.
* @{
*/
#if IS_ACTIVE(CONFIG_EFM32_XTIMER_USE_LETIMER)
#define XTIMER_DEV (TIMER_DEV(2))
#define XTIMER_HZ (32768UL)
#define XTIMER_WIDTH (16)
#else
#define XTIMER_DEV (TIMER_DEV(0))
#define XTIMER_HZ (1000000UL)
#define XTIMER_WIDTH (32)
#endif
#define XTIMER_CHAN (0)
/** @} */
/**
* @name Board controller configuration
*
* Define the GPIO pin to enable the BC, to allow serial communication
* via the USB port.
* @{
*/
#define BC_PIN GPIO_PIN(PE, 1)
/** @} */
/**
* @name Push button pin definitions
* @{
*/
#define PB0_PIN GPIO_PIN(PC, 8)
#define PB1_PIN GPIO_PIN(PC, 9)
/** @} */
/**
* @name LED pin definitions
* @{
*/
#define LED0R_PIN GPIO_PIN(PH, 10)
#define LED0G_PIN GPIO_PIN(PH, 11)
#define LED0B_PIN GPIO_PIN(PH, 12)
#define LED1R_PIN GPIO_PIN(PH, 13)
#define LED1G_PIN GPIO_PIN(PH, 14)
#define LED1B_PIN GPIO_PIN(PH, 15)
#define LED0_PIN LED0R_PIN
#define LED1_PIN LED1R_PIN
/** @} */
/**
* @name Macros for controlling the on-board LEDs
* @{
*/
#define LED0_ON gpio_set(LED0_PIN)
#define LED0_OFF gpio_clear(LED0_PIN)
#define LED0_TOGGLE gpio_toggle(LED0_PIN)
#define LED1_ON gpio_set(LED1_PIN)
#define LED1_OFF gpio_clear(LED1_PIN)
#define LED1_TOGGLE gpio_toggle(LED1_PIN)
/** @} */
/**
* @name Display configuration
*
* Connection to the on-board Sharp Memory LCD (LS013B7DH03).
* @{
*/
#define DISP_SPI SPI_DEV(0)
#define DISP_COM_PIN GPIO_PIN(PA, 11)
#define DISP_CS_PIN GPIO_PIN(PC, 14)
#define DISP_EN_PIN GPIO_PIN(PA, 9)
/** @} */
/**
* @name Temperature sensor configuration
*
* Connection to the on-board temperature/humidity sensor (Si7021).
* @{
*/
#define SI7021_I2C I2C_DEV(2)
#define SI7021_EN_PIN GPIO_PIN(PB, 3)
#define SI70XX_PARAM_I2C_DEV SI7021_I2C
/** @} */
/**
* @name Core temperature sensor configuration
*
* Connection to the on-chip temperature sensor.
* @{
*/
#define CORETEMP_ADC ADC_LINE(0)
/** @} */
/**
* @brief Initialize the board (GPIO, sensors, clocks).
*/
void board_init(void);
#ifdef __cplusplus
}
#endif
#endif /* BOARD_H */
/** @} */