Toggle navigation
Documentation
The friendly Operating System for the Internet of Things
board.h
Go to the documentation of this file.
1
/*
2
* Copyright (C) 2019 Inria
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
19
#ifndef BOARD_H
20
#define BOARD_H
21
22
#include "
board_nucleo.h
"
23
24
#ifdef __cplusplus
25
extern
"C"
{
26
#endif
27
32
#define LED0_PORT GPIOB
33
#define LED0_PIN GPIO_PIN(PORT_B, 5)
34
#define LED0_MASK (1 << 5)
35
#define LED0_ON (LED0_PORT->BSRR = LED0_MASK)
36
#define LED0_OFF (LED0_PORT->BSRR = (LED0_MASK << 16))
37
#define LED0_TOGGLE (LED0_PORT->ODR ^= LED0_MASK)
38
39
#define LED1_PORT GPIOB
40
#define LED1_PIN GPIO_PIN(PORT_B, 0)
41
#define LED1_MASK (1 << 0)
42
#define LED1_ON (LED0_PORT->BSRR = LED1_MASK)
43
#define LED1_OFF (LED0_PORT->BSRR = (LED1_MASK << 16))
44
#define LED1_TOGGLE (LED0_PORT->ODR ^= LED1_MASK)
45
46
#define LED2_PORT GPIOB
47
#define LED2_PIN GPIO_PIN(PORT_B, 1)
48
#define LED2_MASK (1 << 1)
49
#define LED2_ON (LED0_PORT->BSRR = LED2_MASK)
50
#define LED2_OFF (LED0_PORT->BSRR = (LED2_MASK << 16))
51
#define LED2_TOGGLE (LED0_PORT->ODR ^= LED2_MASK)
52
54
/* p-nucleo-wb55 always use LED0, as there is no dual use of its pin */
55
#ifndef AUTO_INIT_LED0
56
#define AUTO_INIT_LED0
57
#endif
58
64
#define BTN0_PIN GPIO_PIN(PORT_C, 4)
65
#define BTN0_MODE GPIO_IN_PU
66
#define BTN1_PIN GPIO_PIN(PORT_D, 0)
67
#define BTN1_MODE GPIO_IN_PU
68
#define BTN2_PIN GPIO_PIN(PORT_D, 1)
69
#define BTN2_MODE GPIO_IN_PU
70
72
#ifdef __cplusplus
73
}
74
#endif
75
76
#endif
/* BOARD_H */
77
board_nucleo.h
Global common Nucleo board configuration.
Generated on Tue Nov 24 2020 19:46:49 by
1.8.17