add powerhold for @bigcorvus board

1.2-legacy
geeksville 2020-08-16 14:50:04 -07:00
rodzic 67bad9a689
commit 6b568ab2fb
3 zmienionych plików z 31 dodań i 22 usunięć

Wyświetl plik

@ -218,7 +218,8 @@ extends = nrf52_base
board = lora-relay-v1
lib_deps =
${env.lib_deps}
SparkFun BQ27441 LiPo Fuel Gauge Arduino Library
# Adafruit ST7735 and ST7789 Library

Wyświetl plik

@ -40,15 +40,15 @@ const uint32_t g_ADigitalPinMap[] = {
8, // D12 is P0.08 D_CS (IPS display chip select)
41, // D13 is P1.09 BLT (IPS display backlight)
4, // D14 is P0.04 SX1262 RXEN
5, // D15 is P0.05 PHOLD
// D14 .. D21 (aka A0 .. A7)
5, // D15 is P0.05 (A0)
30, // D16 is P0.30 (A1)
28, // D17 is P0.28 (A2)
2, // D18 is P0.02 (A3)
3, // D19 is P0.03 (A4)
29, // D20 is P0.29 (A5, Battery)
31, // D21 is P0.31 (A6, ARef)
30, // D16 is P0.30 (A0)
28, // D17 is P0.28 (A1)
2, // D18 is P0.02 (A2)
3, // D19 is P0.03 (A3)
29, // D20 is P0.29 (A4, Battery)
31, // D21 is P0.31 (A5, ARef)
// D22 .. D23 (aka I2C pins)
12, // D22 is P0.12 (SDA)
@ -85,13 +85,13 @@ const uint32_t g_ADigitalPinMap[] = {
32 + 12, // D34 P1.12 E22-SX1262 RESET
32 + 1, // P1.01 BTN_UP
32 + 2, // P1.02 SWITCH
32 + 14, // D37 P1.14 is not connected per schematic
36, // P1.04 is not connected per schematic
37, // P1.05 is not connected per schematic
38, // P1.06 is not connected per schematic
39, // P1.07 is not connected per schematic
43, // P1.11 is not connected per schematic
45, // P1.13 is not connected per schematic
46, // P1.14 is not connected per schematic
};
void initVariant()

Wyświetl plik

@ -38,7 +38,7 @@ extern "C" {
// Number of pins defined in PinDescription array
#define PINS_COUNT (43)
#define NUM_DIGITAL_PINS (43)
#define NUM_ANALOG_INPUTS (7) // A6 is used for battery, A7 is analog reference
#define NUM_ANALOG_INPUTS (6) // A6 is used for battery, A7 is analog reference
#define NUM_ANALOG_OUTPUTS (0)
// LEDs
@ -62,13 +62,12 @@ extern "C" {
/*
* Analog pins
*/
#define PIN_A0 (15)
#define PIN_A1 (16)
#define PIN_A2 (17)
#define PIN_A3 (18)
#define PIN_A4 (19)
#define PIN_A5 (20)
#define PIN_A6 (21)
#define PIN_A0 (16)
#define PIN_A1 (17)
#define PIN_A2 (18)
#define PIN_A3 (19)
#define PIN_A4 (20)
#define PIN_A5 (21)
static const uint8_t A0 = PIN_A0;
static const uint8_t A1 = PIN_A1;
@ -76,18 +75,27 @@ static const uint8_t A2 = PIN_A2;
static const uint8_t A3 = PIN_A3;
static const uint8_t A4 = PIN_A4;
static const uint8_t A5 = PIN_A5;
static const uint8_t A6 = PIN_A6;
// static const uint8_t A7 = PIN_A7;
#define ADC_RESOLUTION 14
// Other pins
#define PIN_AREF PIN_A6
#define PIN_VBAT PIN_A5
#define PIN_AREF PIN_A5
#define PIN_VBAT PIN_A4
#define PIN_NFC1 (33)
#define PIN_NFC2 (2)
#define PIN_DISPLAY_RESET (11) // Output
#define PIN_PIEZO (37)
#define PIN_POWER_HOLD \
(15) // FIXME, see warning hre https://github.com/BigCorvus/SX1262-LoRa-BLE-Relay/blob/master/LORA_RELAY_NRF52840.ino
static const uint8_t AREF = PIN_AREF;
/*
@geeksville
TODO FIXME
flash bootloader as if feather
power hold ST7735
look at example sketch
*/
/*
* Serial interfaces
*/