Loading...
Searching...
No Matches
board.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2015-2020 Freie Universität Berlin
3 * SPDX-License-Identifier: LGPL-2.1-only
4 */
5
6#pragma once
7
18
19#include "cpu.h"
20#include "periph_conf.h"
21#include "periph/gpio.h"
22#include "periph/spi.h"
23#include "periph/timer.h"
24
25#ifdef __cplusplus
26extern "C" {
27#endif
28
36#if IS_ACTIVE(CONFIG_EFM32_ZTIMER_USE_LETIMER)
37# define CONFIG_ZTIMER_USEC_DEV (TIMER_DEV(2))
38# define CONFIG_ZTIMER_USEC_BASE_FREQ (32768UL)
39# define CONFIG_ZTIMER_USEC_WIDTH (16)
40# define CONFIG_ZTIMER_USEC_ADJUST_SET (37)
41# define CONFIG_ZTIMER_USEC_ADJUST_SLEEP (37)
42#else
43# define CONFIG_ZTIMER_USEC_DEV (TIMER_DEV(0))
44# define CONFIG_ZTIMER_USEC_BASE_FREQ (1000000UL)
45# define CONFIG_ZTIMER_USEC_WIDTH (32)
46# define CONFIG_ZTIMER_USEC_ADJUST_SET (8)
47# define CONFIG_ZTIMER_USEC_ADJUST_SLEEP (14)
48#endif
50
58#define BC_PIN GPIO_PIN(PE, 1)
60
65#define PB0_PIN GPIO_PIN(PC, 8)
66#define PB1_PIN GPIO_PIN(PC, 9)
68
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
82
87#define LED0_ON gpio_clear(LED0_PIN)
88#define LED0_OFF gpio_set(LED0_PIN)
89#define LED0_TOGGLE gpio_toggle(LED0_PIN)
90#define LED1_ON gpio_clear(LED1_PIN)
91#define LED1_OFF gpio_set(LED1_PIN)
92#define LED1_TOGGLE gpio_toggle(LED1_PIN)
94
102#define DISP_SPI SPI_DEV(1)
103#define DISP_COM_PIN GPIO_PIN(PA, 11)
104#define DISP_CS_PIN GPIO_PIN(PC, 14)
105#define DISP_EN_PIN GPIO_PIN(PA, 9)
107
114#define SI7021_I2C I2C_DEV(2)
115#define SI7021_EN_PIN GPIO_PIN(PB, 3)
116
117#define SI70XX_PARAM_I2C_DEV SI7021_I2C
119
126#define CORETEMP_ADC ADC_LINE(0)
128
132void board_init(void);
133
134#ifdef __cplusplus
135}
136#endif
137
Configuration of CPU peripherals for the SLSTK3701A starter kit.
void board_init(void)
Initialize the board, called from the cpu startup code.
Low-level timer peripheral driver interface definitions.
Low-level GPIO peripheral driver interface definitions.
Low-level SPI peripheral driver interface definition.