Loading...
Searching...
No Matches
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#include "periph/gpio.h"
25
26#ifdef __cplusplus
27extern "C" {
28#endif
29
34#define LED0_PIN GPIO_PIN(PA, 16)
35#define LED0_PORT PORT->Group[PA]
36#define LED0_MASK (1 << 16)
37
38#define LED0_OFF (LED0_PORT.OUTSET.reg = LED0_MASK)
39#define LED0_ON (LED0_PORT.OUTCLR.reg = LED0_MASK)
40#define LED0_TOGGLE (LED0_PORT.OUTTGL.reg = LED0_MASK)
41
42#define LED_GREEN_PIN LED0_PIN
43#define LED_GREEN_OFF LED0_OFF
44#define LED_GREEN_ON LED0_ON
45#define LED_GREEN_TOGGLE LED0_TOGGLE
46
47#define LED1_PIN GPIO_PIN(PA, 14)
48#define LED1_PORT PORT->Group[PA]
49#define LED1_MASK (1 << 14)
50
51#define LED1_OFF (LED1_PORT.OUTSET.reg = LED1_MASK)
52#define LED1_ON (LED1_PORT.OUTCLR.reg = LED1_MASK)
53#define LED1_TOGGLE (LED1_PORT.OUTTGL.reg = LED1_MASK)
54
55#define LED_RED_PIN LED1_PIN
56#define LED_RED_OFF LED1_OFF
57#define LED_RED_ON LED1_ON
58#define LED_RED_TOGGLE LED1_TOGGLE
59
60#define LED2_PIN GPIO_PIN(PA, 15)
61#define LED2_PORT PORT->Group[PA]
62#define LED2_MASK (1 << 15)
63
64#define LED2_OFF (LED2_PORT.OUTSET.reg = LED2_MASK)
65#define LED2_ON (LED2_PORT.OUTCLR.reg = LED2_MASK)
66#define LED2_TOGGLE (LED2_PORT.OUTTGL.reg = LED2_MASK)
67
68#define LED_BLUE_PIN LED2_PIN
69#define LED_BLUE_OFF LED2_OFF
70#define LED_BLUE_ON LED2_ON
71#define LED_BLUE_TOGGLE LED2_TOGGLE
78#define BTN0_PIN GPIO_PIN(PB, 8)
79#define BTN0_MODE GPIO_IN
86#define GPS_TIMEPULSE_PIN GPIO_PIN(PA, 17)
87#define GPS_TIMEPULSE_MODE GPIO_IN
94#define GPS_ENABLE_PIN GPIO_PIN(PA, 18)
95
96#define GPS_ENABLE_PORT PORT->Group[PA]
97#define GPS_ENABLE_MASK (1 << 18)
98
99#define GPS_ENABLE_ON (GPS_ENABLE_PORT.OUTSET.reg = GPS_ENABLE_MASK)
100#define GPS_ENABLE_OFF (GPS_ENABLE_PORT.OUTCLR.reg = GPS_ENABLE_MASK)
109#define SARA_ENABLE_PIN GPIO_PIN(PA, 4)
110
111#define SARA_ENABLE_PORT PORT->Group[PA]
112#define SARA_ENABLE_MASK (1 << 4)
113
114#define SARA_ENABLE_ON (SARA_ENABLE_PORT.OUTSET.reg = SARA_ENABLE_MASK)
115#define SARA_ENABLE_OFF (SARA_ENABLE_PORT.OUTCLR.reg = SARA_ENABLE_MASK)
124#define SARA_TX_ENABLE_PIN GPIO_PIN(PA, 27)
125
126#define SARA_TX_ENABLE_PORT PORT->Group[PA]
127#define SARA_TX_ENABLE_MASK (1 << 27)
128
129#define SARA_TX_ENABLE_ON (SARA_TX_ENABLE_PORT.OUTSET.reg = SARA_TX_ENABLE_MASK)
130#define SARA_TX_ENABLE_OFF (SARA_TX_ENABLE_PORT.OUTCLR.reg = SARA_TX_ENABLE_MASK)
141#define SARA_R4XX_PWR_ON_PIN GPIO_PIN(PB, 10)
142
143#define SARA_R4XX_PWR_ON_PORT PORT->Group[PB]
144#define SARA_R4XX_PWR_ON_MASK (1 << 10)
145
146#define SARA_R4XX_PWR_ON_ON (SARA_R4XX_PWR_ON_PORT.OUTSET.reg = SARA_R4XX_PWR_ON_MASK)
147#define SARA_R4XX_PWR_ON_OFF (SARA_R4XX_PWR_ON_PORT.OUTCLR.reg = SARA_R4XX_PWR_ON_MASK)
150#define SARA_STATUS_PIN GPIO_PIN(PA, 28)
158#define INT_MAG_PIN GPIO_PIN(PA, 19)
159#define INT_MAG_MODE GPIO_IN
168#define INT1_XL_PIN GPIO_PIN(PA, 20)
169#define INT1_XL_MODE GPIO_IN
178#define INT2_XL_PIN GPIO_PIN(PA, 21)
179#define INT2_XL_MODE GPIO_IN
182#ifdef __cplusplus
183}
184#endif
185
186#endif /* BOARD_H */
Low-level GPIO peripheral driver interface definitions.