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/gpio.h"
26 #include "periph/spi.h"
27 
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31 
39 #if IS_ACTIVE(CONFIG_EFM32_XTIMER_USE_LETIMER)
40 #define XTIMER_DEV (TIMER_DEV(2))
41 #define XTIMER_HZ (32768UL)
42 #define XTIMER_WIDTH (16)
43 #else
44 #define XTIMER_DEV (TIMER_DEV(0))
45 #define XTIMER_HZ (1000000UL)
46 #define XTIMER_WIDTH (32)
47 #endif
48 #define XTIMER_CHAN (0)
58 #define BC_PIN GPIO_PIN(PE, 1)
65 #define PB0_PIN GPIO_PIN(PC, 8)
66 #define PB1_PIN GPIO_PIN(PC, 9)
73 #define LED0R_PIN GPIO_PIN(PH, 10)
74 #define LED0G_PIN GPIO_PIN(PH, 11)
75 #define LED0B_PIN GPIO_PIN(PH, 12)
76 #define LED1R_PIN GPIO_PIN(PH, 13)
77 #define LED1G_PIN GPIO_PIN(PH, 14)
78 #define LED1B_PIN GPIO_PIN(PH, 15)
79 #define LED0_PIN LED0R_PIN
80 #define LED1_PIN LED1R_PIN
87 #define LED0_ON gpio_set(LED0_PIN)
88 #define LED0_OFF gpio_clear(LED0_PIN)
89 #define LED0_TOGGLE gpio_toggle(LED0_PIN)
90 #define LED1_ON gpio_set(LED1_PIN)
91 #define LED1_OFF gpio_clear(LED1_PIN)
92 #define LED1_TOGGLE gpio_toggle(LED1_PIN)
101 #define DISP_SPI SPI_DEV(0)
102 #define DISP_COM_PIN GPIO_PIN(PA, 11)
103 #define DISP_CS_PIN GPIO_PIN(PC, 14)
104 #define DISP_EN_PIN GPIO_PIN(PA, 9)
113 #define SI7021_I2C I2C_DEV(2)
114 #define SI7021_EN_PIN GPIO_PIN(PB, 3)
115 
116 #define SI70XX_PARAM_I2C_DEV SI7021_I2C
125 #define CORETEMP_ADC ADC_LINE(0)
131 void board_init(void);
132 
133 #ifdef __cplusplus
134 }
135 #endif
136 
137 #endif /* BOARD_H */
Peripheral MCU configuration for the Zigduino board.
Low-level GPIO peripheral driver interface definitions.
void board_init(void)
Initialize the board (GPIO, sensors, clocks).
Low-level SPI peripheral driver interface definition.