Loading...
Searching...
No Matches
board.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2018 Inria
3 * SPDX-License-Identifier: LGPL-2.1-only
4 */
5
6#pragma once
7
17
18#include "cpu.h"
19#include "board_common.h"
20
21#ifdef __cplusplus
22extern "C" {
23#endif
24
30
45#ifdef DOXYGEN
46#define PARTICLE_MONOFIRMWARE
47#endif
48
60#ifdef DOXYGEN
61#define PARTICLE_MONOFIRMWARE_CHECKSUMLIMIT
62#endif
63
74#ifdef DOXYGEN
75#define PARTICLE_PLATFORM_ID
76#endif
77
79
84#define LED0_PIN GPIO_PIN(0, 13)
85#define LED1_PIN GPIO_PIN(0, 14)
86#define LED2_PIN GPIO_PIN(0, 15)
87
88#define LED_PORT (NRF_P0)
89#define LED0_MASK (1 << 13)
90#define LED1_MASK (1 << 14)
91#define LED2_MASK (1 << 15)
92#define LED_MASK (LED0_MASK | LED1_MASK | LED2_MASK)
93
94/* The typical SAUL setup for this board uses PWM to make the LEDs (really a
95 * single RGB LED) into a PWM controlled RGB LED entry. As a consequence of the
96 * PWM configuration, toggling the GPIO has no effect any more, and thus we do
97 * not define the macros so that no LEDs get picked up for LEDn_IS_PROVIDED.
98 * (The LEDn_ON etc macros will still be present and no-op as usual, but those
99 * explicitly checking for IS_PROVIDED will get an accurate picture).
100 *
101 * Both conditions are typically true when saul_default is on, but strictly, it
102 * is those two that in combination make LEDs effectively unavailable to users.
103 * */
104#if !(IS_USED(MODULE_AUTO_INIT_SAUL) && IS_USED(MODULE_SAUL_PWM))
105
106#define LED0_ON (LED_PORT->OUTCLR = LED0_MASK)
107#define LED0_OFF (LED_PORT->OUTSET = LED0_MASK)
108#define LED0_TOGGLE (LED_PORT->OUT ^= LED0_MASK)
109
110#define LED1_ON (LED_PORT->OUTCLR = LED1_MASK)
111#define LED1_OFF (LED_PORT->OUTSET = LED1_MASK)
112#define LED1_TOGGLE (LED_PORT->OUT ^= LED1_MASK)
113
114#define LED2_ON (LED_PORT->OUTCLR = LED2_MASK)
115#define LED2_OFF (LED_PORT->OUTSET = LED2_MASK)
116#define LED2_TOGGLE (LED_PORT->OUT ^= LED2_MASK)
117
118#endif /* !(IS_USED(MODULE_AUTO_INIT_SAUL) && IS_USED(MODULE_SAUL_PWM)) */
119
121
126#define BTN0_PIN GPIO_PIN(0, 11)
127#define BTN0_MODE GPIO_IN_PU
129
134
144
155
156#if defined(BOARD_PARTICLE_XENON) || defined(DOXYGEN)
162#define VCTL1_PIN GPIO_PIN(0, 24)
171#define VCTL2_PIN GPIO_PIN(0, 25)
172#endif
173
174#ifdef BOARD_PARTICLE_ARGON
175#define VCTL1_PIN GPIO_PIN(0, 25)
176#define VCTL2_PIN GPIO_PIN(0, 2)
177#endif
178
179#ifdef BOARD_PARTICLE_BORON
180#define VCTL1_PIN GPIO_PIN(0, 7)
181#endif
182
184
185#ifdef __cplusplus
186}
187#endif
188
void board_nrfantenna_select(enum board_nrfantenna_selection choice)
Antenna output selection.
board_nrfantenna_selection
Choices in antenna outputs for the board's nRF radio.
Definition board.h:138
@ BOARD_NRFANTENNA_EXTERNAL
The board's uFL connector.
Definition board.h:142
@ BOARD_NRFANTENNA_BUILTIN
The board's built-in antenna.
Definition board.h:140