mirror of
https://github.com/meshtastic/firmware.git
synced 2026-01-27 04:02:05 +00:00
Merge branch 'portexpander-keyboard' of https://github.com/meshtastic/firmware into portexpander-keyboard
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
[env:pca10059_diy_eink]
|
||||
board_level = extra
|
||||
extends = nrf52840_base
|
||||
board = nordic_pca10059
|
||||
build_flags = ${nrf52840_base.build_flags} -Ivariants/Dongle_nRF52840-pca10059-v1 -D NORDIC_PCA10059
|
||||
|
||||
@@ -101,7 +101,7 @@
|
||||
|
||||
// Status
|
||||
#define LED_PIN 1
|
||||
#define LED_INVERTED 0
|
||||
#define LED_STATE_ON 1 // State when LED is lit
|
||||
// External notification
|
||||
// FIXME: Check if EXT_NOTIFY_OUT actualy has any effect and removes the need for setting the external notication pin in the
|
||||
// app/preferences
|
||||
|
||||
15
variants/ME25LS01-4Y10TD/platformio.ini
Normal file
15
variants/ME25LS01-4Y10TD/platformio.ini
Normal file
@@ -0,0 +1,15 @@
|
||||
[env:ME25LS01-4Y10TD]
|
||||
extends = nrf52840_base
|
||||
board = me25ls01-4y10td
|
||||
board_level = extra
|
||||
; platform = https://github.com/maxgerhardt/platform-nordicnrf52#cac6fcf943a41accd2aeb4f3659ae297a73f422e
|
||||
build_flags = ${nrf52840_base.build_flags} -Ivariants/ME25LS01-4Y10TD -Isrc/platform/nrf52/softdevice -Isrc/platform/nrf52/softdevice/nrf52 -DME25LS01_4Y10TD
|
||||
-L "${platformio.libdeps_dir}/${this.__env__}/bsec2/src/cortex-m4/fpv4-sp-d16-hard"
|
||||
-DGPS_POWER_TOGGLE ; comment this line to disable triple press function on the user button to turn off gps entirely.
|
||||
board_build.ldscript = src/platform/nrf52/nrf52840_s140_v7.ld
|
||||
build_src_filter = ${nrf52_base.build_src_filter} +<../variants/ME25LS01-4Y10TD>
|
||||
lib_deps =
|
||||
${nrf52840_base.lib_deps}
|
||||
; If not set we will default to uploading over serial (first it forces bootloader entry by talking 1200bps to cdcacm)
|
||||
upload_protocol = nrfutil
|
||||
upload_port = /dev/ttyACM1
|
||||
15
variants/ME25LS01-4Y10TD/rfswitch.h
Normal file
15
variants/ME25LS01-4Y10TD/rfswitch.h
Normal file
@@ -0,0 +1,15 @@
|
||||
#include "RadioLib.h"
|
||||
#include "nrf.h"
|
||||
|
||||
// set RF switch configuration for Wio WM1110
|
||||
// Wio WM1110 uses DIO5 and DIO6 for RF switching
|
||||
|
||||
static const uint32_t rfswitch_dio_pins[] = {RADIOLIB_LR11X0_DIO5, RADIOLIB_LR11X0_DIO6, RADIOLIB_NC, RADIOLIB_NC, RADIOLIB_NC};
|
||||
|
||||
static const Module::RfSwitchMode_t rfswitch_table[] = {
|
||||
// mode DIO5 DIO6
|
||||
{LR11x0::MODE_STBY, {LOW, LOW}}, {LR11x0::MODE_RX, {HIGH, LOW}},
|
||||
{LR11x0::MODE_TX, {HIGH, HIGH}}, {LR11x0::MODE_TX_HP, {LOW, HIGH}},
|
||||
{LR11x0::MODE_TX_HF, {LOW, LOW}}, {LR11x0::MODE_GNSS, {LOW, LOW}},
|
||||
{LR11x0::MODE_WIFI, {LOW, LOW}}, END_OF_MODE_TABLE,
|
||||
};
|
||||
@@ -28,14 +28,13 @@ const uint32_t g_ADigitalPinMap[] = {
|
||||
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
|
||||
|
||||
// P1
|
||||
32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45};
|
||||
32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47};
|
||||
|
||||
void initVariant()
|
||||
{
|
||||
// LED1 & LED2
|
||||
pinMode(PIN_LED1, OUTPUT);
|
||||
ledOff(PIN_LED1);
|
||||
pinMode(LED_PIN, OUTPUT);
|
||||
digitalWrite(LED_PIN, LOW);
|
||||
|
||||
pinMode(PIN_LED2, OUTPUT);
|
||||
ledOff(PIN_LED2);
|
||||
}
|
||||
pinMode(PIN_3V3_EN, OUTPUT);
|
||||
digitalWrite(PIN_3V3_EN, HIGH);
|
||||
}
|
||||
138
variants/ME25LS01-4Y10TD/variant.h
Normal file
138
variants/ME25LS01-4Y10TD/variant.h
Normal file
@@ -0,0 +1,138 @@
|
||||
/*
|
||||
Copyright (c) 2014-2015 Arduino LLC. All right reserved.
|
||||
Copyright (c) 2016 Sandeep Mistry All right reserved.
|
||||
Copyright (c) 2018, Adafruit Industries (adafruit.com)
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
See the GNU Lesser General Public License for more details.
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#ifndef _VARIANT_ME25LS01_4Y10TD_
|
||||
#define _VARIANT_ME25LS01_4Y10TD_
|
||||
|
||||
#define ME25LS01
|
||||
|
||||
/** Master clock frequency */
|
||||
#define VARIANT_MCK (64000000ul)
|
||||
|
||||
#define USE_LFXO // Board uses 32khz crystal for LF
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* Headers
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
||||
#include "WVariant.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif // __cplusplus
|
||||
|
||||
// Number of pins defined in PinDescription array
|
||||
#define PINS_COUNT (48)
|
||||
#define NUM_DIGITAL_PINS (48)
|
||||
#define NUM_ANALOG_INPUTS (6)
|
||||
#define NUM_ANALOG_OUTPUTS (0)
|
||||
|
||||
// Use the native nrf52 usb power detection
|
||||
#define NRF_APM
|
||||
|
||||
#define PIN_3V3_EN (32 + 5) //-1
|
||||
#define PIN_3V3_ACC_EN -1
|
||||
|
||||
#define PIN_LED1 (32 + 7) // P1.07 Blue D2
|
||||
|
||||
#define LED_PIN PIN_LED1
|
||||
#define LED_BUILTIN -1
|
||||
|
||||
#define LED_BLUE -1
|
||||
#define LED_STATE_ON 1 // State when LED is lit
|
||||
|
||||
#define BUTTON_PIN (0 + 27) // P0.27 K3
|
||||
#define BUTTON_NEED_PULLUP
|
||||
|
||||
#define HAS_WIRE 1
|
||||
|
||||
#define WIRE_INTERFACES_COUNT 1
|
||||
|
||||
#define PIN_WIRE_SDA (0 + 15) // P0.15
|
||||
#define PIN_WIRE_SCL (0 + 17) // P0.17
|
||||
|
||||
/*
|
||||
* Serial interfaces
|
||||
*/
|
||||
#define PIN_SERIAL1_RX (0 + 14) // P0.14
|
||||
#define PIN_SERIAL1_TX (0 + 13) // P0.13
|
||||
|
||||
#define PIN_SERIAL2_RX (0 + 17) // P0.17
|
||||
#define PIN_SERIAL2_TX (0 + 16) // P0.16
|
||||
|
||||
#define SPI_INTERFACES_COUNT 1
|
||||
|
||||
#define PIN_SPI_MISO (0 + 29) // P0.20 // MISO
|
||||
#define PIN_SPI_MOSI (0 + 2) // P0.02 // MOSI
|
||||
#define PIN_SPI_SCK (32 + 15) // P1.15 // SCK
|
||||
#define PIN_SPI_NSS (32 + 13) // P1.13 // NSS
|
||||
|
||||
#define LORA_RESET (32 + 11) // P1.11 // RST
|
||||
#define LORA_DIO1 (32 + 12) // P1.12 // IRQ
|
||||
#define LORA_DIO2 (32 + 10) // P1.10 // BUSY
|
||||
#define LORA_SCK PIN_SPI_SCK
|
||||
#define LORA_MISO PIN_SPI_MISO
|
||||
#define LORA_MOSI PIN_SPI_MOSI
|
||||
#define LORA_CS PIN_SPI_NSS
|
||||
|
||||
// supported modules list
|
||||
#define USE_LR1110
|
||||
|
||||
#define LR1110_IRQ_PIN LORA_DIO1
|
||||
#define LR1110_NRESET_PIN LORA_RESET
|
||||
#define LR1110_BUSY_PIN LORA_DIO2
|
||||
#define LR1110_SPI_NSS_PIN LORA_CS
|
||||
#define LR1110_SPI_SCK_PIN LORA_SCK
|
||||
#define LR1110_SPI_MOSI_PIN LORA_MOSI
|
||||
#define LR1110_SPI_MISO_PIN LORA_MISO
|
||||
|
||||
#define LR11X0_DIO3_TCXO_VOLTAGE 1.6
|
||||
#define LR11X0_DIO_AS_RF_SWITCH
|
||||
|
||||
#define HAS_GPS 0
|
||||
|
||||
#define PIN_GPS_EN -1
|
||||
#define GPS_EN_ACTIVE HIGH
|
||||
#define PIN_GPS_RESET -1
|
||||
#define GPS_VRTC_EN -1
|
||||
#define GPS_SLEEP_INT -1
|
||||
#define GPS_RTC_INT -1
|
||||
#define GPS_RESETB_OUT -1
|
||||
|
||||
#define BATTERY_PIN -1
|
||||
#define ADC_MULTIPLIER (2.0F)
|
||||
|
||||
#define ADC_RESOLUTION 14
|
||||
#define BATTERY_SENSE_RESOLUTION_BITS 12
|
||||
|
||||
#undef AREF_VOLTAGE
|
||||
#define AREF_VOLTAGE 3.0
|
||||
#define VBAT_AR_INTERNAL AR_INTERNAL_3_0
|
||||
|
||||
// Buzzer
|
||||
#define PIN_BUZZER (0 + 25)
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* Arduino objects - C++ only
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
||||
#endif // _VARIANT_ME25LS01_4Y10TD_
|
||||
19
variants/ME25LS01-4Y10TD_e-ink/platformio.ini
Normal file
19
variants/ME25LS01-4Y10TD_e-ink/platformio.ini
Normal file
@@ -0,0 +1,19 @@
|
||||
[env:ME25LS01-4Y10TD_e-ink]
|
||||
extends = nrf52840_base
|
||||
board = me25ls01-4y10td
|
||||
board_level = extra
|
||||
; platform = https://github.com/maxgerhardt/platform-nordicnrf52#cac6fcf943a41accd2aeb4f3659ae297a73f422e
|
||||
build_flags = ${nrf52840_base.build_flags} -Ivariants/ME25LS01-4Y10TD_e-ink -Isrc/platform/nrf52/softdevice -Isrc/platform/nrf52/softdevice/nrf52 -DME25LS01_4Y10TD
|
||||
-L "${platformio.libdeps_dir}/${this.__env__}/bsec2/src/cortex-m4/fpv4-sp-d16-hard"
|
||||
-DGPS_POWER_TOGGLE ; comment this line to disable triple press function on the user button to turn off gps entirely.
|
||||
-DEINK_DISPLAY_MODEL=GxEPD2_420_GDEY042T81
|
||||
-DEINK_WIDTH=400
|
||||
-DEINK_HEIGHT=300
|
||||
board_build.ldscript = src/platform/nrf52/nrf52840_s140_v7.ld
|
||||
build_src_filter = ${nrf52_base.build_src_filter} +<../variants/ME25LS01-4Y10TD_e-ink>
|
||||
lib_deps =
|
||||
${nrf52840_base.lib_deps}
|
||||
zinggjm/GxEPD2@^1.5.8
|
||||
; If not set we will default to uploading over serial (first it forces bootloader entry by talking 1200bps to cdcacm)
|
||||
upload_protocol = nrfutil
|
||||
upload_port = /dev/ttyACM1
|
||||
15
variants/ME25LS01-4Y10TD_e-ink/rfswitch.h
Normal file
15
variants/ME25LS01-4Y10TD_e-ink/rfswitch.h
Normal file
@@ -0,0 +1,15 @@
|
||||
#include "RadioLib.h"
|
||||
#include "nrf.h"
|
||||
|
||||
// set RF switch configuration for Wio WM1110
|
||||
// Wio WM1110 uses DIO5 and DIO6 for RF switching
|
||||
|
||||
static const uint32_t rfswitch_dio_pins[] = {RADIOLIB_LR11X0_DIO5, RADIOLIB_LR11X0_DIO6, RADIOLIB_NC, RADIOLIB_NC, RADIOLIB_NC};
|
||||
|
||||
static const Module::RfSwitchMode_t rfswitch_table[] = {
|
||||
// mode DIO5 DIO6
|
||||
{LR11x0::MODE_STBY, {LOW, LOW}}, {LR11x0::MODE_RX, {HIGH, LOW}},
|
||||
{LR11x0::MODE_TX, {HIGH, HIGH}}, {LR11x0::MODE_TX_HP, {LOW, HIGH}},
|
||||
{LR11x0::MODE_TX_HF, {LOW, LOW}}, {LR11x0::MODE_GNSS, {LOW, LOW}},
|
||||
{LR11x0::MODE_WIFI, {LOW, LOW}}, END_OF_MODE_TABLE,
|
||||
};
|
||||
@@ -24,29 +24,17 @@
|
||||
#include "wiring_digital.h"
|
||||
|
||||
const uint32_t g_ADigitalPinMap[] = {
|
||||
25, // D0 SPI_MISO
|
||||
24, // D1 SPI_NSS
|
||||
23, // D2 SPI_SCK
|
||||
4, // D3 VBAT
|
||||
11, // D4 DIO1
|
||||
27, // D5 BUSY
|
||||
19, // D6 NRESET
|
||||
12, // D7 BUTTON2
|
||||
22, // D8 BUTTON3
|
||||
26, // D9 SPI_MOSI
|
||||
31, // D10 UART_RX
|
||||
2, // D11 UART_TX
|
||||
10, // D12 LED1 GREEN
|
||||
17, // D13 LED2 RED
|
||||
9, // D14 BUZZER
|
||||
7, // D15 BUTTON1
|
||||
};
|
||||
// P0
|
||||
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
|
||||
|
||||
// P1
|
||||
32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47};
|
||||
|
||||
#include <initializer_list>
|
||||
void initVariant()
|
||||
{
|
||||
for (int i : {PIN_LED1, PIN_LED2}) {
|
||||
pinMode(i, OUTPUT);
|
||||
ledOff(i);
|
||||
}
|
||||
}
|
||||
pinMode(LED_PIN, OUTPUT);
|
||||
digitalWrite(LED_PIN, LOW);
|
||||
|
||||
pinMode(PIN_3V3_EN, OUTPUT);
|
||||
digitalWrite(PIN_3V3_EN, HIGH);
|
||||
}
|
||||
161
variants/ME25LS01-4Y10TD_e-ink/variant.h
Normal file
161
variants/ME25LS01-4Y10TD_e-ink/variant.h
Normal file
@@ -0,0 +1,161 @@
|
||||
/*
|
||||
Copyright (c) 2014-2015 Arduino LLC. All right reserved.
|
||||
Copyright (c) 2016 Sandeep Mistry All right reserved.
|
||||
Copyright (c) 2018, Adafruit Industries (adafruit.com)
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
See the GNU Lesser General Public License for more details.
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#ifndef _VARIANT_ME25LS01_4Y10TD_
|
||||
#define _VARIANT_ME25LS01_4Y10TD_
|
||||
|
||||
#define ME25LS01
|
||||
|
||||
/** Master clock frequency */
|
||||
#define VARIANT_MCK (64000000ul)
|
||||
|
||||
#define USE_LFXO // Board uses 32khz crystal for LF
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* Headers
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
||||
#include "WVariant.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif // __cplusplus
|
||||
|
||||
// Number of pins defined in PinDescription array
|
||||
#define PINS_COUNT (48)
|
||||
#define NUM_DIGITAL_PINS (48)
|
||||
#define NUM_ANALOG_INPUTS (6)
|
||||
#define NUM_ANALOG_OUTPUTS (0)
|
||||
|
||||
// Use the native nrf52 usb power detection
|
||||
#define NRF_APM
|
||||
|
||||
#define PIN_3V3_EN (32 + 5) //-1
|
||||
#define PIN_3V3_ACC_EN -1
|
||||
|
||||
#define PIN_LED1 (32 + 7) // P1.07 Blue D2
|
||||
|
||||
#define LED_PIN PIN_LED1
|
||||
#define LED_BUILTIN -1
|
||||
|
||||
#define LED_BLUE -1
|
||||
#define LED_STATE_ON 1 // State when LED is lit
|
||||
|
||||
#define BUTTON_PIN (0 + 27) // P0.27 K3
|
||||
#define BUTTON_NEED_PULLUP
|
||||
|
||||
#define HAS_WIRE 1
|
||||
|
||||
#define WIRE_INTERFACES_COUNT 1
|
||||
|
||||
#define PIN_WIRE_SDA (0 + 15) // P0.15
|
||||
#define PIN_WIRE_SCL (0 + 17) // P0.17
|
||||
|
||||
/*
|
||||
* Serial interfaces
|
||||
*/
|
||||
#define PIN_SERIAL1_RX (0 + 14) // P0.14
|
||||
#define PIN_SERIAL1_TX (0 + 13) // P0.13
|
||||
|
||||
#define PIN_SERIAL2_RX (0 + 17) // P0.17
|
||||
#define PIN_SERIAL2_TX (0 + 16) // P0.16
|
||||
|
||||
#define SPI_INTERFACES_COUNT 2
|
||||
|
||||
// LoRa SPI
|
||||
#define PIN_SPI_MISO (0 + 29) // P0.20 // MISO
|
||||
#define PIN_SPI_MOSI (0 + 2) // P0.02 // MOSI
|
||||
#define PIN_SPI_SCK (32 + 15) // P1.15 // SCK
|
||||
#define PIN_SPI_NSS (32 + 13) // P1.13 // NSS
|
||||
|
||||
#define LORA_RESET (32 + 11) // P1.11 // RST
|
||||
#define LORA_DIO1 (32 + 12) // P1.12 // IRQ
|
||||
#define LORA_DIO2 (32 + 10) // P1.10 // BUSY
|
||||
#define LORA_SCK PIN_SPI_SCK
|
||||
#define LORA_MISO PIN_SPI_MISO
|
||||
#define LORA_MOSI PIN_SPI_MOSI
|
||||
#define LORA_CS PIN_SPI_NSS
|
||||
|
||||
static const uint8_t SS = (32 + 13); // P1.13 // NSS
|
||||
static const uint8_t MOSI = PIN_SPI_MOSI;
|
||||
static const uint8_t MISO = PIN_SPI_MISO;
|
||||
static const uint8_t SCK = PIN_SPI_SCK;
|
||||
|
||||
// EPD SPI
|
||||
#define PIN_SPI1_MISO (32 + 2) // Not Used for EPD but needs to be defined
|
||||
#define PIN_SPI1_MOSI (0 + 10) // EPD_MOSI P0.10
|
||||
#define PIN_SPI1_SCK (0 + 9) // EPD_SCLK P0.09
|
||||
|
||||
/*
|
||||
* eink display pins
|
||||
*/
|
||||
|
||||
#define USE_EINK
|
||||
#define PIN_EINK_CS (32 + 0) // EPD_CS
|
||||
#define PIN_EINK_BUSY (0 + 19) // EPD_BUSY
|
||||
#define PIN_EINK_DC (0 + 24) // EPD_D/C
|
||||
#define PIN_EINK_RES (0 + 23) // EPD_RESET
|
||||
#define PIN_EINK_SCLK PIN_SPI1_SCK
|
||||
#define PIN_EINK_MOSI PIN_SPI1_MOSI
|
||||
|
||||
// supported modules list
|
||||
#define USE_LR1110
|
||||
|
||||
#define LR1110_IRQ_PIN LORA_DIO1
|
||||
#define LR1110_NRESET_PIN LORA_RESET
|
||||
#define LR1110_BUSY_PIN LORA_DIO2
|
||||
#define LR1110_SPI_NSS_PIN LORA_CS
|
||||
#define LR1110_SPI_SCK_PIN LORA_SCK
|
||||
#define LR1110_SPI_MOSI_PIN LORA_MOSI
|
||||
#define LR1110_SPI_MISO_PIN LORA_MISO
|
||||
|
||||
#define LR11X0_DIO3_TCXO_VOLTAGE 1.6
|
||||
#define LR11X0_DIO_AS_RF_SWITCH
|
||||
|
||||
#define HAS_GPS 0
|
||||
|
||||
#define PIN_GPS_EN -1
|
||||
#define GPS_EN_ACTIVE HIGH
|
||||
#define PIN_GPS_RESET -1
|
||||
#define GPS_VRTC_EN -1
|
||||
#define GPS_SLEEP_INT -1
|
||||
#define GPS_RTC_INT -1
|
||||
#define GPS_RESETB_OUT -1
|
||||
|
||||
#define BATTERY_PIN -1
|
||||
#define ADC_MULTIPLIER (2.0F)
|
||||
|
||||
#define ADC_RESOLUTION 14
|
||||
#define BATTERY_SENSE_RESOLUTION_BITS 12
|
||||
|
||||
#undef AREF_VOLTAGE
|
||||
#define AREF_VOLTAGE 3.0
|
||||
#define VBAT_AR_INTERNAL AR_INTERNAL_3_0
|
||||
|
||||
// Buzzer
|
||||
#define PIN_BUZZER (0 + 25)
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* Arduino objects - C++ only
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
||||
#endif // _VARIANT_ME25LS01_4Y10TD__
|
||||
15
variants/MS24SF1/platformio.ini
Normal file
15
variants/MS24SF1/platformio.ini
Normal file
@@ -0,0 +1,15 @@
|
||||
[env:ms24sf1]
|
||||
extends = nrf52840_base
|
||||
board = ms24sf1
|
||||
board_level = extra
|
||||
; platform = https://github.com/maxgerhardt/platform-nordicnrf52#cac6fcf943a41accd2aeb4f3659ae297a73f422e
|
||||
build_flags = ${nrf52840_base.build_flags} -Ivariants/MS24SF1 -Isrc/platform/nrf52/softdevice -Isrc/platform/nrf52/softdevice/nrf52
|
||||
-L "${platformio.libdeps_dir}/${this.__env__}/bsec2/src/cortex-m4/fpv4-sp-d16-hard"
|
||||
-DGPS_POWER_TOGGLE ; comment this line to disable triple press function on the user button to turn off gps entirely.
|
||||
board_build.ldscript = src/platform/nrf52/nrf52840_s140_v7.ld
|
||||
build_src_filter = ${nrf52_base.build_src_filter} +<../variants/MS24SF1>
|
||||
lib_deps =
|
||||
${nrf52840_base.lib_deps}
|
||||
; If not set we will default to uploading over serial (first it forces bootloader entry by talking 1200bps to cdcacm)
|
||||
upload_protocol = nrfutil
|
||||
upload_port = /dev/ttyACM1
|
||||
30
variants/MS24SF1/variant.cpp
Normal file
30
variants/MS24SF1/variant.cpp
Normal file
@@ -0,0 +1,30 @@
|
||||
/*
|
||||
Copyright (c) 2014-2015 Arduino LLC. All right reserved.
|
||||
Copyright (c) 2016 Sandeep Mistry All right reserved.
|
||||
Copyright (c) 2018, Adafruit Industries (adafruit.com)
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
See the GNU Lesser General Public License for more details.
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#include "variant.h"
|
||||
#include "nrf.h"
|
||||
#include "wiring_constants.h"
|
||||
#include "wiring_digital.h"
|
||||
|
||||
const uint32_t g_ADigitalPinMap[] = {
|
||||
// P0
|
||||
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
|
||||
|
||||
// P1
|
||||
32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47};
|
||||
|
||||
void initVariant() {}
|
||||
139
variants/MS24SF1/variant.h
Normal file
139
variants/MS24SF1/variant.h
Normal file
@@ -0,0 +1,139 @@
|
||||
/*
|
||||
Copyright (c) 2014-2015 Arduino LLC. All right reserved.
|
||||
Copyright (c) 2016 Sandeep Mistry All right reserved.
|
||||
Copyright (c) 2018, Adafruit Industries (adafruit.com)
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
See the GNU Lesser General Public License for more details.
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#ifndef _VARIANT_MINEWSEMI_MS24SF1_
|
||||
#define _VARIANT_MINEWSEMI_MS24SF1_
|
||||
|
||||
#define ME25LS01
|
||||
|
||||
/** Master clock frequency */
|
||||
#define VARIANT_MCK (64000000ul)
|
||||
|
||||
#define USE_LFXO // Board uses 32khz crystal for LF
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* Headers
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
||||
#include "WVariant.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif // __cplusplus
|
||||
|
||||
// Number of pins defined in PinDescription array
|
||||
#define PINS_COUNT (48)
|
||||
#define NUM_DIGITAL_PINS (48)
|
||||
#define NUM_ANALOG_INPUTS (6)
|
||||
#define NUM_ANALOG_OUTPUTS (0)
|
||||
|
||||
// Use the native nrf52 usb power detection
|
||||
#define NRF_APM
|
||||
|
||||
#define PIN_3V3_EN (32 + 5) //-1
|
||||
#define PIN_3V3_ACC_EN -1
|
||||
|
||||
#define PIN_LED1 (-1)
|
||||
|
||||
#define LED_PIN PIN_LED1
|
||||
#define LED_BUILTIN -1
|
||||
|
||||
#define LED_BLUE -1
|
||||
#define LED_STATE_ON 1 // State when LED is lit
|
||||
|
||||
#define BUTTON_PIN (-1)
|
||||
#define BUTTON_NEED_PULLUP
|
||||
|
||||
#define HAS_WIRE 1
|
||||
|
||||
#define WIRE_INTERFACES_COUNT 1
|
||||
|
||||
#define PIN_WIRE_SDA (0 + 29) // P0.15
|
||||
#define PIN_WIRE_SCL (0 + 30) // P0.17
|
||||
|
||||
/*
|
||||
* Serial interfaces
|
||||
*/
|
||||
#define PIN_SERIAL1_RX (-1) // P0.14
|
||||
#define PIN_SERIAL1_TX (-1) // P0.13
|
||||
|
||||
#define PIN_SERIAL2_RX (-1) // P0.17
|
||||
#define PIN_SERIAL2_TX (-1) // P0.16
|
||||
|
||||
/*
|
||||
* SPI Interfaces
|
||||
*/
|
||||
#define SPI_INTERFACES_COUNT 1 // 2
|
||||
|
||||
#define PIN_SPI_MISO (0 + 17) // MISO P0.17
|
||||
#define PIN_SPI_MOSI (0 + 20) // MOSI P0.20
|
||||
#define PIN_SPI_SCK (0 + 21) // SCK P0.21
|
||||
|
||||
// #define PIN_SPI1_MISO (-1) //
|
||||
// #define PIN_SPI1_MOSI (10) // EPD_MOSI P0.10
|
||||
// #define PIN_SPI1_SCK (9) // EPD_SCLK P0.09
|
||||
|
||||
static const uint8_t SS = (0 + 22); // LORA_CS P0.22
|
||||
static const uint8_t MOSI = PIN_SPI_MOSI;
|
||||
static const uint8_t MISO = PIN_SPI_MISO;
|
||||
static const uint8_t SCK = PIN_SPI_SCK;
|
||||
|
||||
// MINEWSEMI nRF52840+SX1262 MS24SF1 (NRF82540 with integrated SX1262)
|
||||
#define USE_SX1262
|
||||
#define SX126X_CS (0 + 22) // LORA_CS P0.22
|
||||
#define SX126X_DIO1 (0 + 16) // DIO1 P0.16
|
||||
#define SX126X_BUSY (0 + 19) // LORA_BUSY P0.19
|
||||
#define SX126X_RESET (0 + 12) // LORA_RESET P0.12
|
||||
#define SX126X_TXEN (32 + 4) // TXEN P1.04
|
||||
#define SX126X_RXEN (32 + 2) // RXEN P1.02
|
||||
|
||||
// DIO2 controlls an antenna switch and the TCXO voltage is controlled by DIO3
|
||||
#define SX126X_DIO2_AS_RF_SWITCH
|
||||
|
||||
#define HAS_GPS 0
|
||||
|
||||
#define PIN_GPS_EN -1
|
||||
#define GPS_EN_ACTIVE HIGH
|
||||
#define PIN_GPS_RESET -1
|
||||
#define GPS_VRTC_EN -1
|
||||
#define GPS_SLEEP_INT -1
|
||||
#define GPS_RTC_INT -1
|
||||
#define GPS_RESETB_OUT -1
|
||||
|
||||
#define BATTERY_PIN -1
|
||||
#define ADC_MULTIPLIER (2.0F)
|
||||
|
||||
#define ADC_RESOLUTION 14
|
||||
#define BATTERY_SENSE_RESOLUTION_BITS 12
|
||||
|
||||
#undef AREF_VOLTAGE
|
||||
#define AREF_VOLTAGE 3.0
|
||||
#define VBAT_AR_INTERNAL AR_INTERNAL_3_0
|
||||
|
||||
// Buzzer
|
||||
// #define PIN_BUZZER (0 + 25)
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* Arduino objects - C++ only
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
||||
#endif // _VARIANT_MINEWSEMI_MS24SF1_
|
||||
@@ -25,8 +25,6 @@ extern "C" {
|
||||
#define NUM_ANALOG_INPUTS (6)
|
||||
#define NUM_ANALOG_OUTPUTS (0)
|
||||
|
||||
#define RADIOLIB_GODMODE
|
||||
|
||||
// LEDs
|
||||
#define PIN_LED1 (32 + 10) // LED P1.15
|
||||
#define PIN_LED2 (-1) //
|
||||
|
||||
@@ -25,8 +25,6 @@ extern "C" {
|
||||
#define NUM_ANALOG_INPUTS (6)
|
||||
#define NUM_ANALOG_OUTPUTS (0)
|
||||
|
||||
#define RADIOLIB_GODMODE
|
||||
|
||||
// LEDs
|
||||
#define PIN_LED1 (32 + 10) // LED P1.15
|
||||
#define PIN_LED2 (-1) //
|
||||
|
||||
@@ -56,7 +56,6 @@ extern "C" {
|
||||
#define LED_CONN PIN_LED3
|
||||
|
||||
#define LED_STATE_ON 0 // State when LED is lit
|
||||
#define LED_INVERTED 1
|
||||
|
||||
/*
|
||||
* Buttons
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
// Buzzer
|
||||
#define PIN_BUZZER 19
|
||||
// Buttons
|
||||
#define BUTTON_PIN 36 // Use the WAKE button as the user button
|
||||
// #define BUTTON_PIN 36 // Use the WAKE button as the user button
|
||||
// I2C
|
||||
// #define I2C_SCL 27
|
||||
// #define I2C_SDA 26
|
||||
@@ -54,7 +54,7 @@
|
||||
#define ST7735_RESET 15
|
||||
#define ST7735_MISO -1
|
||||
#define ST7735_BUSY -1
|
||||
#define ST7735_BL 32
|
||||
#define TFT_BL 32
|
||||
#define ST7735_SPI_HOST HSPI_HOST // SPI2_HOST for S3, auto may work too
|
||||
#define SPI_FREQUENCY 40000000
|
||||
#define SPI_READ_FREQUENCY 16000000
|
||||
@@ -66,6 +66,7 @@
|
||||
#define SCREEN_ROTATE
|
||||
#define SCREEN_TRANSITION_FRAMERATE 5 // fps
|
||||
#define DISPLAY_FORCE_SMALL_FONTS
|
||||
#define TFT_BACKLIGHT_ON LOW
|
||||
|
||||
// Battery
|
||||
|
||||
@@ -91,6 +92,13 @@
|
||||
#define GPS_TX_PIN 13
|
||||
#define GPS_RX_PIN 2
|
||||
|
||||
// keyboard
|
||||
#define INPUTBROKER_SERIAL_TYPE 1
|
||||
#define KB_LOAD 21 // load values from the switch and store in shift register
|
||||
#define KB_CLK 22 // clock pin for serial data out
|
||||
#define KB_DATA 23 // data pin
|
||||
#define CANNED_MESSAGE_MODULE_ENABLE 1
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
// //
|
||||
// You should have no need to modify the code below, nor in pins_arduino.h //
|
||||
@@ -114,4 +122,4 @@
|
||||
// cannot serve any extra function even if requested to LORA_DIO3 value is never used in src (as we are not using RF95), so no
|
||||
// need to define, and DIO3_AS_TCXO_AT_1V8 is set so it cannot serve any extra function even if requested to (from 13.3.2.1
|
||||
// DioxMask in SX1262 datasheet: Note that if DIO2 or DIO3 are used to control the RF Switch or the TCXO, the IRQ will not be
|
||||
// generated even if it is mapped to the pins.)
|
||||
// generated even if it is mapped to the pins.)
|
||||
|
||||
@@ -28,4 +28,11 @@ const uint32_t g_ADigitalPinMap[] = {
|
||||
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
|
||||
|
||||
// P1
|
||||
32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47};
|
||||
32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47};
|
||||
|
||||
void initVariant()
|
||||
{
|
||||
// 3V3 Power Rail
|
||||
pinMode(PIN_3V3_EN, OUTPUT);
|
||||
digitalWrite(PIN_3V3_EN, HIGH);
|
||||
}
|
||||
|
||||
@@ -22,26 +22,26 @@ extern "C" {
|
||||
/*
|
||||
NRF52 PRO MICRO PIN ASSIGNMENT
|
||||
|
||||
| Pin | Function | | Pin | Function |
|
||||
|-------|------------|---|---------|-------------|
|
||||
| Gnd | | | vbat | |
|
||||
| P0.06 | Serial2 RX | | vbat | |
|
||||
| P0.08 | Serial2 TX | | Gnd | |
|
||||
| Gnd | | | reset | |
|
||||
| Gnd | | | ext_vcc | *see 0.13 |
|
||||
| P0.17 | RXEN | | P0.31 | BATTERY_PIN |
|
||||
| P0.20 | GPS_RX | | P0.29 | BUSY |
|
||||
| P0.22 | GPS_TX | | P0.02 | MISO |
|
||||
| P0.24 | GPS_EN | | P1.15 | MOSI |
|
||||
| P1.00 | BUTTON_PIN | | P1.13 | CS |
|
||||
| P0.11 | SCL | | P1.11 | SCK |
|
||||
| P1.04 | SDA | | P0.10 | DIO1/IRQ |
|
||||
| P1.06 | Free pin | | P0.09 | RESET |
|
||||
| | | | | |
|
||||
| | Mid board | | | Internal |
|
||||
| P1.01 | Free pin | | 0.15 | LED |
|
||||
| P1.02 | Free pin | | 0.13 | 3V3_EN |
|
||||
| P1.07 | Free pin | | | |
|
||||
| Pin | Function | | Pin | Function | RF95 |
|
||||
| ----- | ----------- | --- | -------- | ------------ | ----- |
|
||||
| Gnd | | | vbat | | |
|
||||
| P0.06 | Serial2 RX | | vbat | | |
|
||||
| P0.08 | Serial2 TX | | Gnd | | |
|
||||
| Gnd | | | reset | | |
|
||||
| Gnd | | | ext_vcc | *see 0.13 | |
|
||||
| P0.17 | RXEN | | P0.31 | BATTERY_PIN | |
|
||||
| P0.20 | GPS_RX | | P0.29 | BUSY | DIO0 |
|
||||
| P0.22 | GPS_TX | | P0.02 | MISO | MISO |
|
||||
| P0.24 | GPS_EN | | P1.15 | MOSI | MOSI |
|
||||
| P1.00 | BUTTON_PIN | | P1.13 | CS | CS |
|
||||
| P0.11 | SCL | | P1.11 | SCK | SCK |
|
||||
| P1.04 | SDA | | P0.10 | DIO1/IRQ | DIO1 |
|
||||
| P1.06 | Free pin | | P0.09 | RESET | RST |
|
||||
| | | | | | |
|
||||
| | Mid board | | | Internal | |
|
||||
| P1.01 | Free pin | | 0.15 | LED | |
|
||||
| P1.02 | Free pin | | 0.13 | 3V3_EN | |
|
||||
| P1.07 | Free pin | | | | |
|
||||
*/
|
||||
|
||||
// Number of pins defined in PinDescription array
|
||||
@@ -112,11 +112,28 @@ NRF52 PRO MICRO PIN ASSIGNMENT
|
||||
#define PIN_SPI_MOSI (32 + 15) // P1.15
|
||||
#define PIN_SPI_SCK (32 + 11) // P1.11
|
||||
|
||||
#define LORA_MISO PIN_SPI_MISO
|
||||
#define LORA_MOSI PIN_SPI_MOSI
|
||||
#define LORA_SCK PIN_SPI_SCK
|
||||
#define LORA_CS (32 + 13) // P1.13
|
||||
|
||||
// LORA MODULES
|
||||
#define USE_LLCC68
|
||||
#define USE_SX1262
|
||||
#define USE_RF95
|
||||
#define USE_SX1268
|
||||
|
||||
// LORA CONFIG
|
||||
// RF95 CONFIG
|
||||
|
||||
#define LORA_DIO0 (0 + 29) // P0.10 IRQ
|
||||
#define LORA_DIO1 (0 + 10) // P0.10 IRQ
|
||||
#define LORA_RESET (0 + 9) // P0.09
|
||||
|
||||
// RX/TX for RFM95/SX127x
|
||||
#define RF95_RXEN (0 + 17) // P0.17
|
||||
#define RF95_TXEN RADIOLIB_NC // Assuming that DIO2 is connected to TXEN pin. If not, TXEN must be connected.
|
||||
|
||||
// SX126X CONFIG
|
||||
#define SX126X_CS (32 + 13) // P1.13 FIXME - we really should define LORA_CS instead
|
||||
#define SX126X_DIO1 (0 + 10) // P0.10 IRQ
|
||||
#define SX126X_DIO2_AS_RF_SWITCH // Note for E22 modules: DIO2 is not attached internally to TXEN for automatic TX/RX switching,
|
||||
@@ -126,22 +143,33 @@ NRF52 PRO MICRO PIN ASSIGNMENT
|
||||
#define SX126X_RXEN (0 + 17) // P0.17
|
||||
#define SX126X_TXEN RADIOLIB_NC // Assuming that DIO2 is connected to TXEN pin. If not, TXEN must be connected.
|
||||
|
||||
// #define SX126X_MAX_POWER 8 set this if using a high-power board!
|
||||
|
||||
/*
|
||||
On the SX1262, DIO3 sets the voltage for an external TCXO, if one is present. If one is not present, then this should not be used.
|
||||
On the SX1262, DIO3 sets the voltage for an external TCXO, if one is present. If one is not present, use TCXO_OPTIONAL to try both
|
||||
settings.
|
||||
|
||||
Ebyte
|
||||
e22-900mm22s has no TCXO
|
||||
e22-900m22s has TCXO
|
||||
e220-900mm22s has no TCXO, works with/without this definition, looks like DIO3 not connected at all
|
||||
|
||||
AI-thinker
|
||||
RA-01SH does not have TCXO
|
||||
|
||||
Waveshare
|
||||
Core1262 has TCXO
|
||||
| Mfr | Module | TCXO | RF Switch | Notes |
|
||||
| ------------ | ---------------- | ---- | --------- | ------------------------------------- |
|
||||
| Ebyte | E22-900M22S | Yes | Ext | |
|
||||
| Ebyte | E22-900MM22S | No | Ext | |
|
||||
| Ebyte | E22-900M30S | Yes | Ext | |
|
||||
| Ebyte | E22-900M33S | Yes | Ext | MAX_POWER must be set to 8 for this |
|
||||
| Ebyte | E220-900M22S | No | Ext | LLCC68, looks like DIO3 not connected |
|
||||
| AI-Thinker | RA-01SH | No | Int | SX1262 |
|
||||
| Heltec | HT-RA62 | Yes | Int | |
|
||||
| NiceRF | Lora1262 | yes | Int | |
|
||||
| Waveshare | Core1262-HF | yes | Ext | |
|
||||
| Waveshare | LoRa Node Module | yes | Int | |
|
||||
| Seeed | Wio-SX1262 | yes | Int | Sooooo cute! |
|
||||
| AI-Thinker | RA-02 | No | Int | SX1278 **433mhz band only** |
|
||||
| RF Solutions | RFM95 | No | Int | Untested |
|
||||
|
||||
*/
|
||||
|
||||
#define SX126X_DIO3_TCXO_VOLTAGE 1.8
|
||||
#define TCXO_OPTIONAL // make it so that the firmware can try both TCXO and XTAL
|
||||
extern float tcxoVoltage; // make this available everywhere
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
@@ -151,4 +179,4 @@ Core1262 has TCXO
|
||||
* Arduino objects - C++ only
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -28,4 +28,11 @@ const uint32_t g_ADigitalPinMap[] = {
|
||||
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
|
||||
|
||||
// P1
|
||||
32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47};
|
||||
32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47};
|
||||
|
||||
void initVariant()
|
||||
{
|
||||
// 3V3 Power Rail
|
||||
pinMode(PIN_3V3_EN, OUTPUT);
|
||||
digitalWrite(PIN_3V3_EN, HIGH);
|
||||
}
|
||||
|
||||
@@ -114,6 +114,8 @@ NRF52 PRO MICRO PIN ASSIGNMENT
|
||||
// LORA MODULES
|
||||
#define USE_LLCC68
|
||||
#define USE_SX1262
|
||||
// #define USE_RF95
|
||||
#define USE_SX1268
|
||||
|
||||
// LORA CONFIG
|
||||
#define SX126X_CS (32 + 13) // P1.13 FIXME - we really should define LORA_CS instead
|
||||
|
||||
@@ -7,7 +7,6 @@ build_flags =
|
||||
${esp32_base.build_flags}
|
||||
-D DIY_V1
|
||||
-D EBYTE_E22
|
||||
-D OLED_RU
|
||||
-I variants/diy/v1
|
||||
|
||||
; Meshtastic DIY v1.1 new schematic based on ESP32-WROOM-32 & SX1262/SX1268 modules
|
||||
@@ -19,7 +18,6 @@ build_flags =
|
||||
${esp32_base.build_flags}
|
||||
-D DIY_V1
|
||||
-D EBYTE_E22
|
||||
-D OLED_RU
|
||||
-I variants/diy/v1_1
|
||||
|
||||
; Port to Disaster Radio's ESP32-v3 Dev Board
|
||||
@@ -52,7 +50,6 @@ board_level = extra
|
||||
build_flags = ${nrf52840_base.build_flags}
|
||||
-I variants/diy/nrf52_promicro_diy_xtal
|
||||
-D NRF52_PROMICRO_DIY
|
||||
-D OLED_RU
|
||||
-L "${platformio.libdeps_dir}/${this.__env__}/bsec2/src/cortex-m4/fpv4-sp-d16-hard"
|
||||
build_src_filter = ${nrf52_base.build_src_filter} +<../variants/diy/nrf52_promicro_diy_xtal>
|
||||
lib_deps =
|
||||
@@ -68,9 +65,26 @@ board_level = extra
|
||||
build_flags = ${nrf52840_base.build_flags}
|
||||
-I variants/diy/nrf52_promicro_diy_tcxo
|
||||
-D NRF52_PROMICRO_DIY
|
||||
-D OLED_RU
|
||||
-L "${platformio.libdeps_dir}/${this.__env__}/bsec2/src/cortex-m4/fpv4-sp-d16-hard"
|
||||
build_src_filter = ${nrf52_base.build_src_filter} +<../variants/diy/nrf52_promicro_diy_tcxo>
|
||||
lib_deps =
|
||||
${nrf52840_base.lib_deps}
|
||||
debug_tool = jlink
|
||||
debug_tool = jlink
|
||||
|
||||
; NanoVHF T-Energy-S3 + E22(0)-xxxM - DIY
|
||||
[env:t-energy-s3_e22]
|
||||
extends = esp32s3_base
|
||||
board = esp32-s3-devkitc-1
|
||||
board_level = extra
|
||||
board_upload.flash_size = 16MB ;Specify the FLASH capacity as 16MB
|
||||
board_build.arduino.memory_type = qio_opi ;Enable internal PSRAM
|
||||
build_unflags =
|
||||
${esp32s3_base.build_unflags}
|
||||
-D ARDUINO_USB_MODE=1
|
||||
build_flags =
|
||||
${esp32s3_base.build_flags}
|
||||
-D EBYTE_ESP32_S3
|
||||
-D BOARD_HAS_PSRAM
|
||||
-D ARDUINO_USB_MODE=0
|
||||
-D ARDUINO_USB_CDC_ON_BOOT=1
|
||||
-I variants/diy/t-energy-s3_e22
|
||||
|
||||
46
variants/diy/t-energy-s3_e22/variant.h
Normal file
46
variants/diy/t-energy-s3_e22/variant.h
Normal file
@@ -0,0 +1,46 @@
|
||||
// NanoVHF T-Energy-S3 + E22(0)-xxxM - DIY
|
||||
// https://github.com/NanoVHF/Meshtastic-DIY/tree/main/PCB/ESP-32-devkit_EBYTE-E22/Mesh-v1.06-TTGO-T18
|
||||
|
||||
// Battery
|
||||
#define BATTERY_PIN 3
|
||||
#define ADC_MULTIPLIER 2.0
|
||||
#define ADC_CHANNEL ADC1_GPIO3_CHANNEL
|
||||
|
||||
// Button on NanoVHF PCB
|
||||
#define BUTTON_PIN 39
|
||||
|
||||
// I2C via connectors on NanoVHF PCB
|
||||
#define I2C_SCL 2
|
||||
#define I2C_SDA 42
|
||||
|
||||
// Screen (disabled)
|
||||
#define HAS_SCREEN 0 // Assume no screen present by default to prevent crash...
|
||||
|
||||
// GPS via T-Energy-S3 onboard connector
|
||||
#define HAS_GPS 1
|
||||
#define GPS_TX_PIN 43
|
||||
#define GPS_RX_PIN 44
|
||||
|
||||
// LoRa
|
||||
#define USE_SX1262 // E22-900M30S, E22-900M22S, and E22-900MM22S (not E220!) use SX1262
|
||||
#define USE_SX1268 // E22-400M30S, E22-400M33S, E22-400M22S, and E22-400MM22S use SX1268
|
||||
|
||||
#define SX126X_MAX_POWER 22 // SX126xInterface.cpp defaults to 22 if not defined, but here we define it for good practice
|
||||
#define SX126X_DIO3_TCXO_VOLTAGE 1.8 // E22 series TCXO reference voltage is 1.8V
|
||||
|
||||
#define SX126X_CS 5 // EBYTE module's NSS pin // FIXME: rename to SX126X_SS
|
||||
#define SX126X_SCK 6 // EBYTE module's SCK pin
|
||||
#define SX126X_MOSI 13 // EBYTE module's MOSI pin
|
||||
#define SX126X_MISO 4 // EBYTE module's MISO pin
|
||||
#define SX126X_RESET 1 // EBYTE module's NRST pin
|
||||
#define SX126X_BUSY 48 // EBYTE module's BUSY pin
|
||||
#define SX126X_DIO1 47 // EBYTE module's DIO1 pin
|
||||
|
||||
#define SX126X_TXEN 10 // Schematic connects EBYTE module's TXEN pin to MCU
|
||||
#define SX126X_RXEN 12 // Schematic connects EBYTE module's RXEN pin to MCU
|
||||
|
||||
#define LORA_CS SX126X_CS // Compatibility with variant file configuration structure
|
||||
#define LORA_SCK SX126X_SCK // Compatibility with variant file configuration structure
|
||||
#define LORA_MOSI SX126X_MOSI // Compatibility with variant file configuration structure
|
||||
#define LORA_MISO SX126X_MISO // Compatibility with variant file configuration structure
|
||||
#define LORA_DIO1 SX126X_DIO1 // Compatibility with variant file configuration structure
|
||||
27
variants/dreamcatcher/platformio.ini
Normal file
27
variants/dreamcatcher/platformio.ini
Normal file
@@ -0,0 +1,27 @@
|
||||
[env:dreamcatcher] ; 2301, latest revision
|
||||
extends = esp32s3_base
|
||||
board = esp32s3box
|
||||
board_level = extra
|
||||
|
||||
build_flags =
|
||||
${esp32s3_base.build_flags}
|
||||
-D PRIVATE_HW
|
||||
-D OTHERNET_DC_REV=2301
|
||||
-I variants/dreamcatcher
|
||||
-DARDUINO_USB_CDC_ON_BOOT=1
|
||||
|
||||
lib_deps = ${esp32s3_base.lib_deps}
|
||||
earlephilhower/ESP8266Audio@^1.9.7
|
||||
earlephilhower/ESP8266SAM@^1.0.1
|
||||
|
||||
[env:dreamcatcher-2206]
|
||||
extends = esp32s3_base
|
||||
board = esp32s3box
|
||||
board_level = extra
|
||||
|
||||
build_flags =
|
||||
${esp32s3_base.build_flags}
|
||||
-D PRIVATE_HW
|
||||
-D OTHERNET_DC_REV=2206
|
||||
-I variants/dreamcatcher
|
||||
-DARDUINO_USB_CDC_ON_BOOT=1
|
||||
17
variants/dreamcatcher/rfswitch.h
Normal file
17
variants/dreamcatcher/rfswitch.h
Normal file
@@ -0,0 +1,17 @@
|
||||
#include "RadioLib.h"
|
||||
|
||||
// RF Switch Matrix SubG RFO_HP_LF / RFO_LP_LF / RFI_[NP]_LF0
|
||||
// DIO5 -> RFSW0_V1
|
||||
// DIO6 -> RFSW1_V2
|
||||
// DIO7 -> ANT_CTRL_ON + ESP_IO9/LR_GPS_ANT_DC_EN -> RFI_GPS (Bias-T GPS)
|
||||
|
||||
static const uint32_t rfswitch_dio_pins[] = {RADIOLIB_LR11X0_DIO5, RADIOLIB_LR11X0_DIO6, RADIOLIB_LR11X0_DIO7, RADIOLIB_NC,
|
||||
RADIOLIB_NC};
|
||||
|
||||
static const Module::RfSwitchMode_t rfswitch_table[] = {
|
||||
// mode DIO5 DIO6 DIO7
|
||||
{LR11x0::MODE_STBY, {LOW, LOW, LOW}}, {LR11x0::MODE_RX, {HIGH, LOW, LOW}},
|
||||
{LR11x0::MODE_TX, {LOW, HIGH, LOW}}, {LR11x0::MODE_TX_HP, {LOW, HIGH, LOW}},
|
||||
{LR11x0::MODE_TX_HF, {LOW, LOW, LOW}}, {LR11x0::MODE_GNSS, {LOW, LOW, HIGH}},
|
||||
{LR11x0::MODE_WIFI, {LOW, LOW, LOW}}, END_OF_MODE_TABLE,
|
||||
};
|
||||
109
variants/dreamcatcher/variant.h
Normal file
109
variants/dreamcatcher/variant.h
Normal file
@@ -0,0 +1,109 @@
|
||||
#undef I2C_SDA
|
||||
#undef I2C_SCL
|
||||
#define I2C_SDA 16 // I2C pins for this board
|
||||
#define I2C_SCL 17
|
||||
|
||||
#define I2C_SDA1 45
|
||||
#define I2C_SCL1 46
|
||||
|
||||
#define LED_PIN 6
|
||||
#define LED_STATE_ON 1
|
||||
#define BUTTON_PIN 0
|
||||
|
||||
#define HAS_TPS65233
|
||||
|
||||
// V1 of SubG Switch SMA 0 or F Selector 1
|
||||
// #define RF_SW_SUBG1 8
|
||||
// V2 of SubG Switch SMA 1 or F Selector 0
|
||||
// #define RF_SW_SUBG2 5
|
||||
|
||||
#define RESET_OLED 8 // Emulate RF_SW_SUBG1, Use F Connector
|
||||
#define VTFT_CTRL 5 // Emulate RF_SW_SUBG2, for SMA swap the pin values
|
||||
|
||||
#if OTHERNET_DC_REV == 2206
|
||||
#define USE_LR1120
|
||||
|
||||
#define SPI_MISO 37
|
||||
#define SPI_MOSI 39
|
||||
#define SPI_SCK 38
|
||||
#define SDCARD_CS 40
|
||||
|
||||
#define PIN_BUZZER 48
|
||||
|
||||
// These can either be used for GPS or a serial link. Define through Protobufs
|
||||
// #define GPS_RX_PIN 10
|
||||
// #define GPS_TX_PIN 21
|
||||
|
||||
#define PIN_POWER_EN 7 // RF section power supply enable
|
||||
#define PERIPHERAL_WARMUP_MS 1000 // wait for TPS chip to initialize
|
||||
#define TPS_EXTM 45 // connected, but not used
|
||||
#define BIAS_T_ENABLE 9 // needs to be low
|
||||
#define BIAS_T_VALUE 0
|
||||
#else // 2301
|
||||
#define USE_LR1121
|
||||
#define SPI_MISO 10
|
||||
#define SPI_MOSI 39
|
||||
#define SPI_SCK 38
|
||||
|
||||
#define SDCARD_CS 40
|
||||
|
||||
// This is only informational, we always use SD cards in 1 bit mode
|
||||
#define SPI_DATA1 15
|
||||
#define SPI_DATA2 18
|
||||
|
||||
// These can either be used for GPS or a serial link. Define through Protobufs
|
||||
// #define GPS_RX_PIN 36
|
||||
// #define GPS_TX_PIN 37
|
||||
|
||||
// dac / amp instead of buzzer
|
||||
#define HAS_I2S
|
||||
#define DAC_I2S_BCK 21
|
||||
#define DAC_I2S_WS 9
|
||||
#define DAC_I2S_DOUT 48
|
||||
|
||||
#define BIAS_T_ENABLE 7 // needs to be low
|
||||
#define BIAS_T_VALUE 0
|
||||
#define BIAS_T_SUBGHZ 2 // also needs to be low, we hijack SENSOR_POWER_CTRL_PIN to emulate this
|
||||
#define SENSOR_POWER_CTRL_PIN BIAS_T_SUBGHZ
|
||||
#define SENSOR_POWER_ON 0
|
||||
#endif
|
||||
|
||||
#define HAS_SDCARD // Have SPI interface SD card slot
|
||||
#define SDCARD_USE_SPI1
|
||||
|
||||
#define LORA_RESET 3
|
||||
#define LORA_SCK 12
|
||||
#define LORA_MISO 13
|
||||
#define LORA_MOSI 11
|
||||
#define LORA_CS 14
|
||||
#define LORA_DIO9 4
|
||||
#define LORA_DIO2 47
|
||||
|
||||
#define LR1120_IRQ_PIN LORA_DIO9
|
||||
#define LR1120_NRESET_PIN LORA_RESET
|
||||
#define LR1120_BUSY_PIN LORA_DIO2
|
||||
#define LR1120_SPI_NSS_PIN LORA_CS
|
||||
#define LR1120_SPI_SCK_PIN LORA_SCK
|
||||
#define LR1120_SPI_MOSI_PIN LORA_MOSI
|
||||
#define LR1120_SPI_MISO_PIN LORA_MISO
|
||||
|
||||
#define LR1121_IRQ_PIN LORA_DIO9
|
||||
#define LR1121_NRESET_PIN LORA_RESET
|
||||
#define LR1121_BUSY_PIN LORA_DIO2
|
||||
#define LR1121_SPI_NSS_PIN LORA_CS
|
||||
#define LR1121_SPI_SCK_PIN LORA_SCK
|
||||
#define LR1121_SPI_MOSI_PIN LORA_MOSI
|
||||
#define LR1121_SPI_MISO_PIN LORA_MISO
|
||||
|
||||
#define LR11X0_DIO3_TCXO_VOLTAGE 1.8
|
||||
#define LR11X0_DIO_AS_RF_SWITCH
|
||||
|
||||
// This board needs external switching between sub-GHz and 2.4G circuits
|
||||
|
||||
// V1 of RF1 selector SubG 1 or 2.4GHz 0
|
||||
// #define RF_SW_SMA1 42
|
||||
// V2 of RF1 Selector SubG 0 or 2.4GHz 1
|
||||
// #define RF_SW_SMA2 41
|
||||
|
||||
#define LR11X0_RF_SWITCH_SUBGHZ 42
|
||||
#define LR11X0_RF_SWITCH_2_4GHZ 41
|
||||
@@ -11,7 +11,7 @@ board_upload.require_upload_port = yes
|
||||
|
||||
;upload_port = /dev/ttyACM0
|
||||
|
||||
build_flags = ${esp32_base.build_flags}
|
||||
build_flags = ${esp32s3_base.build_flags}
|
||||
-DESP32_S3_PICO
|
||||
;-DPRIVATE_HW
|
||||
-Ivariants/esp32-s3-pico
|
||||
@@ -22,4 +22,4 @@ build_flags = ${esp32_base.build_flags}
|
||||
|
||||
lib_deps = ${esp32s3_base.lib_deps}
|
||||
zinggjm/GxEPD2@^1.5.3
|
||||
adafruit/Adafruit NeoPixel @ ^1.12.0
|
||||
adafruit/Adafruit NeoPixel @ ^1.12.0
|
||||
|
||||
16
variants/feather_rp2040_rfm95/platformio.ini
Normal file
16
variants/feather_rp2040_rfm95/platformio.ini
Normal file
@@ -0,0 +1,16 @@
|
||||
[env:feather_rp2040_rfm95]
|
||||
extends = rp2040_base
|
||||
board = adafruit_feather
|
||||
upload_protocol = picotool
|
||||
|
||||
# add our variants files to the include and src paths
|
||||
build_flags = ${rp2040_base.build_flags}
|
||||
-DRP2040_FEATHER_RFM95
|
||||
-Ivariants/feather_rp2040_rfm95
|
||||
-DDEBUG_RP2040_PORT=Serial
|
||||
-DHW_SPI1_DEVICE
|
||||
-L "${platformio.libdeps_dir}/${this.__env__}/bsec2/src/cortex-m0plus"
|
||||
lib_deps =
|
||||
${rp2040_base.lib_deps}
|
||||
debug_build_flags = ${rp2040_base.build_flags}
|
||||
debug_tool = cmsis-dap ; for e.g. Picotool
|
||||
61
variants/feather_rp2040_rfm95/variant.h
Normal file
61
variants/feather_rp2040_rfm95/variant.h
Normal file
@@ -0,0 +1,61 @@
|
||||
// #define RADIOLIB_CUSTOM_ARDUINO 1
|
||||
// #define RADIOLIB_TONE_UNSUPPORTED 1
|
||||
// #define RADIOLIB_SOFTWARE_SERIAL_UNSUPPORTED 1
|
||||
|
||||
#define ARDUINO_ARCH_AVR
|
||||
|
||||
// #define USE_SSD1306
|
||||
|
||||
// #define USE_SH1106 1
|
||||
|
||||
// default I2C pins:
|
||||
// SDA = 4
|
||||
// SCL = 5
|
||||
|
||||
// Recommended pins for SerialModule:
|
||||
// txd = 8
|
||||
// rxd = 9
|
||||
|
||||
#define EXT_NOTIFY_OUT 22
|
||||
#define BUTTON_PIN 7
|
||||
// #define BUTTON_NEED_PULLUP
|
||||
|
||||
#define LED_PIN PIN_LED
|
||||
|
||||
// #define BATTERY_PIN 26
|
||||
// ratio of voltage divider = 3.0 (R17=200k, R18=100k)
|
||||
// #define ADC_MULTIPLIER 3.1 // 3.0 + a bit for being optimistic
|
||||
|
||||
#define USE_RF95 // RFM95/SX127x
|
||||
|
||||
#undef LORA_SCK
|
||||
#undef LORA_MISO
|
||||
#undef LORA_MOSI
|
||||
#undef LORA_CS
|
||||
|
||||
// https://www.adafruit.com/product/5714
|
||||
// https://learn.adafruit.com/feather-rp2040-rfm95
|
||||
// https://learn.adafruit.com/assets/120283
|
||||
// https://learn.adafruit.com/assets/120813
|
||||
#define LORA_SCK 14 // 10 12P
|
||||
#define LORA_MISO 8 // 12 10P
|
||||
#define LORA_MOSI 15 // 11 11P
|
||||
#define LORA_CS 16 // 3 13P
|
||||
|
||||
#define LORA_RESET 17 // 15 14P
|
||||
|
||||
#define LORA_DIO0 21 // ?? 6P
|
||||
#define LORA_DIO1 22 // 20 7P
|
||||
#define LORA_DIO2 23 // 2 8P
|
||||
#define LORA_DIO3 19 // ?? 3P
|
||||
#define LORA_DIO4 20 // ?? 4P
|
||||
#define LORA_DIO5 18 // ?? 15P
|
||||
|
||||
#ifdef USE_SX1262
|
||||
#define SX126X_CS LORA_CS
|
||||
#define SX126X_DIO1 LORA_DIO1
|
||||
#define SX126X_BUSY LORA_DIO2
|
||||
#define SX126X_RESET LORA_RESET
|
||||
#define SX126X_DIO2_AS_RF_SWITCH
|
||||
// #define SX126X_DIO3_TCXO_VOLTAGE 1.8
|
||||
#endif
|
||||
@@ -1,5 +1,5 @@
|
||||
#define LED_PIN 33
|
||||
#define LED_PIN2 34
|
||||
#define LED_PIN2 34
|
||||
#define EXT_PWR_DETECT 35
|
||||
|
||||
#define BUTTON_PIN 18
|
||||
@@ -40,3 +40,14 @@
|
||||
|
||||
#define SX126X_DIO2_AS_RF_SWITCH
|
||||
#define SX126X_DIO3_TCXO_VOLTAGE 1.8
|
||||
|
||||
#define I2C_SDA 1
|
||||
#define I2C_SCL 2
|
||||
#define HAS_SCREEN 0
|
||||
#define SENSOR_POWER_CTRL_PIN 21
|
||||
#define SENSOR_POWER_ON 1
|
||||
|
||||
#define PERIPHERAL_WARMUP_MS 100
|
||||
#define SENSOR_GPS_CONFLICT
|
||||
|
||||
#define ESP32S3_WAKE_TYPE ESP_EXT1_WAKEUP_ANY_HIGH
|
||||
@@ -3,8 +3,8 @@
|
||||
// LED pin on HT-DEV-ESP_V2 and HT-DEV-ESP_V3
|
||||
// https://resource.heltec.cn/download/HT-CT62/HT-CT62_Reference_Design.pdf
|
||||
// https://resource.heltec.cn/download/HT-DEV-ESP/HT-DEV-ESP_V3_Sch.pdf
|
||||
#define LED_PIN 2 // LED
|
||||
#define LED_INVERTED 0
|
||||
#define LED_PIN 2 // LED
|
||||
#define LED_STATE_ON 1 // State when LED is lit
|
||||
|
||||
#define HAS_SCREEN 0
|
||||
#define HAS_GPS 0
|
||||
@@ -26,4 +26,4 @@
|
||||
#define SX126X_BUSY LORA_BUSY
|
||||
#define SX126X_RESET LORA_RESET
|
||||
#define SX126X_DIO2_AS_RF_SWITCH
|
||||
#define SX126X_DIO3_TCXO_VOLTAGE 1.8
|
||||
#define SX126X_DIO3_TCXO_VOLTAGE 1.8
|
||||
25
variants/heltec_hru_3601/pins_arduino.h
Normal file
25
variants/heltec_hru_3601/pins_arduino.h
Normal file
@@ -0,0 +1,25 @@
|
||||
#ifndef Pins_Arduino_h
|
||||
#define Pins_Arduino_h
|
||||
|
||||
#include <stdint.h>
|
||||
#include <variant.h>
|
||||
|
||||
static const uint8_t TX = UART_TX;
|
||||
static const uint8_t RX = UART_RX;
|
||||
|
||||
static const uint8_t SDA = I2C_SDA;
|
||||
static const uint8_t SCL = I2C_SCL;
|
||||
|
||||
static const uint8_t SS = 8;
|
||||
static const uint8_t MOSI = 7;
|
||||
static const uint8_t MISO = 6;
|
||||
static const uint8_t SCK = 10;
|
||||
|
||||
static const uint8_t A0 = 0;
|
||||
static const uint8_t A1 = 1;
|
||||
static const uint8_t A2 = 2;
|
||||
static const uint8_t A3 = 3;
|
||||
static const uint8_t A4 = 4;
|
||||
static const uint8_t A5 = 5;
|
||||
|
||||
#endif /* Pins_Arduino_h */
|
||||
9
variants/heltec_hru_3601/platformio.ini
Normal file
9
variants/heltec_hru_3601/platformio.ini
Normal file
@@ -0,0 +1,9 @@
|
||||
[env:heltec-hru-3601]
|
||||
extends = esp32c3_base
|
||||
board = adafruit_qtpy_esp32c3
|
||||
build_flags =
|
||||
${esp32_base.build_flags}
|
||||
-D HELTEC_HRU_3601
|
||||
-I variants/heltec_hru_3601
|
||||
lib_deps = ${esp32c3_base.lib_deps}
|
||||
adafruit/Adafruit NeoPixel @ ^1.12.0
|
||||
40
variants/heltec_hru_3601/variant.h
Normal file
40
variants/heltec_hru_3601/variant.h
Normal file
@@ -0,0 +1,40 @@
|
||||
#define BUTTON_PIN 9
|
||||
|
||||
#define HAS_SCREEN 0
|
||||
#define HAS_GPS 0
|
||||
#undef GPS_RX_PIN
|
||||
#undef GPS_TX_PIN
|
||||
|
||||
#define USE_SX1262
|
||||
#define LORA_SCK 10
|
||||
#define LORA_MISO 6
|
||||
#define LORA_MOSI 7
|
||||
#define LORA_CS 8
|
||||
#define LORA_DIO0 RADIOLIB_NC
|
||||
#define LORA_RESET 5
|
||||
#define LORA_DIO1 3
|
||||
#define LORA_DIO2 RADIOLIB_NC
|
||||
#define LORA_BUSY 4
|
||||
#define SX126X_CS LORA_CS
|
||||
#define SX126X_DIO1 LORA_DIO1
|
||||
#define SX126X_BUSY LORA_BUSY
|
||||
#define SX126X_RESET LORA_RESET
|
||||
#define SX126X_DIO2_AS_RF_SWITCH
|
||||
#define SX126X_DIO3_TCXO_VOLTAGE 1.8
|
||||
|
||||
// Vext_Ctrl pin controls 3.3V LDO (U2) which provides power to I2C peripheral
|
||||
#define PIN_POWER_EN 1
|
||||
|
||||
// Board has I2C connected to UART0 pins, and no other hardware serial port
|
||||
#define UART_TX -1
|
||||
#define UART_RX -1
|
||||
|
||||
// Board has I2C connected to U0RXD and U0TXD
|
||||
#define I2C_SDA 21
|
||||
#define I2C_SCL 20
|
||||
|
||||
// Board has RGB LED on GPIO2
|
||||
#define HAS_NEOPIXEL // Enable the use of neopixels
|
||||
#define NEOPIXEL_COUNT 1 // How many neopixels are connected
|
||||
#define NEOPIXEL_DATA 2 // gpio pin used to send data to the neopixels
|
||||
#define NEOPIXEL_TYPE (NEO_GRB + NEO_KHZ800) // type of neopixels in use
|
||||
17
variants/heltec_mesh_node_t114/platformio.ini
Normal file
17
variants/heltec_mesh_node_t114/platformio.ini
Normal file
@@ -0,0 +1,17 @@
|
||||
; First prototype nrf52840/sx1262 device
|
||||
[env:heltec-mesh-node-t114]
|
||||
extends = nrf52840_base
|
||||
board = heltec_mesh_node_t114
|
||||
debug_tool = jlink
|
||||
|
||||
# add -DCFG_SYSVIEW if you want to use the Segger systemview tool for OS profiling.
|
||||
build_flags = ${nrf52840_base.build_flags} -Ivariants/heltec_mesh_node_t114
|
||||
-L "${platformio.libdeps_dir}/${this.__env__}/bsec2/src/cortex-m4/fpv4-sp-d16-hard"
|
||||
-DGPS_POWER_TOGGLE
|
||||
-DHELTEC_T114
|
||||
|
||||
build_src_filter = ${nrf52_base.build_src_filter} +<../variants/heltec_mesh_node_t114>
|
||||
lib_deps =
|
||||
${nrf52840_base.lib_deps}
|
||||
lewisxhe/PCF8563_Library@^1.0.1
|
||||
https://github.com/meshtastic/st7789#bd33ea58ddfe4a5e4a66d53300ccbd38d66ac21f
|
||||
@@ -24,19 +24,15 @@
|
||||
#include "wiring_digital.h"
|
||||
|
||||
const uint32_t g_ADigitalPinMap[] = {
|
||||
// P0
|
||||
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 0xff, 12, 13, 0xff, 15, 0xff, 17, 18, 0xff, 20, 0xff, 22, 0xff, 24, 0xff, 26, 0xff, 28, 29,
|
||||
30, 31,
|
||||
// P0 - pins 0 and 1 are hardwired for xtal and should never be enabled
|
||||
0xff, 0xff, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
|
||||
|
||||
// P1
|
||||
32, 0xff, 34, 0xff, 36, 0xff, 38, 0xff, 0xff, 41, 42, 43, 0xff, 45};
|
||||
32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47};
|
||||
|
||||
void initVariant()
|
||||
{
|
||||
// LED1 & LED2
|
||||
// LED1
|
||||
pinMode(PIN_LED1, OUTPUT);
|
||||
ledOff(PIN_LED1);
|
||||
|
||||
pinMode(PIN_LED2, OUTPUT);
|
||||
ledOff(PIN_LED2);
|
||||
}
|
||||
218
variants/heltec_mesh_node_t114/variant.h
Normal file
218
variants/heltec_mesh_node_t114/variant.h
Normal file
@@ -0,0 +1,218 @@
|
||||
/*
|
||||
Copyright (c) 2014-2015 Arduino LLC. All right reserved.
|
||||
Copyright (c) 2016 Sandeep Mistry All right reserved.
|
||||
Copyright (c) 2018, Adafruit Industries (adafruit.com)
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
See the GNU Lesser General Public License for more details.
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#ifndef _VARIANT_HELTEC_NRF_
|
||||
#define _VARIANT_HELTEC_NRF_
|
||||
/** Master clock frequency */
|
||||
#define VARIANT_MCK (64000000ul)
|
||||
|
||||
#define USE_LFXO // Board uses 32khz crystal for LF
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* Headers
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
||||
#include "WVariant.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif // __cplusplus
|
||||
|
||||
#define HELTEC_MESH_NODE_T114
|
||||
|
||||
#define USE_ST7789
|
||||
|
||||
#define ST7789_NSS 11
|
||||
#define ST7789_RS 12 // DC
|
||||
#define ST7789_SDA 41 // MOSI
|
||||
#define ST7789_SCK 40
|
||||
#define ST7789_RESET 2
|
||||
#define ST7789_MISO -1
|
||||
#define ST7789_BUSY -1
|
||||
#define VTFT_CTRL 3
|
||||
#define VTFT_LEDA 15
|
||||
// #define ST7789_BL (32+6)
|
||||
#define TFT_BACKLIGHT_ON LOW
|
||||
#define ST7789_SPI_HOST SPI1_HOST
|
||||
// #define TFT_BL (32+6)
|
||||
#define SPI_FREQUENCY 40000000
|
||||
#define SPI_READ_FREQUENCY 16000000
|
||||
#define TFT_HEIGHT 135
|
||||
#define TFT_WIDTH 240
|
||||
#define TFT_OFFSET_X 0
|
||||
#define TFT_OFFSET_Y 0
|
||||
// #define TFT_OFFSET_ROTATION 0
|
||||
// #define SCREEN_ROTATE
|
||||
// #define SCREEN_TRANSITION_FRAMERATE 5
|
||||
|
||||
// Number of pins defined in PinDescription array
|
||||
#define PINS_COUNT (48)
|
||||
#define NUM_DIGITAL_PINS (48)
|
||||
#define NUM_ANALOG_INPUTS (1)
|
||||
#define NUM_ANALOG_OUTPUTS (0)
|
||||
|
||||
// LEDs
|
||||
#define PIN_LED1 (32 + 3) // green (confirmed on 1.0 board)
|
||||
#define LED_BLUE PIN_LED1 // fake for bluefruit library
|
||||
#define LED_GREEN PIN_LED1
|
||||
#define LED_BUILTIN LED_GREEN
|
||||
#define LED_STATE_ON 0 // State when LED is lit
|
||||
|
||||
#define HAS_NEOPIXEL // Enable the use of neopixels
|
||||
#define NEOPIXEL_COUNT 2 // How many neopixels are connected
|
||||
#define NEOPIXEL_DATA 14 // gpio pin used to send data to the neopixels
|
||||
#define NEOPIXEL_TYPE (NEO_GRB + NEO_KHZ800) // type of neopixels in use
|
||||
|
||||
/*
|
||||
* Buttons
|
||||
*/
|
||||
#define PIN_BUTTON1 (32 + 10)
|
||||
// #define PIN_BUTTON2 (0 + 18) // 0.18 is labeled on the board as RESET but we configure it in the bootloader as a regular
|
||||
// GPIO
|
||||
|
||||
/*
|
||||
No longer populated on PCB
|
||||
*/
|
||||
#define PIN_SERIAL2_RX (0 + 9)
|
||||
#define PIN_SERIAL2_TX (0 + 10)
|
||||
// #define PIN_SERIAL2_EN (0 + 17)
|
||||
|
||||
/*
|
||||
* I2C
|
||||
*/
|
||||
|
||||
#define WIRE_INTERFACES_COUNT 2
|
||||
|
||||
// I2C bus 0
|
||||
// Routed to footprint for PCF8563TS RTC
|
||||
// Not populated on T114 V1, maybe in future?
|
||||
#define PIN_WIRE_SDA (0 + 26) // P0.26
|
||||
#define PIN_WIRE_SCL (0 + 27) // P0.27
|
||||
|
||||
// I2C bus 1
|
||||
// Available on header pins, for general use
|
||||
#define PIN_WIRE1_SDA (0 + 16) // P0.16
|
||||
#define PIN_WIRE1_SCL (0 + 13) // P0.13
|
||||
|
||||
// QSPI Pins
|
||||
#define PIN_QSPI_SCK (32 + 14)
|
||||
#define PIN_QSPI_CS (32 + 15)
|
||||
#define PIN_QSPI_IO0 (32 + 12) // MOSI if using two bit interface
|
||||
#define PIN_QSPI_IO1 (32 + 13) // MISO if using two bit interface
|
||||
#define PIN_QSPI_IO2 (0 + 7) // WP if using two bit interface (i.e. not used)
|
||||
#define PIN_QSPI_IO3 (0 + 5) // HOLD if using two bit interface (i.e. not used)
|
||||
|
||||
// On-board QSPI Flash
|
||||
#define EXTERNAL_FLASH_DEVICES MX25R1635F
|
||||
#define EXTERNAL_FLASH_USE_QSPI
|
||||
|
||||
/*
|
||||
* Lora radio
|
||||
*/
|
||||
|
||||
#define USE_SX1262
|
||||
// #define USE_SX1268
|
||||
#define SX126X_CS (0 + 24) // FIXME - we really should define LORA_CS instead
|
||||
#define LORA_CS (0 + 24)
|
||||
#define SX126X_DIO1 (0 + 20)
|
||||
// Note DIO2 is attached internally to the module to an analog switch for TX/RX switching
|
||||
// #define SX1262_DIO3 (0 + 21)
|
||||
// This is used as an *output* from the sx1262 and connected internally to power the tcxo, do not drive from the
|
||||
// main
|
||||
// CPU?
|
||||
#define SX126X_BUSY (0 + 17)
|
||||
#define SX126X_RESET (0 + 25)
|
||||
// Not really an E22 but TTGO seems to be trying to clone that
|
||||
#define SX126X_DIO2_AS_RF_SWITCH
|
||||
#define SX126X_DIO3_TCXO_VOLTAGE 1.8
|
||||
|
||||
#define PIN_SPI1_MISO \
|
||||
ST7789_MISO // FIXME not really needed, but for now the SPI code requires something to be defined, pick an used GPIO
|
||||
#define PIN_SPI1_MOSI ST7789_SDA
|
||||
#define PIN_SPI1_SCK ST7789_SCK
|
||||
|
||||
/*
|
||||
* GPS pins
|
||||
*/
|
||||
|
||||
#define GPS_L76K
|
||||
|
||||
// #define PIN_GPS_RESET (32 + 6) // An output to reset L76K GPS. As per datasheet, low for > 100ms will reset the L76K
|
||||
#define GPS_RESET_MODE LOW
|
||||
// #define PIN_GPS_EN (21)
|
||||
#define VEXT_ENABLE (0 + 21)
|
||||
#define PERIPHERAL_WARMUP_MS 1000 // Make sure I2C QuickLink has stable power before continuing
|
||||
#define VEXT_ON_VALUE HIGH
|
||||
// #define GPS_EN_ACTIVE HIGH
|
||||
#define PIN_GPS_STANDBY (32 + 2) // An output to wake GPS, low means allow sleep, high means force wake
|
||||
#define PIN_GPS_PPS (32 + 4)
|
||||
// Seems to be missing on this new board
|
||||
// #define PIN_GPS_PPS (32 + 4) // Pulse per second input from the GPS
|
||||
#define GPS_TX_PIN (32 + 5) // This is for bits going TOWARDS the CPU
|
||||
#define GPS_RX_PIN (32 + 7) // This is for bits going TOWARDS the GPS
|
||||
|
||||
#define GPS_THREAD_INTERVAL 50
|
||||
|
||||
#define PIN_SERIAL1_RX GPS_TX_PIN
|
||||
#define PIN_SERIAL1_TX GPS_RX_PIN
|
||||
|
||||
// PCF8563 RTC Module
|
||||
#define PCF8563_RTC 0x51
|
||||
|
||||
/*
|
||||
* SPI Interfaces
|
||||
*/
|
||||
#define SPI_INTERFACES_COUNT 2
|
||||
|
||||
// For LORA, spi 0
|
||||
#define PIN_SPI_MISO (0 + 23)
|
||||
#define PIN_SPI_MOSI (0 + 22)
|
||||
#define PIN_SPI_SCK (0 + 19)
|
||||
|
||||
// #define PIN_PWR_EN (0 + 6)
|
||||
|
||||
// To debug via the segger JLINK console rather than the CDC-ACM serial device
|
||||
// #define USE_SEGGER
|
||||
|
||||
// Battery
|
||||
// The battery sense is hooked to pin A0 (4)
|
||||
// it is defined in the anlaolgue pin section of this file
|
||||
// and has 12 bit resolution
|
||||
|
||||
#define ADC_CTRL 6
|
||||
#define ADC_CTRL_ENABLED HIGH
|
||||
#define BATTERY_PIN 4
|
||||
#define ADC_RESOLUTION 14
|
||||
|
||||
#define BATTERY_SENSE_RESOLUTION_BITS 12
|
||||
#define BATTERY_SENSE_RESOLUTION 4096.0
|
||||
#undef AREF_VOLTAGE
|
||||
#define AREF_VOLTAGE 3.0
|
||||
#define VBAT_AR_INTERNAL AR_INTERNAL_3_0
|
||||
#define ADC_MULTIPLIER (4.90F)
|
||||
|
||||
#define HAS_RTC 0
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* Arduino objects - C++ only
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
||||
#endif
|
||||
@@ -1,5 +1,7 @@
|
||||
#define LED_PIN LED
|
||||
|
||||
#define USE_SSD1306 // Heltec_v3 has a SSD1306 display
|
||||
|
||||
#define RESET_OLED RST_OLED
|
||||
#define I2C_SDA SDA_OLED // I2C pins for this board
|
||||
#define I2C_SCL SCL_OLED
|
||||
|
||||
61
variants/heltec_vision_master_e213/pins_arduino.h
Normal file
61
variants/heltec_vision_master_e213/pins_arduino.h
Normal file
@@ -0,0 +1,61 @@
|
||||
#ifndef Pins_Arduino_h
|
||||
#define Pins_Arduino_h
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
static const uint8_t LED_BUILTIN = 45; // LED is not populated on earliest board variant
|
||||
#define BUILTIN_LED LED_BUILTIN // Backward compatibility
|
||||
#define LED_BUILTIN LED_BUILTIN
|
||||
|
||||
static const uint8_t TX = 43;
|
||||
static const uint8_t RX = 44;
|
||||
|
||||
static const uint8_t SDA = 39;
|
||||
static const uint8_t SCL = 38;
|
||||
|
||||
static const uint8_t SS = 8;
|
||||
static const uint8_t MOSI = 10;
|
||||
static const uint8_t MISO = 11;
|
||||
static const uint8_t SCK = 9;
|
||||
|
||||
static const uint8_t A0 = 1;
|
||||
static const uint8_t A1 = 2;
|
||||
static const uint8_t A2 = 3;
|
||||
static const uint8_t A3 = 4;
|
||||
static const uint8_t A4 = 5;
|
||||
static const uint8_t A5 = 6;
|
||||
static const uint8_t A6 = 7;
|
||||
static const uint8_t A7 = 8;
|
||||
static const uint8_t A8 = 9;
|
||||
static const uint8_t A9 = 10;
|
||||
static const uint8_t A10 = 11;
|
||||
static const uint8_t A11 = 12;
|
||||
static const uint8_t A12 = 13;
|
||||
static const uint8_t A13 = 14;
|
||||
static const uint8_t A14 = 15;
|
||||
static const uint8_t A15 = 16;
|
||||
static const uint8_t A16 = 17;
|
||||
static const uint8_t A17 = 18;
|
||||
static const uint8_t A18 = 19;
|
||||
static const uint8_t A19 = 20;
|
||||
|
||||
static const uint8_t T1 = 1;
|
||||
static const uint8_t T2 = 2;
|
||||
static const uint8_t T3 = 3;
|
||||
static const uint8_t T4 = 4;
|
||||
static const uint8_t T5 = 5;
|
||||
static const uint8_t T6 = 6;
|
||||
static const uint8_t T7 = 7;
|
||||
static const uint8_t T8 = 8;
|
||||
static const uint8_t T9 = 9;
|
||||
static const uint8_t T10 = 10;
|
||||
static const uint8_t T11 = 11;
|
||||
static const uint8_t T12 = 12;
|
||||
static const uint8_t T13 = 13;
|
||||
static const uint8_t T14 = 14;
|
||||
|
||||
static const uint8_t RST_LoRa = 12;
|
||||
static const uint8_t BUSY_LoRa = 13;
|
||||
static const uint8_t DIO1 = 14;
|
||||
|
||||
#endif /* Pins_Arduino_h */
|
||||
23
variants/heltec_vision_master_e213/platformio.ini
Normal file
23
variants/heltec_vision_master_e213/platformio.ini
Normal file
@@ -0,0 +1,23 @@
|
||||
[env:heltec-vision-master-e213]
|
||||
extends = esp32s3_base
|
||||
board = heltec_vision_master_e213
|
||||
build_flags =
|
||||
${esp32s3_base.build_flags}
|
||||
-Ivariants/heltec_vision_master_e213
|
||||
-DHELTEC_VISION_MASTER_E213
|
||||
-DEINK_DISPLAY_MODEL=GxEPD2_213_FC1
|
||||
-DEINK_WIDTH=250
|
||||
-DEINK_HEIGHT=122
|
||||
-DUSE_EINK_DYNAMICDISPLAY ; Enable Dynamic EInk
|
||||
-DEINK_LIMIT_FASTREFRESH=10 ; How many consecutive fast-refreshes are permitted
|
||||
-DEINK_LIMIT_RATE_BACKGROUND_SEC=30 ; Minimum interval between BACKGROUND updates
|
||||
-DEINK_LIMIT_RATE_RESPONSIVE_SEC=1 ; Minimum interval between RESPONSIVE updates
|
||||
; -D EINK_LIMIT_GHOSTING_PX=2000 ; (Optional) How much image ghosting is tolerated
|
||||
-DEINK_BACKGROUND_USES_FAST ; (Optional) Use FAST refresh for both BACKGROUND and RESPONSIVE, until a limit is reached.
|
||||
-DEINK_HASQUIRK_GHOSTING ; Display model is identified as "prone to ghosting"
|
||||
-DEINK_HASQUIRK_WEAKFASTREFRESH ; Pixels set with fast-refresh are easy to clear, disrupted by sunlight
|
||||
lib_deps =
|
||||
${esp32s3_base.lib_deps}
|
||||
https://github.com/meshtastic/GxEPD2#b202ebfec6a4821e098cf7a625ba0f6f2400292d
|
||||
lewisxhe/PCF8563_Library@^1.0.1
|
||||
upload_speed = 115200
|
||||
56
variants/heltec_vision_master_e213/variant.h
Normal file
56
variants/heltec_vision_master_e213/variant.h
Normal file
@@ -0,0 +1,56 @@
|
||||
#define LED_PIN 45 // LED is not populated on earliest board variant
|
||||
#define BUTTON_PIN 0
|
||||
#define BUTTON_PIN_SECONDARY 21 // Second built-in button
|
||||
#define BUTTON_SECONDARY_CANNEDMESSAGES // By default, use the secondary button as canned message input
|
||||
|
||||
// I2C
|
||||
#define I2C_SDA SDA
|
||||
#define I2C_SCL SCL
|
||||
|
||||
// Display (E-Ink)
|
||||
#define USE_EINK
|
||||
#define PIN_EINK_CS 5
|
||||
#define PIN_EINK_BUSY 1
|
||||
#define PIN_EINK_DC 2
|
||||
#define PIN_EINK_RES 3
|
||||
#define PIN_EINK_SCLK 4
|
||||
#define PIN_EINK_MOSI 6
|
||||
|
||||
// SPI
|
||||
#define SPI_INTERFACES_COUNT 2
|
||||
#define PIN_SPI_MISO 11
|
||||
#define PIN_SPI_MOSI 10
|
||||
#define PIN_SPI_SCK 9
|
||||
|
||||
// Power
|
||||
#define VEXT_ENABLE 18 // Powers the E-Ink display, and the 3.3V supply to the I2C QuickLink connector
|
||||
#define PERIPHERAL_WARMUP_MS 1000 // Make sure I2C QuickLink has stable power before continuing
|
||||
#define VEXT_ON_VALUE HIGH
|
||||
#define ADC_CTRL 46
|
||||
#define ADC_CTRL_ENABLED HIGH
|
||||
#define BATTERY_PIN 7
|
||||
#define ADC_CHANNEL ADC1_GPIO7_CHANNEL
|
||||
#define ADC_MULTIPLIER 4.9 * 1.03
|
||||
#define ADC_ATTENUATION ADC_ATTEN_DB_2_5
|
||||
#define HAS_32768HZ
|
||||
|
||||
// LoRa
|
||||
#define USE_SX1262
|
||||
|
||||
#define LORA_DIO0 RADIOLIB_NC // a No connect on the SX1262 module
|
||||
#define LORA_RESET 12
|
||||
#define LORA_DIO1 14 // SX1262 IRQ
|
||||
#define LORA_DIO2 13 // SX1262 BUSY
|
||||
|
||||
#define LORA_SCK 9
|
||||
#define LORA_MISO 11
|
||||
#define LORA_MOSI 10
|
||||
#define LORA_CS 8
|
||||
|
||||
#define SX126X_CS LORA_CS
|
||||
#define SX126X_DIO1 LORA_DIO1
|
||||
#define SX126X_BUSY LORA_DIO2
|
||||
#define SX126X_RESET LORA_RESET
|
||||
|
||||
#define SX126X_DIO2_AS_RF_SWITCH
|
||||
#define SX126X_DIO3_TCXO_VOLTAGE 1.8
|
||||
61
variants/heltec_vision_master_e290/pins_arduino.h
Normal file
61
variants/heltec_vision_master_e290/pins_arduino.h
Normal file
@@ -0,0 +1,61 @@
|
||||
#ifndef Pins_Arduino_h
|
||||
#define Pins_Arduino_h
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
static const uint8_t LED_BUILTIN = 45; // LED is not populated on earliest board variant
|
||||
#define BUILTIN_LED LED_BUILTIN // Backward compatibility
|
||||
#define LED_BUILTIN LED_BUILTIN
|
||||
|
||||
static const uint8_t TX = 43;
|
||||
static const uint8_t RX = 44;
|
||||
|
||||
static const uint8_t SDA = 39;
|
||||
static const uint8_t SCL = 38;
|
||||
|
||||
static const uint8_t SS = 8;
|
||||
static const uint8_t MOSI = 10;
|
||||
static const uint8_t MISO = 11;
|
||||
static const uint8_t SCK = 9;
|
||||
|
||||
static const uint8_t A0 = 1;
|
||||
static const uint8_t A1 = 2;
|
||||
static const uint8_t A2 = 3;
|
||||
static const uint8_t A3 = 4;
|
||||
static const uint8_t A4 = 5;
|
||||
static const uint8_t A5 = 6;
|
||||
static const uint8_t A6 = 7;
|
||||
static const uint8_t A7 = 8;
|
||||
static const uint8_t A8 = 9;
|
||||
static const uint8_t A9 = 10;
|
||||
static const uint8_t A10 = 11;
|
||||
static const uint8_t A11 = 12;
|
||||
static const uint8_t A12 = 13;
|
||||
static const uint8_t A13 = 14;
|
||||
static const uint8_t A14 = 15;
|
||||
static const uint8_t A15 = 16;
|
||||
static const uint8_t A16 = 17;
|
||||
static const uint8_t A17 = 18;
|
||||
static const uint8_t A18 = 19;
|
||||
static const uint8_t A19 = 20;
|
||||
|
||||
static const uint8_t T1 = 1;
|
||||
static const uint8_t T2 = 2;
|
||||
static const uint8_t T3 = 3;
|
||||
static const uint8_t T4 = 4;
|
||||
static const uint8_t T5 = 5;
|
||||
static const uint8_t T6 = 6;
|
||||
static const uint8_t T7 = 7;
|
||||
static const uint8_t T8 = 8;
|
||||
static const uint8_t T9 = 9;
|
||||
static const uint8_t T10 = 10;
|
||||
static const uint8_t T11 = 11;
|
||||
static const uint8_t T12 = 12;
|
||||
static const uint8_t T13 = 13;
|
||||
static const uint8_t T14 = 14;
|
||||
|
||||
static const uint8_t RST_LoRa = 12;
|
||||
static const uint8_t BUSY_LoRa = 13;
|
||||
static const uint8_t DIO1 = 14;
|
||||
|
||||
#endif /* Pins_Arduino_h */
|
||||
25
variants/heltec_vision_master_e290/platformio.ini
Normal file
25
variants/heltec_vision_master_e290/platformio.ini
Normal file
@@ -0,0 +1,25 @@
|
||||
[env:heltec-vision-master-e290]
|
||||
extends = esp32s3_base
|
||||
board = heltec_vision_master_e290
|
||||
build_flags =
|
||||
${esp32s3_base.build_flags}
|
||||
-I variants/heltec_vision_master_e290
|
||||
-D HELTEC_VISION_MASTER_E290
|
||||
-D BUTTON_CLICK_MS=200
|
||||
-D EINK_DISPLAY_MODEL=GxEPD2_290_BN8
|
||||
-D EINK_WIDTH=296
|
||||
-D EINK_HEIGHT=128
|
||||
-D USE_EINK_DYNAMICDISPLAY ; Enable Dynamic EInk
|
||||
-D EINK_LIMIT_FASTREFRESH=10 ; How many consecutive fast-refreshes are permitted
|
||||
-D EINK_LIMIT_RATE_BACKGROUND_SEC=30 ; Minimum interval between BACKGROUND updates
|
||||
-D EINK_LIMIT_RATE_RESPONSIVE_SEC=1 ; Minimum interval between RESPONSIVE updates
|
||||
-D EINK_HASQUIRK_GHOSTING ; Display model is identified as "prone to ghosting"
|
||||
-D EINK_HASQUIRK_WEAKFASTREFRESH ; Pixels set with fast-refresh are easy to clear, disrupted by sunlight
|
||||
; -D EINK_LIMIT_GHOSTING_PX=2000 ; How much image ghosting is tolerated
|
||||
; -D EINK_BACKGROUND_USES_FAST ; (If enabled) don't redraw RESPONSIVE frames at next BACKGROUND update
|
||||
|
||||
lib_deps =
|
||||
${esp32s3_base.lib_deps}
|
||||
https://github.com/meshtastic/GxEPD2#448c8538129fde3d02a7cb5e6fc81971ad92547f
|
||||
lewisxhe/PCF8563_Library@^1.0.1
|
||||
upload_speed = 115200
|
||||
55
variants/heltec_vision_master_e290/variant.h
Normal file
55
variants/heltec_vision_master_e290/variant.h
Normal file
@@ -0,0 +1,55 @@
|
||||
#define LED_PIN 45 // LED is not populated on earliest board variant
|
||||
#define BUTTON_PIN 0
|
||||
#define BUTTON_PIN_SECONDARY 21 // Second built-in button
|
||||
#define BUTTON_SECONDARY_CANNEDMESSAGES // By default, use the secondary button as canned message input
|
||||
|
||||
// I2C
|
||||
#define I2C_SDA SDA
|
||||
#define I2C_SCL SCL
|
||||
|
||||
// Display (E-Ink)
|
||||
#define USE_EINK
|
||||
#define PIN_EINK_CS 3
|
||||
#define PIN_EINK_BUSY 6
|
||||
#define PIN_EINK_DC 4
|
||||
#define PIN_EINK_RES 5
|
||||
#define PIN_EINK_SCLK 2
|
||||
#define PIN_EINK_MOSI 1
|
||||
|
||||
// SPI
|
||||
#define SPI_INTERFACES_COUNT 2
|
||||
#define PIN_SPI_MISO 11
|
||||
#define PIN_SPI_MOSI 10
|
||||
#define PIN_SPI_SCK 9
|
||||
|
||||
// Power
|
||||
#define VEXT_ENABLE 18 // Powers the E-Ink display only
|
||||
#define VEXT_ON_VALUE HIGH
|
||||
#define ADC_CTRL 46
|
||||
#define ADC_CTRL_ENABLED HIGH
|
||||
#define BATTERY_PIN 7
|
||||
#define ADC_CHANNEL ADC1_GPIO7_CHANNEL
|
||||
#define ADC_MULTIPLIER 4.9 * 1.03
|
||||
#define ADC_ATTENUATION ADC_ATTEN_DB_2_5
|
||||
#define HAS_32768HZ
|
||||
|
||||
// LoRa
|
||||
#define USE_SX1262
|
||||
|
||||
#define LORA_DIO0 RADIOLIB_NC // a No connect on the SX1262 module
|
||||
#define LORA_RESET 12
|
||||
#define LORA_DIO1 14 // SX1262 IRQ
|
||||
#define LORA_DIO2 13 // SX1262 BUSY
|
||||
|
||||
#define LORA_SCK 9
|
||||
#define LORA_MISO 11
|
||||
#define LORA_MOSI 10
|
||||
#define LORA_CS 8
|
||||
|
||||
#define SX126X_CS LORA_CS
|
||||
#define SX126X_DIO1 LORA_DIO1
|
||||
#define SX126X_BUSY LORA_DIO2
|
||||
#define SX126X_RESET LORA_RESET
|
||||
|
||||
#define SX126X_DIO2_AS_RF_SWITCH
|
||||
#define SX126X_DIO3_TCXO_VOLTAGE 1.8
|
||||
61
variants/heltec_vision_master_t190/pins_arduino.h
Normal file
61
variants/heltec_vision_master_t190/pins_arduino.h
Normal file
@@ -0,0 +1,61 @@
|
||||
#ifndef Pins_Arduino_h
|
||||
#define Pins_Arduino_h
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
static const uint8_t LED_BUILTIN = 35;
|
||||
#define BUILTIN_LED LED_BUILTIN // backward compatibility
|
||||
#define LED_BUILTIN LED_BUILTIN
|
||||
|
||||
static const uint8_t TX = 43;
|
||||
static const uint8_t RX = 44;
|
||||
|
||||
static const uint8_t SDA = 2;
|
||||
static const uint8_t SCL = 1;
|
||||
|
||||
static const uint8_t SS = 8;
|
||||
static const uint8_t MOSI = 10;
|
||||
static const uint8_t MISO = 11;
|
||||
static const uint8_t SCK = 9;
|
||||
|
||||
static const uint8_t A0 = 1;
|
||||
static const uint8_t A1 = 2;
|
||||
static const uint8_t A2 = 3;
|
||||
static const uint8_t A3 = 4;
|
||||
static const uint8_t A4 = 5;
|
||||
static const uint8_t A5 = 6;
|
||||
static const uint8_t A6 = 7;
|
||||
static const uint8_t A7 = 8;
|
||||
static const uint8_t A8 = 9;
|
||||
static const uint8_t A9 = 10;
|
||||
static const uint8_t A10 = 11;
|
||||
static const uint8_t A11 = 12;
|
||||
static const uint8_t A12 = 13;
|
||||
static const uint8_t A13 = 14;
|
||||
static const uint8_t A14 = 15;
|
||||
static const uint8_t A15 = 16;
|
||||
static const uint8_t A16 = 17;
|
||||
static const uint8_t A17 = 18;
|
||||
static const uint8_t A18 = 19;
|
||||
static const uint8_t A19 = 20;
|
||||
|
||||
static const uint8_t T1 = 1;
|
||||
static const uint8_t T2 = 2;
|
||||
static const uint8_t T3 = 3;
|
||||
static const uint8_t T4 = 4;
|
||||
static const uint8_t T5 = 5;
|
||||
static const uint8_t T6 = 6;
|
||||
static const uint8_t T7 = 7;
|
||||
static const uint8_t T8 = 8;
|
||||
static const uint8_t T9 = 9;
|
||||
static const uint8_t T10 = 10;
|
||||
static const uint8_t T11 = 11;
|
||||
static const uint8_t T12 = 12;
|
||||
static const uint8_t T13 = 13;
|
||||
static const uint8_t T14 = 14;
|
||||
|
||||
static const uint8_t RST_LoRa = 12;
|
||||
static const uint8_t BUSY_LoRa = 13;
|
||||
static const uint8_t DIO0 = 14;
|
||||
|
||||
#endif /* Pins_Arduino_h */
|
||||
13
variants/heltec_vision_master_t190/platformio.ini
Normal file
13
variants/heltec_vision_master_t190/platformio.ini
Normal file
@@ -0,0 +1,13 @@
|
||||
[env:heltec-vision-master-t190]
|
||||
extends = esp32s3_base
|
||||
board = heltec_vision_master_t190
|
||||
build_flags =
|
||||
${esp32s3_base.build_flags}
|
||||
-Ivariants/heltec_vision_master_t190
|
||||
-DHELTEC_VISION_MASTER_T190
|
||||
; -D PRIVATE_HW
|
||||
lib_deps =
|
||||
${esp32s3_base.lib_deps}
|
||||
lewisxhe/PCF8563_Library@^1.0.1
|
||||
https://github.com/meshtastic/st7789#bd33ea58ddfe4a5e4a66d53300ccbd38d66ac21f
|
||||
upload_speed = 921600
|
||||
72
variants/heltec_vision_master_t190/variant.h
Normal file
72
variants/heltec_vision_master_t190/variant.h
Normal file
@@ -0,0 +1,72 @@
|
||||
#define BUTTON_PIN 0
|
||||
#define BUTTON_PIN_SECONDARY 21 // Second built-in button
|
||||
#define BUTTON_SECONDARY_CANNEDMESSAGES // By default, use the secondary button as canned message input
|
||||
|
||||
// I2C
|
||||
#define I2C_SDA SDA
|
||||
#define I2C_SCL SCL
|
||||
|
||||
// Display (TFT)
|
||||
#define USE_ST7789
|
||||
#define ST7789_NSS 39
|
||||
#define ST7789_RS 47 // DC
|
||||
#define ST7789_SDA 48 // MOSI
|
||||
#define ST7789_SCK 38
|
||||
#define ST7789_RESET 40
|
||||
#define ST7789_MISO 4
|
||||
#define ST7789_BUSY -1
|
||||
#define VTFT_CTRL 7
|
||||
#define VTFT_LEDA 17
|
||||
#define TFT_BACKLIGHT_ON HIGH
|
||||
#define ST7789_SPI_HOST SPI2_HOST
|
||||
#define SPI_FREQUENCY 10000000
|
||||
#define SPI_READ_FREQUENCY 10000000
|
||||
#define TFT_HEIGHT 170
|
||||
#define TFT_WIDTH 320
|
||||
#define TFT_OFFSET_X 0
|
||||
#define TFT_OFFSET_Y 0
|
||||
// #define TFT_OFFSET_ROTATION 0
|
||||
// #define SCREEN_ROTATE
|
||||
// #define SCREEN_TRANSITION_FRAMERATE 5
|
||||
#define BRIGHTNESS_DEFAULT 100 // Medium Low Brightnes
|
||||
|
||||
// #define SLEEP_TIME 120
|
||||
|
||||
// SPI
|
||||
#define SPI_INTERFACES_COUNT 2
|
||||
#define PIN_SPI_MISO 11
|
||||
#define PIN_SPI_MOSI 10
|
||||
#define PIN_SPI_SCK 9
|
||||
|
||||
// Power
|
||||
#define VEXT_ENABLE 5
|
||||
#define VEXT_ON_VALUE HIGH
|
||||
#define ADC_CTRL 46
|
||||
#define ADC_CTRL_ENABLED HIGH
|
||||
#define BATTERY_PIN 6
|
||||
#define ADC_CHANNEL ADC1_GPIO6_CHANNEL
|
||||
#define ADC_MULTIPLIER 4.9 * 1.03 // Voltage divider is roughly 1:1
|
||||
#define ADC_ATTENUATION ADC_ATTEN_DB_2_5 // Voltage divider output is quite high
|
||||
#define HAS_32768HZ
|
||||
|
||||
// LoRa
|
||||
#define USE_SX1262
|
||||
|
||||
#define LORA_DIO0 RADIOLIB_NC // a No connect on the SX1262 module
|
||||
#define LORA_RESET 12
|
||||
#define LORA_DIO1 14 // SX1262 IRQ
|
||||
#define LORA_DIO2 13 // SX1262 BUSY
|
||||
#define LORA_DIO3 // Not connected on PCB, but internally on the TTGO SX1262, if DIO3 is high the TXCO is enabled
|
||||
|
||||
#define LORA_SCK 9
|
||||
#define LORA_MISO 11
|
||||
#define LORA_MOSI 10
|
||||
#define LORA_CS 8
|
||||
|
||||
#define SX126X_CS LORA_CS
|
||||
#define SX126X_DIO1 LORA_DIO1
|
||||
#define SX126X_BUSY LORA_DIO2
|
||||
#define SX126X_RESET LORA_RESET
|
||||
|
||||
#define SX126X_DIO2_AS_RF_SWITCH
|
||||
#define SX126X_DIO3_TCXO_VOLTAGE 1.8
|
||||
6
variants/heltec_wireless_bridge/platformio.ini
Normal file
6
variants/heltec_wireless_bridge/platformio.ini
Normal file
@@ -0,0 +1,6 @@
|
||||
[env:heltec-wireless-bridge]
|
||||
;build_type = debug ; to make it possible to step through our jtag debugger
|
||||
extends = esp32_base
|
||||
board = heltec_wifi_lora_32
|
||||
build_flags =
|
||||
${esp32_base.build_flags} -D HELTEC_WIRELESS_BRIDGE -I variants/heltec_wireless_bridge
|
||||
29
variants/heltec_wireless_bridge/variant.h
Normal file
29
variants/heltec_wireless_bridge/variant.h
Normal file
@@ -0,0 +1,29 @@
|
||||
// the default ESP32 Pin of 15 is the Oled SCL, set to 36 and 37 and works fine.
|
||||
// Tested on Neo6m module.
|
||||
#undef GPS_RX_PIN
|
||||
#undef GPS_TX_PIN
|
||||
#define GPS_RX_PIN 36
|
||||
#define GPS_TX_PIN 33
|
||||
|
||||
#ifndef USE_JTAG // gpio15 is TDO for JTAG, so no I2C on this board while doing jtag
|
||||
#define I2C_SDA 4 // I2C pins for this board
|
||||
#define I2C_SCL 15
|
||||
#endif
|
||||
|
||||
#define LED_PIN 25 // If defined we will blink this LED
|
||||
#define BUTTON_PIN 0 // If defined, this will be used for user button presses
|
||||
|
||||
#define USE_RF95
|
||||
#define LORA_DIO0 26 // a No connect on the SX1262 module
|
||||
#ifndef USE_JTAG
|
||||
#define LORA_RESET 14
|
||||
#endif
|
||||
#define LORA_DIO1 35
|
||||
#define LORA_DIO2 34 // Not really used
|
||||
|
||||
// ratio of voltage divider = 3.20 (R1=100k, R2=220k)
|
||||
#define ADC_MULTIPLIER 3.2
|
||||
|
||||
#define BATTERY_PIN 13 // A battery voltage measurement pin, voltage divider connected here to measure battery voltage
|
||||
#define ADC_CHANNEL ADC2_GPIO13_CHANNEL
|
||||
#define BAT_MEASURE_ADC_UNIT 2
|
||||
@@ -3,16 +3,10 @@
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#define WIFI_Kit_32 true
|
||||
#define DISPLAY_HEIGHT 64
|
||||
#define DISPLAY_WIDTH 128
|
||||
|
||||
static const uint8_t LED_BUILTIN = 35;
|
||||
static const uint8_t LED_BUILTIN = 18;
|
||||
#define BUILTIN_LED LED_BUILTIN // backward compatibility
|
||||
#define LED_BUILTIN LED_BUILTIN
|
||||
|
||||
static const uint8_t KEY_BUILTIN = 0;
|
||||
|
||||
static const uint8_t TX = 43;
|
||||
static const uint8_t RX = 44;
|
||||
|
||||
@@ -60,11 +54,8 @@ static const uint8_t T12 = 12;
|
||||
static const uint8_t T13 = 13;
|
||||
static const uint8_t T14 = 14;
|
||||
|
||||
static const uint8_t Vext = 45;
|
||||
static const uint8_t LED = 18;
|
||||
|
||||
static const uint8_t RST_LoRa = 12;
|
||||
static const uint8_t BUSY_LoRa = 13;
|
||||
static const uint8_t DIO0 = 14;
|
||||
static const uint8_t DIO1 = 14;
|
||||
|
||||
#endif /* Pins_Arduino_h */
|
||||
|
||||
@@ -1,14 +1,12 @@
|
||||
#define LED_PIN 18
|
||||
#define BUTTON_PIN 0
|
||||
|
||||
// Enable bus for external periherals
|
||||
// I2C
|
||||
#define I2C_SDA SDA
|
||||
#define I2C_SCL SCL
|
||||
|
||||
// Display (E-Ink)
|
||||
#define USE_EINK
|
||||
|
||||
/*
|
||||
* eink display pins
|
||||
*/
|
||||
#define PIN_EINK_CS 4
|
||||
#define PIN_EINK_BUSY 7
|
||||
#define PIN_EINK_DC 5
|
||||
@@ -16,32 +14,31 @@
|
||||
#define PIN_EINK_SCLK 3
|
||||
#define PIN_EINK_MOSI 2
|
||||
|
||||
/*
|
||||
* SPI interfaces
|
||||
*/
|
||||
// SPI
|
||||
#define SPI_INTERFACES_COUNT 2
|
||||
#define PIN_SPI_MISO 11
|
||||
#define PIN_SPI_MOSI 10
|
||||
#define PIN_SPI_SCK 9
|
||||
|
||||
#define PIN_SPI_MISO 10 // MISO P0.17
|
||||
#define PIN_SPI_MOSI 11 // MOSI P0.15
|
||||
#define PIN_SPI_SCK 9 // SCK P0.13
|
||||
|
||||
#define VEXT_ENABLE 45 // active low, powers the oled display and the lora antenna boost
|
||||
#define BUTTON_PIN 0
|
||||
|
||||
// Power
|
||||
#define VEXT_ENABLE 45 // Active low, powers the E-Ink display
|
||||
#define VEXT_ON_VALUE LOW
|
||||
#define ADC_CTRL 19
|
||||
#define BATTERY_PIN 20
|
||||
#define ADC_CHANNEL ADC2_GPIO20_CHANNEL
|
||||
#define ADC_MULTIPLIER 2 // Voltage divider is roughly 1:1
|
||||
#define BAT_MEASURE_ADC_UNIT 2 // Use ADC2
|
||||
#define ADC_ATTENUATION ADC_ATTEN_DB_11 // Voltage divider output is quite high
|
||||
#define ADC_ATTENUATION ADC_ATTEN_DB_12 // Voltage divider output is quite high
|
||||
#define HAS_32768HZ
|
||||
#define ADC_CTRL_ENABLED LOW
|
||||
|
||||
// LoRa
|
||||
#define USE_SX1262
|
||||
|
||||
#define LORA_DIO0 -1 // a No connect on the SX1262 module
|
||||
#define LORA_DIO0 RADIOLIB_NC // a No connect on the SX1262 module
|
||||
#define LORA_RESET 12
|
||||
#define LORA_DIO1 14 // SX1262 IRQ
|
||||
#define LORA_DIO2 13 // SX1262 BUSY
|
||||
#define LORA_DIO3 // Not connected on PCB, but internally on the TTGO SX1262, if DIO3 is high the TXCO is enabled
|
||||
|
||||
#define LORA_SCK 9
|
||||
#define LORA_MISO 11
|
||||
@@ -54,4 +51,4 @@
|
||||
#define SX126X_RESET LORA_RESET
|
||||
|
||||
#define SX126X_DIO2_AS_RF_SWITCH
|
||||
#define SX126X_DIO3_TCXO_VOLTAGE 1.8
|
||||
#define SX126X_DIO3_TCXO_VOLTAGE 1.8
|
||||
@@ -3,11 +3,7 @@
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#define WIFI_Kit_32 true
|
||||
#define DISPLAY_HEIGHT 64
|
||||
#define DISPLAY_WIDTH 128
|
||||
|
||||
static const uint8_t LED_BUILTIN = 35;
|
||||
static const uint8_t LED_BUILTIN = 18;
|
||||
#define BUILTIN_LED LED_BUILTIN // backward compatibility
|
||||
#define LED_BUILTIN LED_BUILTIN
|
||||
|
||||
@@ -65,6 +61,6 @@ static const uint8_t LED = 18;
|
||||
|
||||
static const uint8_t RST_LoRa = 12;
|
||||
static const uint8_t BUSY_LoRa = 13;
|
||||
static const uint8_t DIO0 = 14;
|
||||
static const uint8_t DIO1 = 14;
|
||||
|
||||
#endif /* Pins_Arduino_h */
|
||||
|
||||
@@ -1,14 +1,12 @@
|
||||
#define LED_PIN 18
|
||||
#define BUTTON_PIN 0
|
||||
|
||||
// Enable bus for external periherals
|
||||
// I2C
|
||||
#define I2C_SDA SDA
|
||||
#define I2C_SCL SCL
|
||||
|
||||
// Display (E-Ink)
|
||||
#define USE_EINK
|
||||
|
||||
/*
|
||||
* eink display pins
|
||||
*/
|
||||
#define PIN_EINK_CS 4
|
||||
#define PIN_EINK_BUSY 7
|
||||
#define PIN_EINK_DC 5
|
||||
@@ -16,32 +14,31 @@
|
||||
#define PIN_EINK_SCLK 3
|
||||
#define PIN_EINK_MOSI 2
|
||||
|
||||
/*
|
||||
* SPI interfaces
|
||||
*/
|
||||
// SPI
|
||||
#define SPI_INTERFACES_COUNT 2
|
||||
#define PIN_SPI_MISO 11
|
||||
#define PIN_SPI_MOSI 10
|
||||
#define PIN_SPI_SCK 9
|
||||
|
||||
#define PIN_SPI_MISO 10 // MISO P0.17
|
||||
#define PIN_SPI_MOSI 11 // MOSI P0.15
|
||||
#define PIN_SPI_SCK 9 // SCK P0.13
|
||||
|
||||
#define VEXT_ENABLE 45 // active low, powers the oled display and the lora antenna boost
|
||||
#define BUTTON_PIN 0
|
||||
|
||||
// Power
|
||||
#define VEXT_ENABLE 45 // Active low, powers the E-Ink display
|
||||
#define VEXT_ON_VALUE LOW
|
||||
#define ADC_CTRL 19
|
||||
#define BATTERY_PIN 20
|
||||
#define ADC_CHANNEL ADC2_GPIO20_CHANNEL
|
||||
#define ADC_MULTIPLIER 2 // Voltage divider is roughly 1:1
|
||||
#define BAT_MEASURE_ADC_UNIT 2 // Use ADC2
|
||||
#define ADC_ATTENUATION ADC_ATTEN_DB_11 // Voltage divider output is quite high
|
||||
#define ADC_ATTENUATION ADC_ATTEN_DB_12 // Voltage divider output is quite high
|
||||
#define HAS_32768HZ
|
||||
#define ADC_CTRL_ENABLED LOW
|
||||
|
||||
// LoRa
|
||||
#define USE_SX1262
|
||||
|
||||
#define LORA_DIO0 -1 // a No connect on the SX1262 module
|
||||
#define LORA_DIO0 RADIOLIB_NC // a No connect on the SX1262 module
|
||||
#define LORA_RESET 12
|
||||
#define LORA_DIO1 14 // SX1262 IRQ
|
||||
#define LORA_DIO2 13 // SX1262 BUSY
|
||||
#define LORA_DIO3 // Not connected on PCB, but internally on the TTGO SX1262, if DIO3 is high the TXCO is enabled
|
||||
|
||||
#define LORA_SCK 9
|
||||
#define LORA_MISO 11
|
||||
@@ -54,4 +51,4 @@
|
||||
#define SX126X_RESET LORA_RESET
|
||||
|
||||
#define SX126X_DIO2_AS_RF_SWITCH
|
||||
#define SX126X_DIO3_TCXO_VOLTAGE 1.8
|
||||
#define SX126X_DIO3_TCXO_VOLTAGE 1.8
|
||||
@@ -1,7 +1,7 @@
|
||||
[env:heltec-wireless-tracker]
|
||||
extends = esp32s3_base
|
||||
board = heltec_wireless_tracker
|
||||
upload_protocol = esp-builtin
|
||||
upload_protocol = esptool
|
||||
|
||||
build_flags =
|
||||
${esp32s3_base.build_flags} -I variants/heltec_wireless_tracker
|
||||
@@ -11,4 +11,4 @@ build_flags =
|
||||
|
||||
lib_deps =
|
||||
${esp32s3_base.lib_deps}
|
||||
lovyan03/LovyanGFX@^1.1.8
|
||||
lovyan03/LovyanGFX@^1.1.8
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#define LED_PIN 18
|
||||
|
||||
#define _VARIANT_HELTEC_WIRELESS_TRACKER
|
||||
#define HELTEC_TRACKER_V1_X
|
||||
|
||||
// I2C
|
||||
@@ -15,7 +16,7 @@
|
||||
#define ST7735_RESET 39
|
||||
#define ST7735_MISO -1
|
||||
#define ST7735_BUSY -1
|
||||
#define ST7735_BL_V05 21 /* V1.1 PCB marking */
|
||||
#define TFT_BL 21 /* V1.1 PCB marking */
|
||||
#define ST7735_SPI_HOST SPI3_HOST
|
||||
#define SPI_FREQUENCY 40000000
|
||||
#define SPI_READ_FREQUENCY 16000000
|
||||
@@ -31,15 +32,17 @@
|
||||
// GPS UC6580: GPS V_DET(8), VDD_IO(7), DCDC_IN(21), pulls up RESETN(17), D_SEL(33) and BOOT_MODE(34) through 10kR
|
||||
// GPS LNA SW7125DE: VCC(4), pulls up SHDN(5) through 10kR
|
||||
// LED: VDD, LEDA (through diode)
|
||||
#define VEXT_ENABLE_V05 3 // active HIGH - powers the GPS, GPS LNA and OLED VDD/anode
|
||||
|
||||
#define VEXT_ENABLE 3 // active HIGH - powers the GPS, GPS LNA and OLED
|
||||
#define VEXT_ON_VALUE HIGH
|
||||
#define BUTTON_PIN 0
|
||||
|
||||
#define BATTERY_PIN 1 // A battery voltage measurement pin, voltage divider connected here to measure battery voltage
|
||||
#define ADC_CHANNEL ADC1_GPIO1_CHANNEL
|
||||
#define ADC_ATTENUATION ADC_ATTEN_DB_2_5 // lower dB for high resistance voltage divider
|
||||
#define ADC_MULTIPLIER 4.9 * 1.045
|
||||
#define ADC_CTRL 2 // active HIGH, powers the voltage divider. Only on 1.1
|
||||
#define ADC_CTRL_ENABLED HIGH
|
||||
#define ADC_CTRL 2 // active HIGH, powers the voltage divider. Only on 1.1
|
||||
#define ADC_USE_PULLUP // Use internal pullup/pulldown instead of actively driving the output
|
||||
|
||||
#undef GPS_RX_PIN
|
||||
#undef GPS_TX_PIN
|
||||
@@ -52,6 +55,7 @@
|
||||
|
||||
#define GPS_RESET_MODE LOW
|
||||
#define GPS_UC6580
|
||||
#define GPS_BAUDRATE 115200
|
||||
|
||||
#define USE_SX1262
|
||||
#define LORA_DIO0 -1 // a No connect on the SX1262 module
|
||||
@@ -71,4 +75,4 @@
|
||||
#define SX126X_RESET LORA_RESET
|
||||
|
||||
#define SX126X_DIO2_AS_RF_SWITCH
|
||||
#define SX126X_DIO3_TCXO_VOLTAGE 1.8
|
||||
#define SX126X_DIO3_TCXO_VOLTAGE 1.8
|
||||
@@ -15,7 +15,7 @@
|
||||
#define ST7735_RESET 39
|
||||
#define ST7735_MISO -1
|
||||
#define ST7735_BUSY -1
|
||||
#define ST7735_BL_V03 45
|
||||
#define TFT_BL 45
|
||||
#define ST7735_SPI_HOST SPI3_HOST
|
||||
#define SPI_FREQUENCY 40000000
|
||||
#define SPI_READ_FREQUENCY 16000000
|
||||
@@ -24,11 +24,12 @@
|
||||
#define TFT_WIDTH DISPLAY_HEIGHT
|
||||
#define TFT_OFFSET_X 26
|
||||
#define TFT_OFFSET_Y -1
|
||||
#define VTFT_CTRL_V03 46 // Heltec Tracker needs this pulled low for TFT
|
||||
#define VTFT_CTRL 46 // Heltec Tracker needs this pulled low for TFT
|
||||
#define SCREEN_TRANSITION_FRAMERATE 3 // fps
|
||||
#define DISPLAY_FORCE_SMALL_FONTS
|
||||
|
||||
#define VEXT_ENABLE_V03 Vext // active low, powers the oled display and the lora antenna boost
|
||||
#define VEXT_ENABLE Vext // active low, powers the oled display and the lora antenna boost
|
||||
#define VEXT_ON_VALUE LOW
|
||||
#define BUTTON_PIN 0
|
||||
|
||||
#define BATTERY_PIN 1 // A battery voltage measurement pin, voltage divider connected here to measure battery voltage
|
||||
@@ -43,12 +44,12 @@
|
||||
#define PIN_GPS_RESET 35
|
||||
#define PIN_GPS_PPS 36
|
||||
|
||||
#define VGNSS_CTRL_V03 37 // Heltec Tracker needs this pulled low for GPS
|
||||
#define PIN_GPS_EN VGNSS_CTRL_V03
|
||||
#define PIN_GPS_EN 37 // Heltec Tracker needs this pulled low for GPS
|
||||
#define GPS_EN_ACTIVE LOW
|
||||
|
||||
#define GPS_RESET_MODE LOW
|
||||
#define GPS_UC6580
|
||||
#define GPS_BAUDRATE 115200
|
||||
|
||||
#define USE_SX1262
|
||||
#define LORA_DIO0 -1 // a No connect on the SX1262 module
|
||||
@@ -68,4 +69,4 @@
|
||||
#define SX126X_RESET LORA_RESET
|
||||
|
||||
#define SX126X_DIO2_AS_RF_SWITCH
|
||||
#define SX126X_DIO3_TCXO_VOLTAGE 1.8
|
||||
#define SX126X_DIO3_TCXO_VOLTAGE 1.8
|
||||
@@ -4,6 +4,7 @@
|
||||
#define LED_PIN LED
|
||||
|
||||
#define VEXT_ENABLE Vext // active low, powers the oled display and the lora antenna boost
|
||||
#define VEXT_ON_VALUE LOW
|
||||
#define BUTTON_PIN 0
|
||||
|
||||
#define ADC_CTRL 37
|
||||
@@ -32,4 +33,4 @@
|
||||
#define SX126X_RESET LORA_RESET
|
||||
|
||||
#define SX126X_DIO2_AS_RF_SWITCH
|
||||
#define SX126X_DIO3_TCXO_VOLTAGE 1.8
|
||||
#define SX126X_DIO3_TCXO_VOLTAGE 1.8
|
||||
@@ -1,18 +0,0 @@
|
||||
[env:lora_isp4520]
|
||||
extends = nrf52_base
|
||||
board = lora_isp4520
|
||||
board_level = extra
|
||||
|
||||
# add our variants files to the include and src paths
|
||||
build_flags = ${nrf52_base.build_flags} -Ivariants/lora_isp4520
|
||||
|
||||
# No screen and GPS on the board. We still need RTC.cpp for the RTC clock.
|
||||
build_src_filter = ${nrf52_base.build_src_filter} +<../variants/lora_isp4520> -<graphics> -<gps> +<gps/GPS.cpp> +<gps/RTC.cpp>
|
||||
lib_ignore = ${nrf52_base.lib_ignore}
|
||||
ESP8266_SSD1306
|
||||
SparkFun Ublox Arduino Library
|
||||
AXP202X_Library
|
||||
TinyGPSPlus
|
||||
|
||||
upload_protocol = jlink
|
||||
monitor_port = /dev/ttyUSB0
|
||||
@@ -1,94 +0,0 @@
|
||||
/*
|
||||
Copyright (c) 2014-2015 Arduino LLC. All right reserved.
|
||||
Copyright (c) 2016 Sandeep Mistry All right reserved.
|
||||
Copyright (c) 2018, Adafruit Industries (adafruit.com)
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
See the GNU Lesser General Public License for more details.
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#ifndef _VARIANT_LORA_ISP4520_
|
||||
#define _VARIANT_LORA_ISP4520_
|
||||
|
||||
#define USE_SEGGER
|
||||
/*----------------------------------------------------------------------------
|
||||
* Headers
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
||||
#include "WVariant.h"
|
||||
|
||||
#define USE_LFXO
|
||||
|
||||
// #define USE_SEGGER
|
||||
|
||||
// Number of pins defined in PinDescription array
|
||||
#define PINS_COUNT (16)
|
||||
#define NUM_DIGITAL_PINS (16)
|
||||
#define NUM_ANALOG_INPUTS (1)
|
||||
#define NUM_ANALOG_OUTPUTS (1)
|
||||
|
||||
/*
|
||||
* SPI Interfaces
|
||||
*/
|
||||
#define SPI_INTERFACES_COUNT 1
|
||||
|
||||
// These are in arduino pin numbers,
|
||||
// translation in g_ADigitalPinMap in variants.cpp
|
||||
#define PIN_SPI_MISO (0)
|
||||
#define PIN_SPI_MOSI (9)
|
||||
#define PIN_SPI_SCK (2)
|
||||
|
||||
/*
|
||||
* Wire Interfaces (I2C)
|
||||
*/
|
||||
#define WIRE_INTERFACES_COUNT 0
|
||||
|
||||
// GPIOs the SX1262 is connected
|
||||
#define USE_SX1262
|
||||
#define SX126X_CS 1 // aka SPI_NSS
|
||||
#define SX126X_DIO1 (4)
|
||||
#define SX126X_BUSY (5)
|
||||
#define SX126X_RESET (6)
|
||||
|
||||
/*
|
||||
* Serial interfaces
|
||||
*/
|
||||
#define PIN_SERIAL_RX (10)
|
||||
#define PIN_SERIAL_TX (11)
|
||||
// LEDs
|
||||
#define PIN_LED1 (12)
|
||||
#define PIN_LED2 (13)
|
||||
#define PIN_BUZZER (14)
|
||||
|
||||
#define LED_BUILTIN PIN_LED1
|
||||
#define LED_CONN PIN_LED2
|
||||
|
||||
#define LED_RED PIN_LED1
|
||||
#define LED_BLUE PIN_LED2
|
||||
|
||||
#define LED_STATE_ON 1 // State when LED is litted
|
||||
|
||||
/*
|
||||
* Buttons
|
||||
*/
|
||||
#define PIN_BUTTON1 (15)
|
||||
#define PIN_BUTTON2 (7)
|
||||
#define PIN_BUTTON3 (8)
|
||||
|
||||
// ADC pin and voltage divider
|
||||
#define BATTERY_PIN 3
|
||||
#define ADC_MULTIPLIER 1.436
|
||||
|
||||
#define SX126X_DIO2_AS_RF_SWITCH
|
||||
#define SX126X_DIO3_TCXO_VOLTAGE 1.8 // Not really an E22 but this board clones using DIO3 for tcxo control
|
||||
|
||||
#endif
|
||||
@@ -1,24 +0,0 @@
|
||||
; The https://github.com/BigCorvus/SX1262-LoRa-BLE-Relay board by @BigCorvus
|
||||
[env:lora-relay-v1]
|
||||
extends = nrf52840_base
|
||||
board = lora-relay-v1
|
||||
board_level = extra
|
||||
# add our variants files to the include and src paths
|
||||
# define build flags for the TFT_eSPI library
|
||||
build_flags = ${nrf52840_base.build_flags} -Ivariants/lora_relay_v1
|
||||
-DUSER_SETUP_LOADED
|
||||
-DTFT_WIDTH=80
|
||||
-DTFT_HEIGHT=160
|
||||
-DST7735_GREENTAB160x80
|
||||
-DST7735_DRIVER
|
||||
-DTFT_CS=ST7735_CS
|
||||
-DTFT_DC=ST7735_RS
|
||||
-DTFT_RST=ST7735_RESET
|
||||
-DSPI_FREQUENCY=27000000
|
||||
-L "${platformio.libdeps_dir}/${this.__env__}/bsec2/src/cortex-m4/fpv4-sp-d16-hard"
|
||||
build_src_filter = ${nrf52_base.build_src_filter} +<../variants/lora_relay_v1>
|
||||
lib_deps =
|
||||
${nrf52840_base.lib_deps}
|
||||
sparkfun/SparkFun BQ27441 LiPo Fuel Gauge Arduino Library@^1.1.0
|
||||
bodmer/TFT_eSPI@^2.4.76
|
||||
adafruit/Adafruit NeoPixel @ ^1.12.0
|
||||
@@ -1,105 +0,0 @@
|
||||
/*
|
||||
Copyright (c) 2014-2015 Arduino LLC. All right reserved.
|
||||
Copyright (c) 2016 Sandeep Mistry All right reserved.
|
||||
Copyright (c) 2018, Adafruit Industries (adafruit.com)
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
See the GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#include "variant.h"
|
||||
#include "nrf.h"
|
||||
#include "wiring_constants.h"
|
||||
#include "wiring_digital.h"
|
||||
|
||||
const uint32_t g_ADigitalPinMap[] = {
|
||||
// D0 .. D13
|
||||
25, // D0 is P0.25 (UART TX)
|
||||
24, // D1 is P0.24 (UART RX
|
||||
10, // D2 is P0.10 (NFC2)
|
||||
47, // D3 is P1.15 (LED1)
|
||||
42, // D4 is P1.10 (LED2)
|
||||
40, // D5 is P1.08
|
||||
7, // D6 is P0.07
|
||||
34, // D7 is P1.02 (Button)
|
||||
16, // D8 is P0.16 (NeoPixel)
|
||||
26, // D9 is P0.26 D_RS (IPS data/command control)
|
||||
27, // D10 is P0.27
|
||||
6, // D11 is P0.06 D_RES (IPS display reset)
|
||||
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 BOOST_EN (5V buck converter enable for the the radio power)
|
||||
|
||||
// D14 .. D21 (aka A0 .. A7)
|
||||
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)
|
||||
11, // D23 is P0.11 (SCL)
|
||||
|
||||
// D24 .. D26 (aka SPI pins)
|
||||
15, // D24 is P0.15 (SPI MISO)
|
||||
13, // D25 is P0.13 (SPI MOSI)
|
||||
14, // D26 is P0.14 (SPI SCK )
|
||||
|
||||
// QSPI pins (not exposed via any header / test point)
|
||||
// 19, // P0.19 (QSPI CLK)
|
||||
// 20, // P0.20 (QSPI CS)
|
||||
// 17, // P0.17 (QSPI Data 0)
|
||||
// 22, // P0.22 (QSPI Data 1)
|
||||
// 23, // P0.23 (QSPI Data 2)
|
||||
// 21, // P0.21 (QSPI Data 3)
|
||||
|
||||
// The remaining NFC pin
|
||||
9, // D27 P0.09 (NFC1, exposed only via test point on bottom of board)
|
||||
|
||||
// The following pins were never listed as they were considered unusable
|
||||
// 0, // P0.00 is XL1 (attached to 32.768kHz crystal) Never expose as GPIOs
|
||||
// 1, // P0.01 is XL2 (attached to 32.768kHz crystal)
|
||||
18, // D28 P0.18 is RESET (attached to switch)
|
||||
// 32, // P1.00 is SWO (attached to debug header)
|
||||
|
||||
// D29-D43
|
||||
27, // D29 P0.27 E22-SX1262 DIO1
|
||||
28, // D30 P0.28 E22-SX1262 DIO2
|
||||
30, // D31 P0.30 E22-SX1262 TXEN
|
||||
35, // D32 P1.03 E22-SX1262 NSS
|
||||
32 + 8, // D33 P1.08 E22-SX1262 BUSY
|
||||
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
|
||||
};
|
||||
|
||||
void initVariant()
|
||||
{
|
||||
// LED1 & LED2
|
||||
pinMode(PIN_LED1, OUTPUT);
|
||||
ledOff(PIN_LED1);
|
||||
|
||||
pinMode(PIN_LED2, OUTPUT);
|
||||
ledOff(PIN_LED2);
|
||||
}
|
||||
@@ -1,161 +0,0 @@
|
||||
/*
|
||||
Copyright (c) 2014-2015 Arduino LLC. All right reserved.
|
||||
Copyright (c) 2016 Sandeep Mistry All right reserved.
|
||||
Copyright (c) 2018, Adafruit Industries (adafruit.com)
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
See the GNU Lesser General Public License for more details.
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#ifndef _VARIANT_LORA_RELAY_V1_
|
||||
#define _VARIANT_LORA_RELAY_V1_
|
||||
|
||||
/** Master clock frequency */
|
||||
#define VARIANT_MCK (64000000ul)
|
||||
|
||||
#define USE_LFXO // Board uses 32khz crystal for LF
|
||||
// define USE_LFRC // Board uses RC for LF
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* Headers
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
||||
#include "WVariant.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif // __cplusplus
|
||||
|
||||
// Number of pins defined in PinDescription array
|
||||
#define PINS_COUNT (43)
|
||||
#define NUM_DIGITAL_PINS (43)
|
||||
#define NUM_ANALOG_INPUTS (6) // A6 is used for battery, A7 is analog reference
|
||||
#define NUM_ANALOG_OUTPUTS (0)
|
||||
|
||||
// LEDs
|
||||
#define PIN_LED1 (3)
|
||||
#define PIN_LED2 (4)
|
||||
// #define PIN_NEOPIXEL (8)
|
||||
#define HAS_NEOPIXEL // Enable the use of neopixels
|
||||
#define NEOPIXEL_COUNT 1 // How many neopixels are connected
|
||||
#define NEOPIXEL_DATA 8 // gpio pin used to send data to the neopixels
|
||||
#define NEOPIXEL_TYPE (NEO_GRB + NEO_KHZ800) // type of neopixels in use
|
||||
|
||||
#define LED_BUILTIN PIN_LED1
|
||||
#define LED_CONN PIN_LED2
|
||||
|
||||
#define LED_RED PIN_LED1
|
||||
#define LED_BLUE PIN_LED2
|
||||
|
||||
#define LED_STATE_ON 1 // State when LED is litted
|
||||
|
||||
/*
|
||||
* Buttons
|
||||
*/
|
||||
#define PIN_BUTTON1 (7)
|
||||
|
||||
/*
|
||||
* Analog pins
|
||||
*/
|
||||
#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;
|
||||
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;
|
||||
#define ADC_RESOLUTION 14
|
||||
|
||||
// Other pins
|
||||
#define PIN_AREF PIN_A5
|
||||
#define PIN_VBAT PIN_A4
|
||||
#define BATTERY_PIN PIN_VBAT
|
||||
#define PIN_NFC1 (33)
|
||||
#define PIN_NFC2 (2)
|
||||
#define PIN_PIEZO (37)
|
||||
static const uint8_t AREF = PIN_AREF;
|
||||
|
||||
/*
|
||||
* Serial interfaces
|
||||
*/
|
||||
#define PIN_SERIAL1_RX (1)
|
||||
#define PIN_SERIAL1_TX (0)
|
||||
|
||||
/*
|
||||
* SPI Interfaces
|
||||
*/
|
||||
#define SPI_INTERFACES_COUNT 1
|
||||
|
||||
#define PIN_SPI_MISO (24)
|
||||
#define PIN_SPI_MOSI (25)
|
||||
#define PIN_SPI_SCK (26)
|
||||
|
||||
static const uint8_t SS = (5);
|
||||
static const uint8_t MOSI = PIN_SPI_MOSI;
|
||||
static const uint8_t MISO = PIN_SPI_MISO;
|
||||
static const uint8_t SCK = PIN_SPI_SCK;
|
||||
|
||||
/*
|
||||
* Wire Interfaces
|
||||
*/
|
||||
#define WIRE_INTERFACES_COUNT 1
|
||||
|
||||
#define PIN_WIRE_SDA (22)
|
||||
#define PIN_WIRE_SCL (23)
|
||||
|
||||
// I2C device addresses
|
||||
#define I2C_ADDR_BQ27441 0x55 // Battery gauge
|
||||
|
||||
// SX1262 declaration
|
||||
#define USE_SX1262
|
||||
|
||||
// CUSTOM GPIOs the SX1262
|
||||
#define SX126X_CS (32)
|
||||
|
||||
// If you would prefer to get console debug output over the JTAG ICE connection rather than the CDC-ACM USB serial device, just
|
||||
// define this. #define USE_SEGGER
|
||||
|
||||
#define SX126X_DIO1 (29)
|
||||
#define SX1262_DIO2 (30)
|
||||
#define SX126X_BUSY (33) // Supposed to be P0.18 but because of reworks, now on P0.31 (18)
|
||||
#define SX126X_RESET (34)
|
||||
// #define SX126X_ANT_SW (32 + 10)
|
||||
#define SX126X_RXEN (14)
|
||||
#define SX126X_TXEN (31)
|
||||
#define SX126X_POWER_EN \
|
||||
(15) // FIXME, see warning hre https://github.com/BigCorvus/SX1262-LoRa-BLE-Relay/blob/master/LORA_RELAY_NRF52840.ino
|
||||
// Indicates this SX1262 is inside of an ebyte E22 module and special config should be done for that
|
||||
#define SX126X_DIO3_TCXO_VOLTAGE 1.8
|
||||
|
||||
#define ST7735_RESET (11) // Output
|
||||
#define ST7735_CS (12)
|
||||
#define ST7735_BACKLIGHT_EN (13)
|
||||
#define ST7735_RS (9)
|
||||
|
||||
// #define LORA_DISABLE_SENDING // The board can brownout during lora TX if you don't have a battery connected. Disable sending
|
||||
// to allow USB power only based debugging
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* Arduino objects - C++ only
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
||||
#endif
|
||||
@@ -1,26 +0,0 @@
|
||||
; The https://github.com/BigCorvus/LoRa-BLE-Relay-v2 board by @BigCorvus
|
||||
[env:lora-relay-v2]
|
||||
extends = nrf52840_base
|
||||
board = lora-relay-v2
|
||||
board_level = extra
|
||||
# add our variants files to the include and src paths
|
||||
# define build flags for the TFT_eSPI library
|
||||
build_flags = ${nrf52840_base.build_flags} -Ivariants/lora_relay_v2
|
||||
-DUSER_SETUP_LOADED
|
||||
-DTFT_WIDTH=80
|
||||
-DTFT_HEIGHT=160
|
||||
-DST7735_GREENTAB160x80
|
||||
-DST7735_DRIVER
|
||||
-DTFT_CS=ST7735_CS
|
||||
-DTFT_DC=ST7735_RS
|
||||
-DTFT_RST=ST7735_RESET
|
||||
-DSPI_FREQUENCY=27000000
|
||||
-DTFT_WR=ST7735_SDA
|
||||
-DTFT_SCLK=ST7735_SCK
|
||||
-L "${platformio.libdeps_dir}/${this.__env__}/bsec2/src/cortex-m4/fpv4-sp-d16-hard"
|
||||
build_src_filter = ${nrf52_base.build_src_filter} +<../variants/lora_relay_v2>
|
||||
lib_deps =
|
||||
${nrf52840_base.lib_deps}
|
||||
sparkfun/SparkFun BQ27441 LiPo Fuel Gauge Arduino Library@^1.1.0
|
||||
bodmer/TFT_eSPI@^2.4.76
|
||||
adafruit/Adafruit NeoPixel @ ^1.12.0
|
||||
@@ -1,105 +0,0 @@
|
||||
/*
|
||||
Copyright (c) 2014-2015 Arduino LLC. All right reserved.
|
||||
Copyright (c) 2016 Sandeep Mistry All right reserved.
|
||||
Copyright (c) 2018, Adafruit Industries (adafruit.com)
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
See the GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#include "variant.h"
|
||||
#include "nrf.h"
|
||||
#include "wiring_constants.h"
|
||||
#include "wiring_digital.h"
|
||||
|
||||
const uint32_t g_ADigitalPinMap[] = {
|
||||
// D0 .. D13
|
||||
25, // D0 is P0.25 (UART TX)
|
||||
24, // D1 is P0.24 (UART RX
|
||||
10, // D2 is P0.10 (NFC2)
|
||||
47, // D3 is P1.15 (LED1)
|
||||
(32 + 10), // D4 is P1.10 (LED2)
|
||||
40, // D5 is P1.08
|
||||
7, // D6 is P0.07
|
||||
34, // D7 is P1.02 (Switch)
|
||||
16, // D8 is P0.16 (NeoPixel)
|
||||
26, // D9 is P0.26 D_RS (IPS data/command control)
|
||||
27, // D10 is P0.27
|
||||
6, // D11 is P0.06 D_RES (IPS display reset)
|
||||
8, // D12 is P0.08 D_CS (IPS display chip select)
|
||||
41, // D13 is P0.23 BLT (IPS display backlight)
|
||||
4, // D14 is P0.04 SX1262 RXEN
|
||||
5, // D15 is P0.05 BOOST_EN (5V buck converter enable for the the radio power)
|
||||
|
||||
// D14 .. D21 (aka A0 .. A7)
|
||||
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)
|
||||
11, // D23 is P0.11 (SCL)
|
||||
|
||||
// D24 .. D26 (aka SPI pins)
|
||||
15, // D24 is P0.15 (SPI MISO)
|
||||
13, // D25 is P0.13 (SPI MOSI)
|
||||
14, // D26 is P0.14 (SPI SCK )
|
||||
|
||||
// QSPI pins (not exposed via any header / test point)
|
||||
// 19, // P0.19 (QSPI CLK)
|
||||
// 20, // P0.20 (QSPI CS)
|
||||
// 17, // P0.17 (QSPI Data 0)
|
||||
// 22, // P0.22 (QSPI Data 1)
|
||||
// 23, // P0.23 (QSPI Data 2)
|
||||
// 21, // P0.21 (QSPI Data 3)
|
||||
|
||||
// The remaining NFC pin
|
||||
9, // D27 P0.09 (NFC1, exposed only via test point on bottom of board)
|
||||
|
||||
// The following pins were never listed as they were considered unusable
|
||||
// 0, // P0.00 is XL1 (attached to 32.768kHz crystal) Never expose as GPIOs
|
||||
// 1, // P0.01 is XL2 (attached to 32.768kHz crystal)
|
||||
18, // D28 P0.18 is RESET (attached to switch)
|
||||
// 32, // P1.00 is SWO (attached to debug header)
|
||||
|
||||
// D29-D43
|
||||
32 + 12, // D29 P0.27 E22-SX1262 DIO1
|
||||
28, // D30 P0.28 E22-SX1262 DIO2
|
||||
30, // D31 P0.30 E22-SX1262 TXEN
|
||||
35, // D32 P1.03 E22-SX1262 NSS
|
||||
32 + 8, // D33 P1.08 E22-SX1262 BUSY
|
||||
27, // D34 P0.27 E22-SX1262 RESET
|
||||
32 + 1, // D35 P1.01 BTN_UP
|
||||
32, // D36 P1.0 GPS power
|
||||
21, // D37 P0.21 disp_clk
|
||||
36, // P1.04 BTN_OK
|
||||
37, // D39 P0.19 disp_SDA
|
||||
38, // D40 P1.06 BUZZER
|
||||
39, // P1.07 is not connected per schematic
|
||||
43, // P1.11 is not connected per schematic
|
||||
45, // P1.13 is not connected per schematic
|
||||
};
|
||||
|
||||
void initVariant()
|
||||
{
|
||||
// LED1 & LED2
|
||||
pinMode(PIN_LED1, OUTPUT);
|
||||
ledOff(PIN_LED1);
|
||||
|
||||
pinMode(PIN_LED2, OUTPUT);
|
||||
ledOff(PIN_LED2);
|
||||
}
|
||||
@@ -1,188 +0,0 @@
|
||||
/*
|
||||
Copyright (c) 2014-2015 Arduino LLC. All right reserved.
|
||||
Copyright (c) 2016 Sandeep Mistry All right reserved.
|
||||
Copyright (c) 2018, Adafruit Industries (adafruit.com)
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
See the GNU Lesser General Public License for more details.
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#ifndef _VARIANT_LORA_RELAY_V1_
|
||||
#define _VARIANT_LORA_RELAY_V1_
|
||||
|
||||
/** Master clock frequency */
|
||||
#define VARIANT_MCK (64000000ul)
|
||||
|
||||
#define USE_LFXO // Board uses 32khz crystal for LF
|
||||
// define USE_LFRC // Board uses RC for LF
|
||||
|
||||
/*
|
||||
kevinh todo
|
||||
|
||||
ok leds
|
||||
ok buttons
|
||||
ok gps power
|
||||
ok gps signal
|
||||
ok? lcd
|
||||
ok buzzer
|
||||
serial flash
|
||||
ok lora (inc boost en)
|
||||
|
||||
mention dat1 and dat2 on sd card
|
||||
use hardware spi controller for lcd - not bitbang
|
||||
|
||||
*/
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* Headers
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
||||
#include "WVariant.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif // __cplusplus
|
||||
|
||||
// Number of pins defined in PinDescription array
|
||||
#define PINS_COUNT (43)
|
||||
#define NUM_DIGITAL_PINS (43)
|
||||
#define NUM_ANALOG_INPUTS (6) // A6 is used for battery, A7 is analog reference
|
||||
#define NUM_ANALOG_OUTPUTS (0)
|
||||
|
||||
// LEDs
|
||||
#define PIN_LED1 (3)
|
||||
#define PIN_LED2 (4)
|
||||
// #define PIN_NEOPIXEL (8)
|
||||
#define HAS_NEOPIXEL // Enable the use of neopixels
|
||||
#define NEOPIXEL_COUNT 1 // How many neopixels are connected
|
||||
#define NEOPIXEL_DATA 8 // gpio pin used to send data to the neopixels
|
||||
#define NEOPIXEL_TYPE (NEO_GRB + NEO_KHZ800) // type of neopixels in use
|
||||
|
||||
#define PIN_BUZZER (40)
|
||||
|
||||
#define LED_BUILTIN PIN_LED1
|
||||
#define LED_CONN PIN_LED2
|
||||
|
||||
#define LED_RED PIN_LED1
|
||||
#define LED_BLUE PIN_LED2
|
||||
|
||||
#define LED_STATE_ON 1 // State when LED is litted
|
||||
|
||||
/*
|
||||
* Buttons
|
||||
*/
|
||||
#define PIN_BUTTON1 (7)
|
||||
#define PIN_BUTTON2 (35)
|
||||
#define PIN_BUTTON3 (37)
|
||||
|
||||
/*
|
||||
* Analog pins
|
||||
*/
|
||||
#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;
|
||||
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;
|
||||
#define ADC_RESOLUTION 14
|
||||
|
||||
// Other pins
|
||||
#define PIN_AREF PIN_A5
|
||||
#define PIN_VBAT PIN_A4
|
||||
#define BATTERY_PIN PIN_VBAT
|
||||
#define PIN_NFC1 (33)
|
||||
#define PIN_NFC2 (2)
|
||||
#define PIN_PIEZO (37)
|
||||
static const uint8_t AREF = PIN_AREF;
|
||||
|
||||
/*
|
||||
* Serial interfaces
|
||||
*/
|
||||
#define PIN_SERIAL1_RX (1)
|
||||
#define PIN_SERIAL1_TX (0)
|
||||
|
||||
/*
|
||||
* SPI Interfaces
|
||||
*/
|
||||
#define SPI_INTERFACES_COUNT 1
|
||||
|
||||
#define PIN_SPI_MISO (24)
|
||||
#define PIN_SPI_MOSI (25)
|
||||
#define PIN_SPI_SCK (26)
|
||||
|
||||
static const uint8_t SS = (5);
|
||||
static const uint8_t MOSI = PIN_SPI_MOSI;
|
||||
static const uint8_t MISO = PIN_SPI_MISO;
|
||||
static const uint8_t SCK = PIN_SPI_SCK;
|
||||
|
||||
/*
|
||||
* Wire Interfaces
|
||||
*/
|
||||
#define WIRE_INTERFACES_COUNT 1
|
||||
|
||||
#define PIN_WIRE_SDA (22)
|
||||
#define PIN_WIRE_SCL (23)
|
||||
|
||||
// I2C device addresses
|
||||
#define I2C_ADDR_BQ27441 0x55 // Battery gauge
|
||||
|
||||
// SX1262 declaration
|
||||
#define USE_SX1262
|
||||
|
||||
// CUSTOM GPIOs the SX1262
|
||||
#define SX126X_CS (32)
|
||||
|
||||
// If you would prefer to get console debug output over the JTAG ICE connection rather than the CDC-ACM USB serial device, just
|
||||
// define this. #define USE_SEGGER
|
||||
|
||||
#define SX126X_DIO1 (29)
|
||||
#define SX1262_DIO2 (30)
|
||||
#define SX126X_BUSY (33) // Supposed to be P0.18 but because of reworks, now on P0.31 (18)
|
||||
#define SX126X_RESET (34)
|
||||
// #define SX126X_ANT_SW (32 + 10)
|
||||
#define SX126X_RXEN (14)
|
||||
#define SX126X_TXEN (31)
|
||||
#define SX126X_POWER_EN \
|
||||
(15) // FIXME, see warning hre https://github.com/BigCorvus/SX1262-LoRa-BLE-Relay/blob/master/LORA_RELAY_NRF52840.ino
|
||||
// Indicates this SX1262 is inside of an ebyte E22 module and special config should be done for that
|
||||
#define SX126X_DIO3_TCXO_VOLTAGE 1.8
|
||||
|
||||
// ST7565 SPI
|
||||
#define ST7735_RESET (11) // Output
|
||||
#define ST7735_CS (12)
|
||||
#define ST7735_BACKLIGHT_EN (13)
|
||||
#define ST7735_RS (9)
|
||||
#define ST7735_SDA (39) // actually spi MOSI
|
||||
#define ST7735_SCK (37) // actually spi clk
|
||||
|
||||
#define PIN_GPS_EN 36 // Just kill GPS power when we want it to sleep? FIXME
|
||||
#define GPS_EN_ACTIVE 0 // GPS Power output is active low
|
||||
|
||||
// #define LORA_DISABLE_SENDING // The board can brownout during lora TX if you don't have a battery connected. Disable sending
|
||||
// to allow USB power only based debugging
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* Arduino objects - C++ only
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
||||
#endif
|
||||
@@ -10,7 +10,7 @@
|
||||
// #define GPS_TX_PIN 32 (now used by SX1262 BUSY as GPS works with just RX)
|
||||
|
||||
// Green LED
|
||||
#define LED_INVERTED 0
|
||||
#define LED_STATE_ON 1 // State when LED is lit
|
||||
#define LED_PIN 10
|
||||
|
||||
#include "pcf8563.h"
|
||||
@@ -106,4 +106,4 @@
|
||||
// GND
|
||||
// https://github.com/m5stack/M5Core-Ink/blob/master/examples/Basics/FactoryTest/FactoryTest.ino#L58
|
||||
#define ADC_MULTIPLIER 5
|
||||
// https://embeddedexplorer.com/esp32-adc-esp-idf-tutorial/
|
||||
// https://embeddedexplorer.com/esp32-adc-esp-idf-tutorial/
|
||||
63
variants/m5stack_cores3/pins_arduino.h
Normal file
63
variants/m5stack_cores3/pins_arduino.h
Normal file
@@ -0,0 +1,63 @@
|
||||
#ifndef Pins_Arduino_h
|
||||
#define Pins_Arduino_h
|
||||
|
||||
#include "soc/soc_caps.h"
|
||||
#include <stdint.h>
|
||||
|
||||
#define USB_VID 0x303a
|
||||
#define USB_PID 0x1001
|
||||
|
||||
// Some boards have too low voltage on this pin (board design bug)
|
||||
// Use different pin with 3V and connect with 48
|
||||
// and change this setup for the chosen pin (for example 38)
|
||||
static const uint8_t LED_BUILTIN = SOC_GPIO_PIN_COUNT + 48;
|
||||
#define BUILTIN_LED LED_BUILTIN // backward compatibility
|
||||
#define LED_BUILTIN LED_BUILTIN
|
||||
#define RGB_BUILTIN LED_BUILTIN
|
||||
#define RGB_BRIGHTNESS 64
|
||||
|
||||
static const uint8_t TX = 43;
|
||||
static const uint8_t RX = 44;
|
||||
|
||||
static const uint8_t TXD2 = 17;
|
||||
static const uint8_t RXD2 = 18;
|
||||
|
||||
static const uint8_t SDA = 12;
|
||||
static const uint8_t SCL = 11;
|
||||
|
||||
static const uint8_t SS = 15;
|
||||
static const uint8_t MOSI = 37;
|
||||
static const uint8_t MISO = 35;
|
||||
static const uint8_t SCK = 36;
|
||||
|
||||
static const uint8_t G0 = 0;
|
||||
static const uint8_t G1 = 1;
|
||||
static const uint8_t G2 = 2;
|
||||
static const uint8_t G3 = 3;
|
||||
static const uint8_t G4 = 4;
|
||||
static const uint8_t G5 = 5;
|
||||
static const uint8_t G6 = 6;
|
||||
static const uint8_t G7 = 7;
|
||||
static const uint8_t G8 = 8;
|
||||
static const uint8_t G9 = 9;
|
||||
static const uint8_t G11 = 11;
|
||||
static const uint8_t G12 = 12;
|
||||
static const uint8_t G13 = 13;
|
||||
static const uint8_t G14 = 14;
|
||||
static const uint8_t G17 = 17;
|
||||
static const uint8_t G18 = 18;
|
||||
static const uint8_t G19 = 19;
|
||||
static const uint8_t G20 = 20;
|
||||
static const uint8_t G21 = 21;
|
||||
static const uint8_t G33 = 33;
|
||||
static const uint8_t G34 = 34;
|
||||
static const uint8_t G35 = 35;
|
||||
static const uint8_t G36 = 36;
|
||||
static const uint8_t G37 = 37;
|
||||
static const uint8_t G38 = 38;
|
||||
static const uint8_t G45 = 45;
|
||||
static const uint8_t G46 = 46;
|
||||
|
||||
static const uint8_t ADC = 10;
|
||||
|
||||
#endif /* Pins_Arduino_h */
|
||||
14
variants/m5stack_cores3/platformio.ini
Normal file
14
variants/m5stack_cores3/platformio.ini
Normal file
@@ -0,0 +1,14 @@
|
||||
; M5stack CoreS3
|
||||
[env:m5stack-cores3]
|
||||
extends = esp32s3_base
|
||||
board = m5stack-cores3
|
||||
board_check = true
|
||||
upload_protocol = esptool
|
||||
|
||||
build_flags = ${esp32_base.build_flags}
|
||||
-DPRIVATE_HW
|
||||
-DM5STACK_CORES3
|
||||
-Ivariants/m5stack_cores3
|
||||
|
||||
lib_deps =
|
||||
${esp32_base.lib_deps}
|
||||
22
variants/m5stack_cores3/variant.h
Normal file
22
variants/m5stack_cores3/variant.h
Normal file
@@ -0,0 +1,22 @@
|
||||
#define I2C_SDA 12
|
||||
#define I2C_SCL 11
|
||||
|
||||
#undef LORA_SCK
|
||||
#undef LORA_MISO
|
||||
#undef LORA_MOSI
|
||||
#undef LORA_CS
|
||||
|
||||
#define LORA_SCK 36
|
||||
#define LORA_MISO 35
|
||||
#define LORA_MOSI 37
|
||||
#define LORA_CS 6 // NSS
|
||||
|
||||
#define USE_RF95
|
||||
#define LORA_DIO0 14 // IRQ
|
||||
#define LORA_RESET 5 // RESET
|
||||
#define LORA_RST 5 // RESET
|
||||
#define LORA_IRQ 14 // DIO0
|
||||
#define LORA_DIO1 RADIOLIB_NC // Not really used
|
||||
#define LORA_DIO2 RADIOLIB_NC // Not really used
|
||||
|
||||
#define HAS_AXP2101
|
||||
@@ -1,5 +1,6 @@
|
||||
; MonteOps M.Node/M.Backbone/M.Eagle hardware based on hardware variant #1 (RAK4630 based)
|
||||
[env:monteops_hw1]
|
||||
board_level = extra
|
||||
extends = nrf52840_base
|
||||
board = wiscore_rak4631
|
||||
build_flags = ${nrf52840_base.build_flags} -Ivariants/monteops_hw1 -D MONTEOPS_HW1
|
||||
|
||||
@@ -54,7 +54,6 @@ extern "C" {
|
||||
#define LED_CONN PIN_GREEN
|
||||
|
||||
#define LED_STATE_ON 0 // State when LED is lit
|
||||
// #define LED_INVERTED 1
|
||||
|
||||
/*
|
||||
* Buttons
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
; The NRF52840-dk development board, but @geeksville's board - which has a busted oscilliator
|
||||
[env:nrf52840dk-geeksville]
|
||||
board_level = extra
|
||||
extends = nrf52840_base
|
||||
board = nrf52840_dk_modified
|
||||
# add our variants files to the include and src paths
|
||||
build_flags = ${nrf52_base.build_flags} -Ivariants/pca10056-rc-clock
|
||||
-L "${platformio.libdeps_dir}/${this.__env__}/bsec2/src/cortex-m4/fpv4-sp-d16-hard"
|
||||
build_src_filter = ${nrf52_base.build_src_filter} +<../variants/pca10056-rc-clock>
|
||||
@@ -1,162 +0,0 @@
|
||||
/*
|
||||
Copyright (c) 2014-2015 Arduino LLC. All right reserved.
|
||||
Copyright (c) 2016 Sandeep Mistry All right reserved.
|
||||
Copyright (c) 2018, Adafruit Industries (adafruit.com)
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
See the GNU Lesser General Public License for more details.
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#ifndef _VARIANT_PCA10056_
|
||||
#define _VARIANT_PCA10056_
|
||||
|
||||
/** Master clock frequency */
|
||||
#define VARIANT_MCK (64000000ul)
|
||||
|
||||
// This file is the same as the standard pac10056 variant, except that @geeksville broke the xtal on his devboard so
|
||||
// he has to use a RC clock.
|
||||
|
||||
// #define USE_LFXO // Board uses 32khz crystal for LF
|
||||
#define USE_LFRC // Board uses RC for LF
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* Headers
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
||||
#include "WVariant.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif // __cplusplus
|
||||
|
||||
// Number of pins defined in PinDescription array
|
||||
#define PINS_COUNT (48)
|
||||
#define NUM_DIGITAL_PINS (48)
|
||||
#define NUM_ANALOG_INPUTS (6)
|
||||
#define NUM_ANALOG_OUTPUTS (0)
|
||||
|
||||
// LEDs
|
||||
#define PIN_LED1 (13)
|
||||
#define PIN_LED2 (14)
|
||||
|
||||
#define LED_BUILTIN PIN_LED1
|
||||
#define LED_CONN PIN_LED2
|
||||
|
||||
#define LED_RED PIN_LED1
|
||||
#define LED_BLUE PIN_LED2
|
||||
|
||||
#define LED_STATE_ON 0 // State when LED is litted
|
||||
|
||||
/*
|
||||
* Buttons
|
||||
*/
|
||||
#define PIN_BUTTON1 11
|
||||
#define PIN_BUTTON2 12
|
||||
#define PIN_BUTTON3 24
|
||||
#define PIN_BUTTON4 25
|
||||
|
||||
/*
|
||||
* Analog pins
|
||||
*/
|
||||
#define PIN_A0 (3)
|
||||
#define PIN_A1 (4)
|
||||
#define PIN_A2 (28)
|
||||
#define PIN_A3 (29)
|
||||
#define PIN_A4 (30)
|
||||
#define PIN_A5 (31)
|
||||
#define PIN_A6 (0xff)
|
||||
#define PIN_A7 (0xff)
|
||||
|
||||
static const uint8_t A0 = PIN_A0;
|
||||
static const uint8_t A1 = PIN_A1;
|
||||
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 (2)
|
||||
#define PIN_NFC1 (9)
|
||||
#define PIN_NFC2 (10)
|
||||
|
||||
static const uint8_t AREF = PIN_AREF;
|
||||
|
||||
/*
|
||||
* Serial interfaces
|
||||
*/
|
||||
|
||||
// Arduino Header D0, D1
|
||||
#define PIN_SERIAL1_RX (33) // P1.01
|
||||
#define PIN_SERIAL1_TX (34) // P1.02
|
||||
|
||||
// Connected to Jlink CDC
|
||||
#define PIN_SERIAL2_RX (8)
|
||||
#define PIN_SERIAL2_TX (6)
|
||||
|
||||
/*
|
||||
* SPI Interfaces
|
||||
*/
|
||||
#define SPI_INTERFACES_COUNT 1
|
||||
|
||||
#define PIN_SPI_MISO (46)
|
||||
#define PIN_SPI_MOSI (45)
|
||||
#define PIN_SPI_SCK (47)
|
||||
|
||||
static const uint8_t SS = 44;
|
||||
static const uint8_t MOSI = PIN_SPI_MOSI;
|
||||
static const uint8_t MISO = PIN_SPI_MISO;
|
||||
static const uint8_t SCK = PIN_SPI_SCK;
|
||||
|
||||
/*
|
||||
* Wire Interfaces
|
||||
*/
|
||||
#define WIRE_INTERFACES_COUNT 1
|
||||
|
||||
#define PIN_WIRE_SDA (26)
|
||||
#define PIN_WIRE_SCL (27)
|
||||
|
||||
// QSPI Pins
|
||||
#define PIN_QSPI_SCK 19
|
||||
#define PIN_QSPI_CS 17
|
||||
#define PIN_QSPI_IO0 20
|
||||
#define PIN_QSPI_IO1 21
|
||||
#define PIN_QSPI_IO2 22
|
||||
#define PIN_QSPI_IO3 23
|
||||
|
||||
// On-board QSPI Flash
|
||||
#define EXTERNAL_FLASH_DEVICES MX25R6435F
|
||||
#define EXTERNAL_FLASH_USE_QSPI
|
||||
|
||||
// CUSTOM GPIOs the SX1262MB2CAS shield when installed on the NRF52840-DK development board
|
||||
#define USE_SX1262
|
||||
#define SX126X_CS (32 + 8) // P1.08
|
||||
#define SX126X_DIO1 (32 + 6) // P1.06
|
||||
#define SX126X_BUSY (32 + 4) // P1.04
|
||||
#define SX126X_RESET (0 + 3) // P0.03
|
||||
#define SX126X_ANT_SW (32 + 10) // P1.10
|
||||
#define SX126X_DIO2_AS_RF_SWITCH
|
||||
|
||||
// To debug via the segger JLINK console rather than the CDC-ACM serial device
|
||||
// #define USE_SEGGER
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* Arduino objects - C++ only
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
||||
#endif
|
||||
@@ -37,7 +37,7 @@
|
||||
#define ST7789_MISO -1
|
||||
#define ST7789_BUSY -1
|
||||
#define ST7789_SPI_HOST SPI3_HOST
|
||||
#define ST7789_BACKLIGHT_EN 5
|
||||
#define TFT_BL 5
|
||||
#define SPI_FREQUENCY 40000000
|
||||
#define SPI_READ_FREQUENCY 16000000
|
||||
#define TFT_HEIGHT 320
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#define HAS_SCREEN 1
|
||||
#define CANNED_MESSAGE_MODULE_ENABLE 1
|
||||
#define HAS_GPS 1
|
||||
#define MAX_NUM_NODES settingsMap[maxnodes]
|
||||
#define RADIOLIB_GODMODE 1
|
||||
#define MAX_RX_TOPHONE settingsMap[maxtophone]
|
||||
#define MAX_NUM_NODES settingsMap[maxnodes]
|
||||
@@ -1,8 +0,0 @@
|
||||
; The PPR board
|
||||
[env:ppr]
|
||||
extends = nrf52_base
|
||||
board = ppr
|
||||
board_level = extra
|
||||
lib_deps =
|
||||
${arduino_base.lib_deps}
|
||||
industruino/UC1701@^1.1.0
|
||||
@@ -1,159 +0,0 @@
|
||||
/*
|
||||
Copyright (c) 2014-2015 Arduino LLC. All right reserved.
|
||||
Copyright (c) 2016 Sandeep Mistry All right reserved.
|
||||
Copyright (c) 2018, Adafruit Industries (adafruit.com)
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
See the GNU Lesser General Public License for more details.
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
/** Master clock frequency */
|
||||
#define VARIANT_MCK (64000000ul)
|
||||
|
||||
// This board does not have a 32khz crystal
|
||||
// #define USE_LFXO // Board uses 32khz crystal for LF
|
||||
#define USE_LFRC // Board uses RC for LF
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* Headers
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
||||
#include "WVariant.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif // __cplusplus
|
||||
|
||||
// Number of pins defined in PinDescription array
|
||||
#define PINS_COUNT (46)
|
||||
#define NUM_DIGITAL_PINS (46)
|
||||
#define NUM_ANALOG_INPUTS (0)
|
||||
#define NUM_ANALOG_OUTPUTS (0)
|
||||
|
||||
// LEDs
|
||||
#define PIN_LED1 (0)
|
||||
#define PIN_LED2 (1)
|
||||
|
||||
#define LED_BUILTIN PIN_LED1
|
||||
#define LED_CONN PIN_LED2
|
||||
|
||||
#define LED_RED PIN_LED1
|
||||
#define LED_GREEN PIN_LED2
|
||||
|
||||
// FIXME, bluefruit automatically blinks this led while connected. call AdafruitBluefruit::autoConnLed to change this.
|
||||
#define LED_BLUE LED_GREEN
|
||||
|
||||
#define LED_STATE_ON 1 // State when LED is litted
|
||||
|
||||
/*
|
||||
* Buttons
|
||||
*/
|
||||
#define PIN_BUTTON1 4 // center
|
||||
#define PIN_BUTTON2 2
|
||||
#define PIN_BUTTON3 3
|
||||
#define PIN_BUTTON4 5
|
||||
#define PIN_BUTTON5 6
|
||||
|
||||
/*
|
||||
* Analog pins
|
||||
*/
|
||||
#define PIN_A0 (0xff)
|
||||
#define PIN_A1 (0xff)
|
||||
#define PIN_A2 (0xff)
|
||||
#define PIN_A3 (0xff)
|
||||
#define PIN_A4 (0xff)
|
||||
#define PIN_A5 (0xff)
|
||||
#define PIN_A6 (0xff)
|
||||
#define PIN_A7 (0xff)
|
||||
|
||||
static const uint8_t A0 = PIN_A0;
|
||||
static const uint8_t A1 = PIN_A1;
|
||||
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 (0xff)
|
||||
// #define PIN_NFC1 (9)
|
||||
// #define PIN_NFC2 (10)
|
||||
|
||||
static const uint8_t AREF = PIN_AREF;
|
||||
|
||||
/*
|
||||
* Serial interfaces
|
||||
*/
|
||||
|
||||
// GPS is on Serial1
|
||||
#define PIN_SERIAL1_RX (8)
|
||||
#define PIN_SERIAL1_TX (9)
|
||||
|
||||
// Connected to Jlink CDC
|
||||
// #define PIN_SERIAL2_RX (8)
|
||||
// #define PIN_SERIAL2_TX (6)
|
||||
|
||||
/*
|
||||
* SPI Interfaces
|
||||
*/
|
||||
#define SPI_INTERFACES_COUNT 1
|
||||
|
||||
#define PIN_SPI_MISO (15)
|
||||
#define PIN_SPI_MOSI (13)
|
||||
#define PIN_SPI_SCK (12)
|
||||
|
||||
// static const uint8_t SS = 44;
|
||||
static const uint8_t MOSI = PIN_SPI_MOSI;
|
||||
static const uint8_t MISO = PIN_SPI_MISO;
|
||||
static const uint8_t SCK = PIN_SPI_SCK;
|
||||
|
||||
/*
|
||||
* Wire Interfaces
|
||||
*/
|
||||
#define WIRE_INTERFACES_COUNT 1
|
||||
|
||||
#define PIN_WIRE_SDA (32 + 2)
|
||||
#define PIN_WIRE_SCL (32)
|
||||
|
||||
// CUSTOM GPIOs the SX1262
|
||||
#define USE_SX1262
|
||||
#define SX126X_CS (10)
|
||||
#define SX126X_DIO1 (20)
|
||||
#define SX1262_DIO2 (26)
|
||||
#define SX126X_BUSY (31) // Supposed to be P0.18 but because of reworks, now on P0.31 (18)
|
||||
#define SX126X_RESET (17)
|
||||
// #define SX126X_ANT_SW (32 + 10)
|
||||
#define SX126X_RXEN (22)
|
||||
#define SX126X_TXEN (24)
|
||||
// Indicates this SX1262 is inside of an ebyte E22 module and special config should be done for that
|
||||
#define SX126X_DIO3_TCXO_VOLTAGE 1.8
|
||||
|
||||
// ERC12864-10 LCD
|
||||
#define ERC12864_CS (32 + 4)
|
||||
#define ERC12864_RESET (32 + 6)
|
||||
#define ERC12864_CD (32 + 9)
|
||||
|
||||
// L80 GPS
|
||||
#define L80_PPS (28)
|
||||
#define L80_RESET (29)
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* Arduino objects - C++ only
|
||||
*----------------------------------------------------------------------------*/
|
||||
@@ -1,9 +0,0 @@
|
||||
; The PPR board
|
||||
[env:ppr1]
|
||||
extends = nrf52_base
|
||||
board = ppr1
|
||||
board_level = extra
|
||||
build_flags = ${nrf52_base.build_flags} -Ivariants/ppr1
|
||||
build_src_filter = ${nrf52_base.build_src_filter} +<../variants/ppr1>
|
||||
lib_deps =
|
||||
${arduino_base.lib_deps}
|
||||
@@ -1,179 +0,0 @@
|
||||
/*
|
||||
Copyright (c) 2014-2015 Arduino LLC. All right reserved.
|
||||
Copyright (c) 2016 Sandeep Mistry All right reserved.
|
||||
Copyright (c) 2018, Adafruit Industries (adafruit.com)
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
See the GNU Lesser General Public License for more details.
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
/** Master clock frequency */
|
||||
#define VARIANT_MCK (64000000ul)
|
||||
|
||||
// This board does have a 32khz crystal
|
||||
#define USE_LFXO // Board uses 32khz crystal for LF
|
||||
// #define USE_LFRC // Board uses RC for LF
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* Headers
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
||||
#include "WVariant.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif // __cplusplus
|
||||
|
||||
// Number of pins defined in PinDescription array
|
||||
#define PINS_COUNT (46)
|
||||
#define NUM_DIGITAL_PINS (46)
|
||||
#define NUM_ANALOG_INPUTS (0)
|
||||
#define NUM_ANALOG_OUTPUTS (0)
|
||||
|
||||
// LEDs
|
||||
#define PIN_LED1 (25)
|
||||
#define PIN_LED2 (11)
|
||||
|
||||
#define LED_BUILTIN PIN_LED1
|
||||
#define LED_CONN PIN_LED2
|
||||
|
||||
#define LED_RED PIN_LED1
|
||||
#define LED_GREEN PIN_LED2
|
||||
|
||||
// FIXME, bluefruit automatically blinks this led while connected. call AdafruitBluefruit::autoConnLed to change this.
|
||||
#define LED_BLUE LED_GREEN
|
||||
|
||||
#define LED_STATE_ON 1 // State when LED is litted
|
||||
|
||||
/*
|
||||
* Buttons
|
||||
*/
|
||||
#define PIN_BUTTON1 4 // up
|
||||
#define PIN_BUTTON2 2 // left
|
||||
#define PIN_BUTTON3 3 // center
|
||||
#define PIN_BUTTON4 5 // right
|
||||
#define PIN_BUTTON5 6 // down
|
||||
|
||||
/*
|
||||
* Analog pins
|
||||
*/
|
||||
#define PIN_A0 (0xff)
|
||||
#define PIN_A1 (0xff)
|
||||
#define PIN_A2 (0xff)
|
||||
#define PIN_A3 (0xff)
|
||||
#define PIN_A4 (0xff)
|
||||
#define PIN_A5 (0xff)
|
||||
#define PIN_A6 (0xff)
|
||||
#define PIN_A7 (0xff)
|
||||
|
||||
static const uint8_t A0 = PIN_A0;
|
||||
static const uint8_t A1 = PIN_A1;
|
||||
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 (0xff)
|
||||
// #define PIN_NFC1 (9)
|
||||
// #define PIN_NFC2 (10)
|
||||
|
||||
static const uint8_t AREF = PIN_AREF;
|
||||
|
||||
/*
|
||||
* Serial interfaces
|
||||
*/
|
||||
|
||||
// GPS is on Serial1
|
||||
#define PIN_SERIAL1_RX (8)
|
||||
#define PIN_SERIAL1_TX (9)
|
||||
|
||||
// We intentionally leave this undefined so we don't even try to make a Ublox driver
|
||||
// #define GPS_TX_PIN PIN_SERIAL1_TX
|
||||
// #define GPS_RX_PIN PIN_SERIAL1_RX
|
||||
|
||||
#define PIN_GPS_RESET 29 // active high
|
||||
#define PIN_GPS_PPS 28
|
||||
// #define PIN_GPS_WAKE 20 // CELL_CTRL in schematic? based on their example code
|
||||
#define PIN_GPS_EN 7 // GPS_EN active high
|
||||
|
||||
// #define PIN_VUSB_EN 21
|
||||
|
||||
// LCD
|
||||
|
||||
#define PIN_LCD_RESET 23 // active low, pulse low for 20ms at boot
|
||||
#define USE_ST7567
|
||||
|
||||
/// Charge controller I2C address
|
||||
#define BQ25703A_ADDR 0x6b
|
||||
|
||||
// Define if screen should be mirrored left to right
|
||||
#define SCREEN_MIRROR
|
||||
|
||||
// LCD screens are slow, so slowdown the wipe so it looks better
|
||||
#define SCREEN_TRANSITION_FRAMERATE 10 // fps
|
||||
|
||||
/*
|
||||
* SPI Interfaces
|
||||
*/
|
||||
#define SPI_INTERFACES_COUNT 1
|
||||
|
||||
#define PIN_SPI_MISO (15)
|
||||
#define PIN_SPI_MOSI (13)
|
||||
#define PIN_SPI_SCK (12)
|
||||
|
||||
// static const uint8_t SS = 44;
|
||||
static const uint8_t MOSI = PIN_SPI_MOSI;
|
||||
static const uint8_t MISO = PIN_SPI_MISO;
|
||||
static const uint8_t SCK = PIN_SPI_SCK;
|
||||
|
||||
/*
|
||||
* Wire Interfaces
|
||||
*/
|
||||
#define WIRE_INTERFACES_COUNT 1
|
||||
|
||||
#define PIN_WIRE_SDA (32 + 2)
|
||||
#define PIN_WIRE_SCL (32)
|
||||
|
||||
// CUSTOM GPIOs the SX1262
|
||||
#define USE_SX1262
|
||||
#define SX126X_CS (0 + 10) // FIXME - we really should define LORA_CS instead
|
||||
#define SX126X_DIO1 (0 + 20)
|
||||
#define SX1262_DIO2 (0 + 26)
|
||||
#define SX126X_BUSY (0 + 19)
|
||||
#define SX126X_RESET (0 + 17)
|
||||
#define SX126X_TXEN (0 + 24)
|
||||
#define SX126X_RXEN (0 + 22)
|
||||
// Not really an E22 but this board clones using DIO3 for tcxo control
|
||||
#define SX126X_DIO3_TCXO_VOLTAGE 1.8
|
||||
|
||||
// FIXME, to prevent burning out parts I've set the power level super low, because I don't have
|
||||
// an antenna wired up
|
||||
#define SX126X_MAX_POWER 1
|
||||
|
||||
#define LORA_DISABLE_SENDING // Define this to disable transmission for testing (power testing etc...)
|
||||
|
||||
// To debug via the segger JLINK console rather than the CDC-ACM serial device
|
||||
// #define USE_SEGGER
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* Arduino objects - C++ only
|
||||
*----------------------------------------------------------------------------*/
|
||||
14
variants/radiomaster_900_bandit/platformio.ini
Normal file
14
variants/radiomaster_900_bandit/platformio.ini
Normal file
@@ -0,0 +1,14 @@
|
||||
[env:radiomaster_900_bandit]
|
||||
extends = esp32_base
|
||||
board = esp32doit-devkit-v1
|
||||
build_flags =
|
||||
${esp32_base.build_flags}
|
||||
-DRADIOMASTER_900_BANDIT
|
||||
-DVTABLES_IN_FLASH=1
|
||||
-DCONFIG_DISABLE_HAL_LOCKS=1
|
||||
-O2
|
||||
-Ivariants/radiomaster_900_bandit
|
||||
board_build.f_cpu = 240000000L
|
||||
upload_protocol = esptool
|
||||
lib_deps =
|
||||
${esp32_base.lib_deps}
|
||||
126
variants/radiomaster_900_bandit/variant.h
Normal file
126
variants/radiomaster_900_bandit/variant.h
Normal file
@@ -0,0 +1,126 @@
|
||||
/*
|
||||
Initial settings and work by https://github.com/gjelsoe
|
||||
Unit provided by Radio Master RC
|
||||
https://radiomasterrc.com/products/bandit-expresslrs-rf-module with 1.29" OLED display CH1115 driver
|
||||
*/
|
||||
|
||||
/*
|
||||
On this model then screen is NOT upside down, don't flip it for the user.
|
||||
*/
|
||||
#undef DISPLAY_FLIP_SCREEN
|
||||
|
||||
/*
|
||||
I2C SDA and SCL.
|
||||
0x18 - STK8XXX Accelerometer
|
||||
0x3C - SH1115 Display Driver
|
||||
*/
|
||||
#define I2C_SDA 14
|
||||
#define I2C_SCL 12
|
||||
|
||||
/*
|
||||
I2C STK8XXX Accelerometer Interrupt PIN to ESP32 Pin 6 - SENSOR_CAPP (GPIO37)
|
||||
*/
|
||||
#define STK8XXX_INT 37
|
||||
|
||||
/*
|
||||
No GPS - but free pins are available.
|
||||
*/
|
||||
#define HAS_GPS 0
|
||||
#undef GPS_RX_PIN
|
||||
#undef GPS_TX_PIN
|
||||
|
||||
/*
|
||||
Pin connections from ESP32-D0WDQ6 to SX1276.
|
||||
*/
|
||||
#define LORA_DIO0 22
|
||||
#define LORA_DIO1 21
|
||||
#define LORA_SCK 18
|
||||
#define LORA_MISO 19
|
||||
#define LORA_MOSI 23
|
||||
#define LORA_CS 4
|
||||
#define LORA_RESET 5
|
||||
#define LORA_TXEN 33
|
||||
|
||||
/*
|
||||
This unit has a FAN built-in.
|
||||
FAN is active at 250mW on it's ExpressLRS Firmware.
|
||||
This FAN has TACHO signal on Pin 27 for use with PWM.
|
||||
*/
|
||||
#define RF95_FAN_EN 2
|
||||
|
||||
/*
|
||||
LED PIN setup and it has a NeoPixel LED.
|
||||
It's possible to setup colors for Button 1 and 2,
|
||||
look at BUTTON1_COLOR, BUTTON1_COLOR_INDEX, BUTTON2_COLOR and BUTTON2_COLOR_INDEX
|
||||
this is done here for now.
|
||||
*/
|
||||
#define HAS_NEOPIXEL // Enable the use of neopixels
|
||||
#define NEOPIXEL_COUNT 6 // How many neopixels are connected
|
||||
#define NEOPIXEL_DATA 15 // GPIO pin used to send data to the neopixels
|
||||
#define NEOPIXEL_TYPE (NEO_GRB + NEO_KHZ800) // Type of neopixels in use
|
||||
#define ENABLE_AMBIENTLIGHTING // Turn on Ambient Lighting
|
||||
// #define BUTTON1_COLOR 0xFF0000 // Background light for Button 1 in HEX RGB Color (RadioMaster Bandit only).
|
||||
// #define BUTTON1_COLOR_INDEX 0 // NeoPixel Index ID for Button 1
|
||||
// #define BUTTON2_COLOR 0x0000FF // Background light for Button 2 in HEX RGB Color (RadioMaster Bandit only).
|
||||
// #define BUTTON2_COLOR_INDEX 1 // NeoPixel Index ID for Button 2
|
||||
|
||||
/*
|
||||
It has 1 x five-way and 2 x normal buttons.
|
||||
|
||||
Button GPIO RGB Index
|
||||
---------------------------
|
||||
Five-way 39 -
|
||||
Button 1 34 0
|
||||
Button 2 35 1
|
||||
|
||||
Five way button when using ADC.
|
||||
2.632V, 2.177V, 1.598V, 1.055V, 0V
|
||||
|
||||
ADC Values:
|
||||
{ UP, DOWN, LEFT, RIGHT, ENTER, IDLE }
|
||||
3227, 0 ,1961, 2668, 1290, 4095
|
||||
|
||||
Five way button when using ADC.
|
||||
https://github.com/ExpressLRS/targets/blob/f3215b5ec891108db1a13523e4163950cfcadaac/TX/Radiomaster%20Bandit.json#L41
|
||||
|
||||
*/
|
||||
#define INPUTBROKER_EXPRESSLRSFIVEWAY_TYPE
|
||||
#define PIN_JOYSTICK 39
|
||||
#define JOYSTICK_ADC_VALS /*UP*/ 3227, /*DOWN*/ 0, /*LEFT*/ 1961, /*RIGHT*/ 2668, /*OK*/ 1290, /*IDLE*/ 4095
|
||||
|
||||
/*
|
||||
Normal Button Pin setup.
|
||||
*/
|
||||
#define BUTTON_PIN 34
|
||||
#define BUTTON_NEED_PULLUP
|
||||
|
||||
/*
|
||||
No External notification.
|
||||
*/
|
||||
#undef EXT_NOTIFY_OUT
|
||||
|
||||
/*
|
||||
Remapping PIN Names.
|
||||
Note, that this unit uses RFO
|
||||
*/
|
||||
#define USE_RF95
|
||||
#define USE_RF95_RFO
|
||||
#define RF95_CS LORA_CS
|
||||
#define RF95_DIO1 LORA_DIO1
|
||||
#define RF95_TXEN LORA_TXEN
|
||||
#define RF95_RESET LORA_RESET
|
||||
#define RF95_MAX_POWER 10
|
||||
|
||||
/*
|
||||
This module has Skyworks SKY66122 controlled by dacWrite
|
||||
power ranging from 100mW to 1000mW.
|
||||
|
||||
Mapping of PA_LEVEL to Power output: GPIO26/dacWrite
|
||||
168 -> 100mW
|
||||
155 -> 250mW
|
||||
142 -> 500mW
|
||||
110 -> 1000mW
|
||||
*/
|
||||
#define RF95_PA_EN 26
|
||||
#define RF95_PA_DAC_EN
|
||||
#define RF95_PA_LEVEL 110
|
||||
@@ -41,16 +41,13 @@
|
||||
|
||||
/*
|
||||
Five way button when using ADC.
|
||||
2.632V, 2.177V, 1.598V, 1.055V, 0V
|
||||
|
||||
Possible ADC Values:
|
||||
{ UP, DOWN, LEFT, RIGHT, ENTER, IDLE }
|
||||
3227, 0 ,1961, 2668, 1290, 4095
|
||||
https://github.com/ExpressLRS/targets/blob/f3215b5ec891108db1a13523e4163950cfcadaac/TX/Radiomaster%20Bandit.json#L41
|
||||
*/
|
||||
#define BUTTON_PIN 39
|
||||
#define BUTTON_NEED_PULLUP
|
||||
#define INPUTBROKER_EXPRESSLRSFIVEWAY_TYPE
|
||||
#define PIN_JOYSTICK 39
|
||||
#define JOYSTICK_ADC_VALS /*UP*/ 3227, /*DOWN*/ 0, /*LEFT*/ 1961, /*RIGHT*/ 2668, /*OK*/ 1290, /*IDLE*/ 4095
|
||||
|
||||
#define SCREEN_ROTATE
|
||||
#define DISPLAY_FLIP_SCREEN
|
||||
|
||||
/*
|
||||
No External notification.
|
||||
@@ -81,4 +78,4 @@
|
||||
*/
|
||||
#define RF95_PA_EN 26
|
||||
#define RF95_PA_DAC_EN
|
||||
#define RF95_PA_LEVEL 90
|
||||
#define RF95_PA_LEVEL 90
|
||||
|
||||
@@ -70,11 +70,12 @@ static const uint8_t SCK = 33;
|
||||
#define LORA_CS SS
|
||||
|
||||
#define USE_SX1262
|
||||
#define SX126X_ANT_SW WB_IO3
|
||||
#define SX126X_CS SS // NSS for SX126X
|
||||
#define SX126X_DIO1 LORA_DIO1
|
||||
#define SX126X_BUSY LORA_DIO2
|
||||
#define SX126X_RESET LORA_RESET
|
||||
#define SX126X_POWER_EN WB_IO3
|
||||
#define SX126X_POWER_EN WB_IO2
|
||||
// DIO2 controlls an antenna switch and the TCXO voltage is controlled by DIO3
|
||||
#define SX126X_DIO2_AS_RF_SWITCH
|
||||
#define SX126X_DIO3_TCXO_VOLTAGE 1.8
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
extends = rp2040_base
|
||||
board = wiscore_rak11300
|
||||
upload_protocol = picotool
|
||||
# keep an old SDK to use less memory.
|
||||
platform_packages = framework-arduinopico@https://github.com/earlephilhower/arduino-pico.git#3.7.2
|
||||
|
||||
# add our variants files to the include and src paths
|
||||
build_flags = ${rp2040_base.build_flags}
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
|
||||
#define LED_CONN PIN_LED2
|
||||
#define LED_PIN LED_BUILTIN
|
||||
#define ledOff(pin) pinMode(pin, INPUT)
|
||||
|
||||
#define BUTTON_PIN 9
|
||||
#define BUTTON_NEED_PULLUP
|
||||
|
||||
@@ -6,6 +6,7 @@ board_check = true
|
||||
build_flags = ${nrf52840_base.build_flags} -Ivariants/rak2560 -D RAK_4631
|
||||
-L "${platformio.libdeps_dir}/${this.__env__}/bsec2/src/cortex-m4/fpv4-sp-d16-hard"
|
||||
-DGPS_POWER_TOGGLE ; comment this line to disable triple press function on the user button to turn off gps entirely.
|
||||
-DMESHTASTIC_EXCLUDE_GPS=1
|
||||
-DHAS_RAKPROT=1 ; Define if RAk OneWireSerial is used (disables GPS)
|
||||
build_src_filter = ${nrf52_base.build_src_filter} +<../variants/rak2560> +<mesh/eth/> +<mesh/api/> +<mqtt/>
|
||||
lib_deps =
|
||||
|
||||
@@ -227,7 +227,7 @@ SO GPIO 39/TXEN MAY NOT BE DEFINED FOR SUCCESSFUL OPERATION OF THE SX1262 - TG
|
||||
// #define GPS_TX_PIN PIN_SERIAL2_TX
|
||||
// #define PIN_GPS_EN PIN_3V3_EN
|
||||
// Disable GPS
|
||||
#define MESHTASTIC_EXCLUDE_GPS 1
|
||||
// #define MESHTASTIC_EXCLUDE_GPS 1
|
||||
// Define pin to enable GPS toggle (set GPIO to LOW) via user button triple press
|
||||
|
||||
// RAK12002 RTC Module
|
||||
|
||||
34
variants/rak3172/platformio.ini
Normal file
34
variants/rak3172/platformio.ini
Normal file
@@ -0,0 +1,34 @@
|
||||
[env:rak3172]
|
||||
extends = stm32_base
|
||||
board = wiscore_rak3172
|
||||
build_flags =
|
||||
${stm32_base.build_flags}
|
||||
-Ivariants/rak3172
|
||||
-DSERIAL_UART_INSTANCE=1
|
||||
-DPIN_SERIAL_RX=PB7
|
||||
-DPIN_SERIAL_TX=PB6
|
||||
-DHAL_DAC_MODULE_ONLY
|
||||
-DHAL_ADC_MODULE_DISABLED
|
||||
-DHAL_COMP_MODULE_DISABLED
|
||||
-DHAL_CRC_MODULE_DISABLED
|
||||
-DHAL_CRYP_MODULE_DISABLED
|
||||
-DHAL_GTZC_MODULE_DISABLED
|
||||
-DHAL_HSEM_MODULE_DISABLED
|
||||
-DHAL_I2C_MODULE_DISABLED
|
||||
-DHAL_I2S_MODULE_DISABLED
|
||||
-DHAL_IPCC_MODULE_DISABLED
|
||||
-DHAL_IRDA_MODULE_DISABLED
|
||||
-DHAL_IWDG_MODULE_DISABLED
|
||||
-DHAL_LPTIM_MODULE_DISABLED
|
||||
-DHAL_PKA_MODULE_DISABLED
|
||||
-DHAL_RNG_MODULE_DISABLED
|
||||
-DHAL_RTC_MODULE_DISABLED
|
||||
-DHAL_SMARTCARD_MODULE_DISABLED
|
||||
-DHAL_SMBUS_MODULE_DISABLED
|
||||
-DHAL_TIM_MODULE_DISABLED
|
||||
-DHAL_WWDG_MODULE_DISABLED
|
||||
-DHAL_EXTI_MODULE_DISABLED
|
||||
-DRADIOLIB_EXCLUDE_SX128X=1
|
||||
-DRADIOLIB_EXCLUDE_SX127X=1
|
||||
-DRADIOLIB_EXCLUDE_LR11X0=1
|
||||
upload_port = stlink
|
||||
12
variants/rak3172/variant.h
Normal file
12
variants/rak3172/variant.h
Normal file
@@ -0,0 +1,12 @@
|
||||
/*
|
||||
This variant is a work in progress.
|
||||
Do not expect a working Meshtastic device with this target.
|
||||
*/
|
||||
|
||||
#ifndef _VARIANT_RAK3172_
|
||||
#define _VARIANT_RAK3172_
|
||||
|
||||
#define USE_STM32WLx
|
||||
#define MAX_NUM_NODES 10
|
||||
|
||||
#endif
|
||||
@@ -9,6 +9,9 @@ build_flags = ${nrf52840_base.build_flags} -Ivariants/rak4631 -D RAK_4631
|
||||
-DEINK_DISPLAY_MODEL=GxEPD2_213_BN
|
||||
-DEINK_WIDTH=250
|
||||
-DEINK_HEIGHT=122
|
||||
-DRADIOLIB_EXCLUDE_SX128X=1
|
||||
-DRADIOLIB_EXCLUDE_SX127X=1
|
||||
-DRADIOLIB_EXCLUDE_LR11X0=1
|
||||
build_src_filter = ${nrf52_base.build_src_filter} +<../variants/rak4631> +<mesh/eth/> +<mesh/api/> +<mqtt/>
|
||||
lib_deps =
|
||||
${nrf52840_base.lib_deps}
|
||||
@@ -16,9 +19,7 @@ lib_deps =
|
||||
melopero/Melopero RV3028@^1.1.0
|
||||
https://github.com/RAKWireless/RAK13800-W5100S.git#1.0.2
|
||||
rakwireless/RAKwireless NCP5623 RGB LED library@^1.0.2
|
||||
https://github.com/meshtastic/RAK12034-BMX160.git#4821355fb10390ba8557dc43ca29a023bcfbb9d9
|
||||
debug_tool = jlink
|
||||
|
||||
https://github.com/RAKWireless/RAK12034-BMX160.git#dcead07ffa267d3c906e9ca4a1330ab989e957e2
|
||||
|
||||
; If not set we will default to uploading over serial (first it forces bootloader entry by talking 1200bps to cdcacm)
|
||||
; Note: as of 6/2013 the serial/bootloader based programming takes approximately 30 seconds
|
||||
@@ -27,26 +28,28 @@ debug_tool = jlink
|
||||
; Allows programming and debug via the RAK NanoDAP as the default debugger tool for the RAK4631 (it is only $10!)
|
||||
; programming time is about the same as the bootloader version.
|
||||
; For information on this see the meshtastic developers documentation for "Development on the NRF52"
|
||||
[env:rak4631_dap]
|
||||
[env:rak4631_dbg]
|
||||
extends = env:rak4631
|
||||
board_level = extra
|
||||
; pyocd pack --i nrf52840
|
||||
; eventually use platformio/tool-pyocd@^2.3600.0 instad
|
||||
upload_protocol = custom
|
||||
upload_command = pyocd flash -t nrf52840 $UPLOADERFLAGS $SOURCE
|
||||
|
||||
; Only reprogram the board if the code has changed
|
||||
debug_load_mode = modified
|
||||
;debug_load_mode = manual
|
||||
debug_tool = custom
|
||||
; We manually pass in the elf file so that pyocd can reverse engineer FreeRTOS data (running threads, etc...)
|
||||
debug_server =
|
||||
pyocd
|
||||
gdbserver
|
||||
-t
|
||||
nrf52840
|
||||
--elf
|
||||
${platformio.build_dir}/${this.__env__}/firmware.elf
|
||||
; The following is not needed because it automatically tries do this
|
||||
;debug_server_ready_pattern = -.*GDB server started on port \d+.*
|
||||
;debug_port = localhost:3333
|
||||
; if the builtin version of openocd has a buggy version of semihosting, so use the external version
|
||||
; platform_packages = platformio/tool-openocd@^3.1200.0
|
||||
|
||||
build_flags =
|
||||
${env:rak4631.build_flags}
|
||||
-D USE_SEMIHOSTING
|
||||
|
||||
lib_deps =
|
||||
${env:rak4631.lib_deps}
|
||||
https://github.com/geeksville/Armduino-Semihosting.git#35b538fdf208c3530c1434cd099a08e486672ee4
|
||||
|
||||
; NOTE: the pyocd support for semihosting is buggy. So I switched to using the builtin platformio support for the stlink adapter which worked much better.
|
||||
; However the built in openocd version in platformio has buggy support for TCP to semihosting.
|
||||
;
|
||||
; So I'm now trying the external openocd - but the openocd scripts for nrf52.cfg assume you are using a DAP adapter not an STLINK adapter.
|
||||
; In theory I could change those scripts. But for now I'm trying going back to a DAP adapter but with the external openocd.
|
||||
|
||||
upload_protocol = stlink
|
||||
; eventually use platformio/tool-pyocd@^2.3600.0 instad
|
||||
;upload_protocol = custom
|
||||
;upload_command = pyocd flash -t nrf52840 $UPLOADERFLAGS $SOURCE
|
||||
@@ -7,6 +7,9 @@ build_flags = ${nrf52840_base.build_flags} -Ivariants/rak4631_epaper -D RAK_4631
|
||||
-DEINK_DISPLAY_MODEL=GxEPD2_213_BN
|
||||
-DEINK_WIDTH=250
|
||||
-DEINK_HEIGHT=122
|
||||
-DRADIOLIB_EXCLUDE_SX128X=1
|
||||
-DRADIOLIB_EXCLUDE_SX127X=1
|
||||
-DRADIOLIB_EXCLUDE_LR11X0=1
|
||||
build_src_filter = ${nrf52_base.build_src_filter} +<../variants/rak4631_epaper>
|
||||
lib_deps =
|
||||
${nrf52840_base.lib_deps}
|
||||
|
||||
@@ -9,6 +9,9 @@ build_flags = ${nrf52840_base.build_flags} -Ivariants/rak4631_epaper -D RAK_4631
|
||||
-D EINK_DISPLAY_MODEL=GxEPD2_213_BN
|
||||
-D EINK_WIDTH=250
|
||||
-D EINK_HEIGHT=122
|
||||
-D RADIOLIB_EXCLUDE_SX128X=1
|
||||
-D RADIOLIB_EXCLUDE_SX127X=1
|
||||
-D RADIOLIB_EXCLUDE_LR11X0=1
|
||||
build_src_filter = ${nrf52_base.build_src_filter} +<../variants/rak4631_epaper_onrxtx>
|
||||
lib_deps =
|
||||
${nrf52840_base.lib_deps}
|
||||
|
||||
66
variants/rak4631_eth_gw/platformio.ini
Normal file
66
variants/rak4631_eth_gw/platformio.ini
Normal file
@@ -0,0 +1,66 @@
|
||||
; The very slick RAK wireless RAK 4631 / 4630 board - Unified firmware for 5005/19003, with or without OLED RAK 1921
|
||||
[env:rak4631_eth_gw]
|
||||
extends = nrf52840_base
|
||||
board = wiscore_rak4631
|
||||
board_check = true
|
||||
build_flags = ${nrf52840_base.build_flags} -Ivariants/rak4631_eth_gw -D RAK_4631
|
||||
-L "${platformio.libdeps_dir}/${this.__env__}/bsec2/src/cortex-m4/fpv4-sp-d16-hard"
|
||||
-DGPS_POWER_TOGGLE ; comment this line to disable triple press function on the user button to turn off gps entirely.
|
||||
-DEINK_DISPLAY_MODEL=GxEPD2_213_BN
|
||||
-DEINK_WIDTH=250
|
||||
-DEINK_HEIGHT=122
|
||||
-DNRF52_USE_JSON=1
|
||||
-DMESHTASTIC_EXCLUDE_GPS=1
|
||||
-DMESHTASTIC_EXCLUDE_WIFI=1
|
||||
-DMESHTASTIC_EXCLUDE_SCREEN=1
|
||||
; -DMESHTASTIC_EXCLUDE_PKI=1
|
||||
-DMESHTASTIC_EXCLUDE_POWER_FSM=1
|
||||
-DMESHTASTIC_EXCLUDE_POWERMON=1
|
||||
; -DMESHTASTIC_EXCLUDE_TZ=1
|
||||
-DMESHTASTIC_EXCLUDE_EXTERNALNOTIFICATION=1
|
||||
-DMESHTASTIC_EXCLUDE_PAXCOUNTER=1
|
||||
-DMESHTASTIC_EXCLUDE_REMOTEHARDWARE=1
|
||||
-DMESHTASTIC_EXCLUDE_STOREFORWARD=1
|
||||
-DMESHTASTIC_EXCLUDE_CANNEDMESSAGES=1
|
||||
-DMESHTASTIC_EXCLUDE_WAYPOINT=1
|
||||
build_src_filter = ${nrf52_base.build_src_filter} +<../variants/rak4631_eth_gw> +<mesh/eth/> +<mesh/api/> +<mqtt/>
|
||||
lib_deps =
|
||||
${nrf52840_base.lib_deps}
|
||||
${networking_base.lib_deps}
|
||||
melopero/Melopero RV3028@^1.1.0
|
||||
https://github.com/RAKWireless/RAK13800-W5100S.git#1.0.2
|
||||
rakwireless/RAKwireless NCP5623 RGB LED library@^1.0.2
|
||||
https://github.com/meshtastic/RAK12034-BMX160.git#4821355fb10390ba8557dc43ca29a023bcfbb9d9
|
||||
bblanchon/ArduinoJson @ 6.21.4
|
||||
; If not set we will default to uploading over serial (first it forces bootloader entry by talking 1200bps to cdcacm)
|
||||
; Note: as of 6/2013 the serial/bootloader based programming takes approximately 30 seconds
|
||||
;upload_protocol = jlink
|
||||
|
||||
; Allows programming and debug via the RAK NanoDAP as the default debugger tool for the RAK4631 (it is only $10!)
|
||||
; programming time is about the same as the bootloader version.
|
||||
; For information on this see the meshtastic developers documentation for "Development on the NRF52"
|
||||
[env:rak4631_eth_gw_dbg]
|
||||
extends = env:rak4631
|
||||
board_level = extra
|
||||
|
||||
; if the builtin version of openocd has a buggy version of semihosting, so use the external version
|
||||
; platform_packages = platformio/tool-openocd@^3.1200.0
|
||||
|
||||
build_flags =
|
||||
${env:rak4631_eth_gw.build_flags}
|
||||
-D USE_SEMIHOSTING
|
||||
|
||||
lib_deps =
|
||||
${env:rak4631_eth_gw.lib_deps}
|
||||
https://github.com/geeksville/Armduino-Semihosting.git#35b538fdf208c3530c1434cd099a08e486672ee4
|
||||
|
||||
; NOTE: the pyocd support for semihosting is buggy. So I switched to using the builtin platformio support for the stlink adapter which worked much better.
|
||||
; However the built in openocd version in platformio has buggy support for TCP to semihosting.
|
||||
;
|
||||
; So I'm now trying the external openocd - but the openocd scripts for nrf52.cfg assume you are using a DAP adapter not an STLINK adapter.
|
||||
; In theory I could change those scripts. But for now I'm trying going back to a DAP adapter but with the external openocd.
|
||||
|
||||
upload_protocol = stlink
|
||||
; eventually use platformio/tool-pyocd@^2.3600.0 instad
|
||||
;upload_protocol = custom
|
||||
;upload_command = pyocd flash -t nrf52840 $UPLOADERFLAGS $SOURCE
|
||||
@@ -38,5 +38,8 @@ void initVariant()
|
||||
|
||||
pinMode(PIN_LED2, OUTPUT);
|
||||
ledOff(PIN_LED2);
|
||||
;
|
||||
|
||||
// 3V3 Power Rail
|
||||
pinMode(PIN_3V3_EN, OUTPUT);
|
||||
digitalWrite(PIN_3V3_EN, HIGH);
|
||||
}
|
||||
273
variants/rak4631_eth_gw/variant.h
Normal file
273
variants/rak4631_eth_gw/variant.h
Normal file
@@ -0,0 +1,273 @@
|
||||
/*
|
||||
Copyright (c) 2014-2015 Arduino LLC. All right reserved.
|
||||
Copyright (c) 2016 Sandeep Mistry All right reserved.
|
||||
Copyright (c) 2018, Adafruit Industries (adafruit.com)
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
See the GNU Lesser General Public License for more details.
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#ifndef _VARIANT_RAK4630_
|
||||
#define _VARIANT_RAK4630_
|
||||
|
||||
#define RAK4630
|
||||
|
||||
/** Master clock frequency */
|
||||
#define VARIANT_MCK (64000000ul)
|
||||
|
||||
#define USE_LFXO // Board uses 32khz crystal for LF
|
||||
// define USE_LFRC // Board uses RC for LF
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* Headers
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
||||
#include "WVariant.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif // __cplusplus
|
||||
|
||||
// Number of pins defined in PinDescription array
|
||||
#define PINS_COUNT (48)
|
||||
#define NUM_DIGITAL_PINS (48)
|
||||
#define NUM_ANALOG_INPUTS (6)
|
||||
#define NUM_ANALOG_OUTPUTS (0)
|
||||
|
||||
// LEDs
|
||||
#define PIN_LED1 (35)
|
||||
#define PIN_LED2 (36)
|
||||
|
||||
#define LED_BUILTIN PIN_LED1
|
||||
#define LED_CONN PIN_LED2
|
||||
|
||||
#define LED_GREEN PIN_LED1
|
||||
#define LED_BLUE PIN_LED2
|
||||
|
||||
#define LED_STATE_ON 1 // State when LED is litted
|
||||
|
||||
/*
|
||||
* Buttons
|
||||
*/
|
||||
|
||||
#define PIN_BUTTON1 9 // Pin for button on E-ink button module or IO expansion
|
||||
#define BUTTON_NEED_PULLUP
|
||||
#define PIN_BUTTON2 12
|
||||
#define PIN_BUTTON3 24
|
||||
#define PIN_BUTTON4 25
|
||||
|
||||
/*
|
||||
* Analog pins
|
||||
*/
|
||||
#define PIN_A0 (5)
|
||||
#define PIN_A1 (31)
|
||||
#define PIN_A2 (28)
|
||||
#define PIN_A3 (29)
|
||||
#define PIN_A4 (30)
|
||||
#define PIN_A5 (31)
|
||||
#define PIN_A6 (0xff)
|
||||
#define PIN_A7 (0xff)
|
||||
|
||||
static const uint8_t A0 = PIN_A0;
|
||||
static const uint8_t A1 = PIN_A1;
|
||||
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 (2)
|
||||
#define PIN_NFC1 (9)
|
||||
#define PIN_NFC2 (10)
|
||||
|
||||
static const uint8_t AREF = PIN_AREF;
|
||||
|
||||
/*
|
||||
* Serial interfaces
|
||||
*/
|
||||
#define PIN_SERIAL1_RX (15)
|
||||
#define PIN_SERIAL1_TX (16)
|
||||
|
||||
// Connected to Jlink CDC
|
||||
#define PIN_SERIAL2_RX (8)
|
||||
#define PIN_SERIAL2_TX (6)
|
||||
|
||||
/*
|
||||
* SPI Interfaces
|
||||
*/
|
||||
#define SPI_INTERFACES_COUNT 2
|
||||
|
||||
#define PIN_SPI_MISO (45)
|
||||
#define PIN_SPI_MOSI (44)
|
||||
#define PIN_SPI_SCK (43)
|
||||
|
||||
#define PIN_SPI1_MISO (29) // (0 + 29)
|
||||
#define PIN_SPI1_MOSI (30) // (0 + 30)
|
||||
#define PIN_SPI1_SCK (3) // (0 + 3)
|
||||
|
||||
static const uint8_t SS = 42;
|
||||
static const uint8_t MOSI = PIN_SPI_MOSI;
|
||||
static const uint8_t MISO = PIN_SPI_MISO;
|
||||
static const uint8_t SCK = PIN_SPI_SCK;
|
||||
|
||||
/*
|
||||
* eink display pins
|
||||
*/
|
||||
|
||||
#define PIN_EINK_CS (0 + 26)
|
||||
#define PIN_EINK_BUSY (0 + 4)
|
||||
#define PIN_EINK_DC (0 + 17)
|
||||
#define PIN_EINK_RES (-1)
|
||||
#define PIN_EINK_SCLK (0 + 3)
|
||||
#define PIN_EINK_MOSI (0 + 30) // also called SDI
|
||||
|
||||
// #define USE_EINK
|
||||
|
||||
// RAKRGB
|
||||
#define HAS_NCP5623
|
||||
|
||||
/*
|
||||
* Wire Interfaces
|
||||
*/
|
||||
#define WIRE_INTERFACES_COUNT 1
|
||||
|
||||
#define PIN_WIRE_SDA (13)
|
||||
#define PIN_WIRE_SCL (14)
|
||||
|
||||
// QSPI Pins
|
||||
#define PIN_QSPI_SCK 3
|
||||
#define PIN_QSPI_CS 26
|
||||
#define PIN_QSPI_IO0 30
|
||||
#define PIN_QSPI_IO1 29
|
||||
#define PIN_QSPI_IO2 28
|
||||
#define PIN_QSPI_IO3 2
|
||||
|
||||
// On-board QSPI Flash
|
||||
#define EXTERNAL_FLASH_DEVICES IS25LP080D
|
||||
#define EXTERNAL_FLASH_USE_QSPI
|
||||
|
||||
/* @note RAK5005-O GPIO mapping to RAK4631 GPIO ports
|
||||
RAK5005-O <-> nRF52840
|
||||
IO1 <-> P0.17 (Arduino GPIO number 17)
|
||||
IO2 <-> P1.02 (Arduino GPIO number 34)
|
||||
IO3 <-> P0.21 (Arduino GPIO number 21)
|
||||
IO4 <-> P0.04 (Arduino GPIO number 4)
|
||||
IO5 <-> P0.09 (Arduino GPIO number 9)
|
||||
IO6 <-> P0.10 (Arduino GPIO number 10)
|
||||
IO7 <-> P0.28 (Arduino GPIO number 28)
|
||||
SW1 <-> P0.01 (Arduino GPIO number 1)
|
||||
A0 <-> P0.04/AIN2 (Arduino Analog A2
|
||||
A1 <-> P0.31/AIN7 (Arduino Analog A7
|
||||
SPI_CS <-> P0.26 (Arduino GPIO number 26)
|
||||
*/
|
||||
|
||||
// RAK4630 LoRa module
|
||||
|
||||
/* Setup of the SX1262 LoRa module ( https://docs.rakwireless.com/Product-Categories/WisBlock/RAK4631/Datasheet/ )
|
||||
|
||||
P1.10 NSS SPI NSS (Arduino GPIO number 42)
|
||||
P1.11 SCK SPI CLK (Arduino GPIO number 43)
|
||||
P1.12 MOSI SPI MOSI (Arduino GPIO number 44)
|
||||
P1.13 MISO SPI MISO (Arduino GPIO number 45)
|
||||
P1.14 BUSY BUSY signal (Arduino GPIO number 46)
|
||||
P1.15 DIO1 DIO1 event interrupt (Arduino GPIO number 47)
|
||||
P1.06 NRESET NRESET manual reset of the SX1262 (Arduino GPIO number 38)
|
||||
|
||||
Important for successful SX1262 initialization:
|
||||
|
||||
* Setup DIO2 to control the antenna switch
|
||||
* Setup DIO3 to control the TCXO power supply
|
||||
* Setup the SX1262 to use it's DCDC regulator and not the LDO
|
||||
* RAK4630 schematics show GPIO P1.07 connected to the antenna switch, but it should not be initialized, as DIO2 will do the
|
||||
control of the antenna switch
|
||||
|
||||
SO GPIO 39/TXEN MAY NOT BE DEFINED FOR SUCCESSFUL OPERATION OF THE SX1262 - TG
|
||||
|
||||
*/
|
||||
|
||||
#define DETECTION_SENSOR_EN 4
|
||||
|
||||
#define USE_SX1262
|
||||
#define SX126X_CS (42)
|
||||
#define SX126X_DIO1 (47)
|
||||
#define SX126X_BUSY (46)
|
||||
#define SX126X_RESET (38)
|
||||
// #define SX126X_TXEN (39)
|
||||
// #define SX126X_RXEN (37)
|
||||
#define SX126X_POWER_EN (37)
|
||||
// DIO2 controlls an antenna switch and the TCXO voltage is controlled by DIO3
|
||||
#define SX126X_DIO2_AS_RF_SWITCH
|
||||
#define SX126X_DIO3_TCXO_VOLTAGE 1.8
|
||||
|
||||
// Testing USB detection
|
||||
#define NRF_APM
|
||||
|
||||
// enables 3.3V periphery like GPS or IO Module
|
||||
// Do not toggle this for GPS power savings
|
||||
#define PIN_3V3_EN (34)
|
||||
|
||||
// RAK1910 GPS module
|
||||
// If using the wisblock GPS module and pluged into Port A on WisBlock base
|
||||
// IO1 is hooked to PPS (pin 12 on header) = gpio 17
|
||||
// IO2 is hooked to GPS RESET = gpio 34, but it can not be used to this because IO2 is ALSO used to control 3V3_S power (1 is on).
|
||||
// Therefore must be 1 to keep peripherals powered
|
||||
// Power is on the controllable 3V3_S rail
|
||||
// #define PIN_GPS_RESET (34)
|
||||
// #define PIN_GPS_EN PIN_3V3_EN
|
||||
#define PIN_GPS_PPS (17) // Pulse per second input from the GPS
|
||||
|
||||
#define GPS_RX_PIN PIN_SERIAL1_RX
|
||||
#define GPS_TX_PIN PIN_SERIAL1_TX
|
||||
|
||||
// Define pin to enable GPS toggle (set GPIO to LOW) via user button triple press
|
||||
|
||||
// RAK12002 RTC Module
|
||||
#define RV3028_RTC (uint8_t)0b1010010
|
||||
|
||||
// RAK18001 Buzzer in Slot C
|
||||
// #define PIN_BUZZER 21 // IO3 is PWM2
|
||||
// NEW: set this via protobuf instead!
|
||||
|
||||
// Battery
|
||||
// The battery sense is hooked to pin A0 (5)
|
||||
#define BATTERY_PIN PIN_A0
|
||||
// and has 12 bit resolution
|
||||
#define BATTERY_SENSE_RESOLUTION_BITS 12
|
||||
#define BATTERY_SENSE_RESOLUTION 4096.0
|
||||
#undef AREF_VOLTAGE
|
||||
#define AREF_VOLTAGE 3.0
|
||||
#define VBAT_AR_INTERNAL AR_INTERNAL_3_0
|
||||
#define ADC_MULTIPLIER 1.73
|
||||
|
||||
#define HAS_RTC 1
|
||||
|
||||
#define HAS_ETHERNET 1
|
||||
|
||||
#define RAK_4631 1
|
||||
|
||||
#define PIN_ETHERNET_RESET 21
|
||||
#define PIN_ETHERNET_SS PIN_EINK_CS
|
||||
#define ETH_SPI_PORT SPI1
|
||||
#define AQ_SET_PIN 10
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* Arduino objects - C++ only
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
||||
#endif
|
||||
@@ -15,7 +15,7 @@
|
||||
// rxd = 9
|
||||
|
||||
#define EXT_NOTIFY_OUT 22
|
||||
#define BUTTON_PIN 17
|
||||
#undef BUTTON_PIN // Pin 17 used for antenna switching via DIO4
|
||||
|
||||
#define LED_PIN PIN_LED
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
// ratio of voltage divider = 3.0 (R17=200k, R18=100k)
|
||||
// #define ADC_MULTIPLIER 3.1 // 3.0 + a bit for being optimistic
|
||||
|
||||
#define HAS_CPU_SHUTDOWN 1
|
||||
#define USE_SX1262
|
||||
|
||||
#undef LORA_SCK
|
||||
@@ -32,23 +33,28 @@
|
||||
|
||||
// https://www.waveshare.com/rp2040-lora.htm
|
||||
// https://www.waveshare.com/img/devkit/RP2040-LoRa-HF/RP2040-LoRa-HF-details-11.jpg
|
||||
#define LORA_SCK 14 // 10
|
||||
#define LORA_MISO 24 // 12
|
||||
#define LORA_MOSI 15 // 11
|
||||
#define LORA_CS 13 // 3
|
||||
#define LORA_SCK 14 // GPIO14
|
||||
#define LORA_MISO 24 // GPIO24
|
||||
#define LORA_MOSI 15 // GPIO15
|
||||
#define LORA_CS 13 // GPIO13
|
||||
|
||||
#define LORA_DIO0 RADIOLIB_NC
|
||||
#define LORA_RESET 23 // 15
|
||||
#define LORA_DIO1 16 // 20
|
||||
#define LORA_DIO2 18 // 2
|
||||
#define LORA_DIO3 RADIOLIB_NC
|
||||
#define LORA_DIO4 17
|
||||
#define LORA_DIO0 RADIOLIB_NC // No GPIO connection
|
||||
#define LORA_RESET 23 // GPIO23
|
||||
#define LORA_BUSY 18 // GPIO18
|
||||
#define LORA_DIO1 16 // GPIO16
|
||||
#define LORA_DIO2 RADIOLIB_NC // Antenna switching, no GPIO connection
|
||||
#define LORA_DIO3 RADIOLIB_NC // No GPIO connection
|
||||
#define LORA_DIO4 17 // GPIO17
|
||||
|
||||
// On rp2040-lora board the antenna switch is wired and works with complementary-pin control logic.
|
||||
// See PE4259 datasheet page 4
|
||||
|
||||
#ifdef USE_SX1262
|
||||
#define SX126X_CS LORA_CS
|
||||
#define SX126X_DIO1 LORA_DIO1
|
||||
#define SX126X_BUSY LORA_DIO2
|
||||
#define SX126X_BUSY LORA_BUSY
|
||||
#define SX126X_RESET LORA_RESET
|
||||
#define SX126X_DIO2_AS_RF_SWITCH
|
||||
#define SX126X_DIO2_AS_RF_SWITCH // Antenna switch CTRL
|
||||
#define SX126X_POWER_EN LORA_DIO4 // Antenna switch !CTRL via GPIO17
|
||||
// #define SX126X_DIO3_TCXO_VOLTAGE 1.8
|
||||
#endif
|
||||
#endif
|
||||
|
||||
16
variants/rpipico2/platformio.ini
Normal file
16
variants/rpipico2/platformio.ini
Normal file
@@ -0,0 +1,16 @@
|
||||
[env:pico2]
|
||||
extends = rp2350_base
|
||||
board = rpipico2
|
||||
upload_protocol = picotool
|
||||
|
||||
# add our variants files to the include and src paths
|
||||
build_flags = ${rp2350_base.build_flags}
|
||||
-DRPI_PICO2
|
||||
-Ivariants/rpipico2
|
||||
-DDEBUG_RP2040_PORT=Serial
|
||||
-DHW_SPI1_DEVICE
|
||||
-L "${platformio.libdeps_dir}/${this.__env__}/bsec2/src/cortex-m0plus"
|
||||
lib_deps =
|
||||
${rp2350_base.lib_deps}
|
||||
debug_build_flags = ${rp2350_base.build_flags}
|
||||
debug_tool = cmsis-dap ; for e.g. Picotool
|
||||
50
variants/rpipico2/variant.h
Normal file
50
variants/rpipico2/variant.h
Normal file
@@ -0,0 +1,50 @@
|
||||
// #define RADIOLIB_CUSTOM_ARDUINO 1
|
||||
// #define RADIOLIB_TONE_UNSUPPORTED 1
|
||||
// #define RADIOLIB_SOFTWARE_SERIAL_UNSUPPORTED 1
|
||||
|
||||
#define ARDUINO_ARCH_AVR
|
||||
|
||||
// default I2C pins:
|
||||
// SDA = 4
|
||||
// SCL = 5
|
||||
|
||||
// Recommended pins for SerialModule:
|
||||
// txd = 8
|
||||
// rxd = 9
|
||||
|
||||
#define EXT_NOTIFY_OUT 22
|
||||
#define BUTTON_PIN 17
|
||||
|
||||
#define LED_PIN PIN_LED
|
||||
|
||||
#define BATTERY_PIN 26
|
||||
// ratio of voltage divider = 3.0 (R17=200k, R18=100k)
|
||||
#define ADC_MULTIPLIER 3.1 // 3.0 + a bit for being optimistic
|
||||
#define BATTERY_SENSE_RESOLUTION_BITS ADC_RESOLUTION
|
||||
|
||||
#define USE_SX1262
|
||||
|
||||
#undef LORA_SCK
|
||||
#undef LORA_MISO
|
||||
#undef LORA_MOSI
|
||||
#undef LORA_CS
|
||||
|
||||
#define LORA_SCK 10
|
||||
#define LORA_MISO 12
|
||||
#define LORA_MOSI 11
|
||||
#define LORA_CS 3
|
||||
|
||||
#define LORA_DIO0 RADIOLIB_NC
|
||||
#define LORA_RESET 15
|
||||
#define LORA_DIO1 20
|
||||
#define LORA_DIO2 2
|
||||
#define LORA_DIO3 RADIOLIB_NC
|
||||
|
||||
#ifdef USE_SX1262
|
||||
#define SX126X_CS LORA_CS
|
||||
#define SX126X_DIO1 LORA_DIO1
|
||||
#define SX126X_BUSY LORA_DIO2
|
||||
#define SX126X_RESET LORA_RESET
|
||||
#define SX126X_DIO2_AS_RF_SWITCH
|
||||
#define SX126X_DIO3_TCXO_VOLTAGE 1.8
|
||||
#endif
|
||||
56
variants/seeed-sensecap-indicator/pins_arduino.h
Normal file
56
variants/seeed-sensecap-indicator/pins_arduino.h
Normal file
@@ -0,0 +1,56 @@
|
||||
#ifndef Pins_Arduino_h
|
||||
#define Pins_Arduino_h
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
// static const uint8_t LED_BUILTIN = -1;
|
||||
|
||||
// static const uint8_t TX = 43;
|
||||
// static const uint8_t RX = 44;
|
||||
|
||||
static const uint8_t SDA = 39;
|
||||
static const uint8_t SCL = 40;
|
||||
|
||||
// Default SPI will be mapped to Radio
|
||||
static const uint8_t SS = -1;
|
||||
static const uint8_t MOSI = 48;
|
||||
static const uint8_t MISO = 47;
|
||||
static const uint8_t SCK = 41;
|
||||
|
||||
static const uint8_t A0 = 1;
|
||||
static const uint8_t A1 = 2;
|
||||
static const uint8_t A2 = 3;
|
||||
static const uint8_t A3 = 4;
|
||||
static const uint8_t A4 = 5;
|
||||
static const uint8_t A5 = 6;
|
||||
static const uint8_t A6 = 7;
|
||||
static const uint8_t A7 = 8;
|
||||
static const uint8_t A8 = 9;
|
||||
static const uint8_t A9 = 10;
|
||||
static const uint8_t A10 = 11;
|
||||
static const uint8_t A11 = 12;
|
||||
static const uint8_t A12 = 13;
|
||||
static const uint8_t A13 = 14;
|
||||
static const uint8_t A14 = 15;
|
||||
static const uint8_t A15 = 16;
|
||||
static const uint8_t A16 = 17;
|
||||
static const uint8_t A17 = 18;
|
||||
static const uint8_t A18 = 19;
|
||||
static const uint8_t A19 = 20;
|
||||
|
||||
static const uint8_t T1 = 1;
|
||||
static const uint8_t T2 = 2;
|
||||
static const uint8_t T3 = 3;
|
||||
static const uint8_t T4 = 4;
|
||||
static const uint8_t T5 = 5;
|
||||
static const uint8_t T6 = 6;
|
||||
static const uint8_t T7 = 7;
|
||||
static const uint8_t T8 = 8;
|
||||
static const uint8_t T9 = 9;
|
||||
static const uint8_t T10 = 10;
|
||||
static const uint8_t T11 = 11;
|
||||
static const uint8_t T12 = 12;
|
||||
static const uint8_t T13 = 13;
|
||||
static const uint8_t T14 = 14;
|
||||
|
||||
#endif /* Pins_Arduino_h */
|
||||
28
variants/seeed-sensecap-indicator/platformio.ini
Normal file
28
variants/seeed-sensecap-indicator/platformio.ini
Normal file
@@ -0,0 +1,28 @@
|
||||
; Seeed Studio SenseCAP Indicator
|
||||
[env:seeed-sensecap-indicator]
|
||||
extends = esp32s3_base
|
||||
platform_packages =
|
||||
platformio/framework-arduinoespressif32 @ https://github.com/mverch67/arduino-esp32.git#add_tca9535 ; based on 2.0.16
|
||||
|
||||
board = seeed-sensecap-indicator
|
||||
board_check = true
|
||||
upload_protocol = esptool
|
||||
|
||||
build_flags = ${esp32_base.build_flags}
|
||||
-Ivariants/seeed-sensecap-indicator
|
||||
-DSENSECAP_INDICATOR
|
||||
-DCONFIG_ARDUHAL_LOG_COLORS
|
||||
-DRADIOLIB_DEBUG_SPI=0
|
||||
-DRADIOLIB_DEBUG_PROTOCOL=0
|
||||
-DRADIOLIB_DEBUG_BASIC=0
|
||||
-DRADIOLIB_VERBOSE_ASSERT=0
|
||||
-DRADIOLIB_SPI_PARANOID=0
|
||||
-DIO_EXPANDER=0x40
|
||||
-DIO_EXPANDER_IRQ=42
|
||||
;-DIO_EXPANDER_DEBUG
|
||||
-DUSE_ARDUINO_HAL_GPIO
|
||||
|
||||
lib_deps = ${esp32s3_base.lib_deps}
|
||||
https://github.com/mverch67/LovyanGFX#develop
|
||||
earlephilhower/ESP8266Audio@^1.9.7
|
||||
earlephilhower/ESP8266SAM@^1.0.1
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user