board.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2015-2020 Freie Universität Berlin
3  *
4  * This file is subject to the terms and conditions of the GNU Lesser
5  * General Public License v2.1. See the file LICENSE in the top level
6  * directory for more details.
7  */
8 
20 #ifndef BOARD_H
21 #define BOARD_H
22 
23 #include "cpu.h"
24 #include "periph_conf.h"
25 #include "periph/adc.h"
26 #include "periph/gpio.h"
27 #include "periph/spi.h"
28 
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32 
40 #if IS_ACTIVE(CONFIG_EFM32_XTIMER_USE_LETIMER)
41 #define XTIMER_DEV (TIMER_DEV(1))
42 #define XTIMER_HZ (32768UL)
43 #define XTIMER_WIDTH (16)
44 #else
45 #define XTIMER_DEV (TIMER_DEV(0))
46 #define XTIMER_HZ (250000UL)
47 #define XTIMER_WIDTH (16)
48 #endif
49 #define XTIMER_CHAN (0)
50 
56 #define PB0_PIN GPIO_PIN(PD, 14)
57 #define PB1_PIN GPIO_PIN(PD, 15)
58 
64 #define LED0_PIN GPIO_PIN(PD, 12)
65 #define LED1_PIN GPIO_PIN(PD, 11)
66 
72 #define LED0_ON gpio_set(LED0_PIN)
73 #define LED0_OFF gpio_clear(LED0_PIN)
74 #define LED0_TOGGLE gpio_toggle(LED0_PIN)
75 #define LED1_ON gpio_set(LED1_PIN)
76 #define LED1_OFF gpio_clear(LED1_PIN)
77 #define LED1_TOGGLE gpio_toggle(LED1_PIN)
78 
86 #define CORETEMP_ADC ADC_LINE(0)
87 
95 #define ENV_SENSE_PIC_ADDR (0x01)
96 #define ENV_SENSE_PIC_BIT (0)
97 
105 #define BMP280_I2C I2C_DEV(0)
106 
107 #define BMX280_PARAM_I2C_DEV BMP280_I2C
108 
116 #define CCS811_I2C I2C_DEV(0)
117 
118 #define CCS811_PIC_ADDR (0x03)
119 #define CCS811_PIC_EN_BIT (0x00)
120 #define CCS811_PIC_WAKE_BIT (0x01)
121 
122 #define CCS811_PARAM_I2C_DEV CCS811_I2C
123 
131 #ifndef ICM20648_ENABLED
132 #define ICM20648_ENABLED 0
133 #endif
134 #define ICM20648_SPI SPI_DEV(0)
135 #define ICM20648_PIC_ADDR (0x00)
136 #define ICM20648_PIC_EN_BIT (0x00)
137 
145 #define PIC_INT_WAKE_PIN GPIO_PIN(PD, 10)
146 #define PIC_I2C I2C_DEV(0)
147 #define PIC_I2C_ADDR (0x48)
148 
156 #ifndef RGB_LED1_ENABLED
157 #define RGB_LED1_ENABLED 1
158 #endif
159 #ifndef RGB_LED2_ENABLED
160 #define RGB_LED2_ENABLED 1
161 #endif
162 #ifndef RGB_LED3_ENABLED
163 #define RGB_LED3_ENABLED 1
164 #endif
165 #ifndef RGB_LED4_ENABLED
166 #define RGB_LED4_ENABLED 1
167 #endif
168 #define RGB_LED_ADDR (0x04)
169 #define RGB_LED_EN_BIT (0x00)
170 #define RGB_LED1_EN_BIT (0x07)
171 #define RGB_LED2_EN_BIT (0x06)
172 #define RGB_LED3_EN_BIT (0x05)
173 #define RGB_LED4_EN_BIT (0x04)
174 
182 #ifndef SI1133_ENABLED
183 #define SI1133_ENABLED 0
184 #endif
185 #define SI1133_I2C I2C_DEV(0)
186 
194 #define SI7021_I2C I2C_DEV(0)
195 
196 #define SI70XX_PARAM_I2C_DEV SI7021_I2C
197 
206 #ifndef SI7210_ENABLED
207 #define SI7210_ENABLED 0
208 #endif
209 #define SI7210_I2C I2C_DEV(0)
210 
215 void board_init(void);
216 
217 #ifdef __cplusplus
218 }
219 #endif
220 
221 #endif /* BOARD_H */
222 
spi.h
Low-level SPI peripheral driver interface definition.
periph_conf.h
Configuration of CPU peripherals for the SLTB001A starter kit.
adc.h
Low-level ADC peripheral driver interface definitions.
gpio.h
Low-level GPIO peripheral driver interface definitions.
board_init
void board_init(void)
Board level initialization.