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