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 Kees Bakker, SODAQ
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 "cpu.h"
23
#include "board_common.h"
24
25
#ifdef __cplusplus
26
extern
"C"
{
27
#endif
28
33
#define LED0_PIN GPIO_PIN(PA, 16)
34
#define LED0_PORT PORT->Group[PA]
35
#define LED0_MASK (1 << 16)
36
37
#define LED0_OFF (LED0_PORT.OUTSET.reg = LED0_MASK)
38
#define LED0_ON (LED0_PORT.OUTCLR.reg = LED0_MASK)
39
#define LED0_TOGGLE (LED0_PORT.OUTTGL.reg = LED0_MASK)
40
41
#define LED_GREEN_PIN LED0_PIN
42
#define LED_GREEN_OFF LED0_OFF
43
#define LED_GREEN_ON LED0_ON
44
#define LED_GREEN_TOGGLE LED0_TOGGLE
45
46
#define LED1_PIN GPIO_PIN(PA, 14)
47
#define LED1_PORT PORT->Group[PA]
48
#define LED1_MASK (1 << 14)
49
50
#define LED1_OFF (LED1_PORT.OUTSET.reg = LED1_MASK)
51
#define LED1_ON (LED1_PORT.OUTCLR.reg = LED1_MASK)
52
#define LED1_TOGGLE (LED1_PORT.OUTTGL.reg = LED1_MASK)
53
54
#define LED_RED_PIN LED1_PIN
55
#define LED_RED_OFF LED1_OFF
56
#define LED_RED_ON LED1_ON
57
#define LED_RED_TOGGLE LED1_TOGGLE
58
59
#define LED2_PIN GPIO_PIN(PA, 15)
60
#define LED2_PORT PORT->Group[PA]
61
#define LED2_MASK (1 << 15)
62
63
#define LED2_OFF (LED2_PORT.OUTSET.reg = LED2_MASK)
64
#define LED2_ON (LED2_PORT.OUTCLR.reg = LED2_MASK)
65
#define LED2_TOGGLE (LED2_PORT.OUTTGL.reg = LED2_MASK)
66
67
#define LED_BLUE_PIN LED2_PIN
68
#define LED_BLUE_OFF LED2_OFF
69
#define LED_BLUE_ON LED2_ON
70
#define LED_BLUE_TOGGLE LED2_TOGGLE
71
76
#define BTN0_PIN GPIO_PIN(PB, 8)
77
#define BTN0_MODE GPIO_IN
78
84
#define GPS_TIMEPULSE_PIN GPIO_PIN(PA, 17)
85
#define GPS_TIMEPULSE_MODE GPIO_IN
86
92
#define GPS_ENABLE_PIN GPIO_PIN(PA, 18)
93
94
#define GPS_ENABLE_PORT PORT->Group[PA]
95
#define GPS_ENABLE_MASK (1 << 18)
96
97
#define GPS_ENABLE_ON (GPS_ENABLE_PORT.OUTSET.reg = GPS_ENABLE_MASK)
98
#define GPS_ENABLE_OFF (GPS_ENABLE_PORT.OUTCLR.reg = GPS_ENABLE_MASK)
99
107
#define SARA_ENABLE_PIN GPIO_PIN(PA, 4)
108
109
#define SARA_ENABLE_PORT PORT->Group[PA]
110
#define SARA_ENABLE_MASK (1 << 4)
111
112
#define SARA_ENABLE_ON (SARA_ENABLE_PORT.OUTSET.reg = SARA_ENABLE_MASK)
113
#define SARA_ENABLE_OFF (SARA_ENABLE_PORT.OUTCLR.reg = SARA_ENABLE_MASK)
114
122
#define SARA_TX_ENABLE_PIN GPIO_PIN(PA, 27)
123
124
#define SARA_TX_ENABLE_PORT PORT->Group[PA]
125
#define SARA_TX_ENABLE_MASK (1 << 27)
126
127
#define SARA_TX_ENABLE_ON (SARA_TX_ENABLE_PORT.OUTSET.reg = SARA_TX_ENABLE_MASK)
128
#define SARA_TX_ENABLE_OFF (SARA_TX_ENABLE_PORT.OUTCLR.reg = SARA_TX_ENABLE_MASK)
129
139
#define SARA_R4XX_PWR_ON_PIN GPIO_PIN(PB, 10)
140
141
#define SARA_R4XX_PWR_ON_PORT PORT->Group[PB]
142
#define SARA_R4XX_PWR_ON_MASK (1 << 10)
143
144
#define SARA_R4XX_PWR_ON_ON (SARA_R4XX_PWR_ON_PORT.OUTSET.reg = SARA_R4XX_PWR_ON_MASK)
145
#define SARA_R4XX_PWR_ON_OFF (SARA_R4XX_PWR_ON_PORT.OUTCLR.reg = SARA_R4XX_PWR_ON_MASK)
146
154
#define INT_MAG_PIN GPIO_PIN(PA, 19)
155
#define INT_MAG_MODE GPIO_IN
156
164
#define INT1_XL_PIN GPIO_PIN(PA, 20)
165
#define INT1_XL_MODE GPIO_IN
166
174
#define INT2_XL_PIN GPIO_PIN(PA, 21)
175
#define INT2_XL_MODE GPIO_IN
176
178
#ifdef __cplusplus
179
}
180
#endif
181
182
#endif
/* BOARD_H */
183
Generated on Tue Nov 24 2020 19:46:49 by
1.8.17