Loading...
Searching...
No Matches
board.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2018 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
9#pragma once
10
20
21#include "cpu.h"
22#include "board_common.h"
23
24#ifdef __cplusplus
25extern "C" {
26#endif
27
33
48#ifdef DOXYGEN
49#define PARTICLE_MONOFIRMWARE
50#endif
51
63#ifdef DOXYGEN
64#define PARTICLE_MONOFIRMWARE_CHECKSUMLIMIT
65#endif
66
77#ifdef DOXYGEN
78#define PARTICLE_PLATFORM_ID
79#endif
80
82
87#define LED0_PIN GPIO_PIN(0, 13)
88#define LED1_PIN GPIO_PIN(0, 14)
89#define LED2_PIN GPIO_PIN(0, 15)
90
91#define LED_PORT (NRF_P0)
92#define LED0_MASK (1 << 13)
93#define LED1_MASK (1 << 14)
94#define LED2_MASK (1 << 15)
95#define LED_MASK (LED0_MASK | LED1_MASK | LED2_MASK)
96
97/* The typical SAUL setup for this board uses PWM to make the LEDs (really a
98 * single RGB LED) into a PWM controlled RGB LED entry. As a consequence of the
99 * PWM configuration, toggling the GPIO has no effect any more, and thus we do
100 * not define the macros so that no LEDs get picked up for LEDn_IS_PROVIDED.
101 * (The LEDn_ON etc macros will still be present and no-op as usual, but those
102 * explicitly checking for IS_PROVIDED will get an accurate picture).
103 *
104 * Both conditions are typically true when saul_default is on, but strictly, it
105 * is those two that in combination make LEDs effectively unavailable to users.
106 * */
107#if !(IS_USED(MODULE_AUTO_INIT_SAUL) && IS_USED(MODULE_SAUL_PWM))
108
109#define LED0_ON (LED_PORT->OUTCLR = LED0_MASK)
110#define LED0_OFF (LED_PORT->OUTSET = LED0_MASK)
111#define LED0_TOGGLE (LED_PORT->OUT ^= LED0_MASK)
112
113#define LED1_ON (LED_PORT->OUTCLR = LED1_MASK)
114#define LED1_OFF (LED_PORT->OUTSET = LED1_MASK)
115#define LED1_TOGGLE (LED_PORT->OUT ^= LED1_MASK)
116
117#define LED2_ON (LED_PORT->OUTCLR = LED2_MASK)
118#define LED2_OFF (LED_PORT->OUTSET = LED2_MASK)
119#define LED2_TOGGLE (LED_PORT->OUT ^= LED2_MASK)
120
121#endif /* !(IS_USED(MODULE_AUTO_INIT_SAUL) && IS_USED(MODULE_SAUL_PWM)) */
122
124
129#define BTN0_PIN GPIO_PIN(0, 11)
130#define BTN0_MODE GPIO_IN_PU
132
137
147
158
159#if defined(BOARD_PARTICLE_XENON) || defined(DOXYGEN)
165#define VCTL1_PIN GPIO_PIN(0, 24)
174#define VCTL2_PIN GPIO_PIN(0, 25)
175#endif
176
177#ifdef BOARD_PARTICLE_ARGON
178#define VCTL1_PIN GPIO_PIN(0, 25)
179#define VCTL2_PIN GPIO_PIN(0, 2)
180#endif
181
182#ifdef BOARD_PARTICLE_BORON
183#define VCTL1_PIN GPIO_PIN(0, 7)
184#endif
185
187
188#ifdef __cplusplus
189}
190#endif
191
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:141
@ BOARD_NRFANTENNA_EXTERNAL
The board's uFL connector.
Definition board.h:145
@ BOARD_NRFANTENNA_BUILTIN
The board's built-in antenna.
Definition board.h:143