mirror of
https://github.com/meshtastic/firmware.git
synced 2026-01-06 09:57:52 +00:00
Merge branch 'master' into portexpander-keyboard
This commit is contained in:
BIN
variants/diy/nrf52_promicro_diy_tcxo/E80_RSSI_per_case.webp
Normal file
BIN
variants/diy/nrf52_promicro_diy_tcxo/E80_RSSI_per_case.webp
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 10 KiB |
107
variants/diy/nrf52_promicro_diy_tcxo/readme.md
Normal file
107
variants/diy/nrf52_promicro_diy_tcxo/readme.md
Normal file
@@ -0,0 +1,107 @@
|
||||
# Notes
|
||||
|
||||
## General
|
||||
|
||||
The pinout is contained in the variant.h file, and a [generic schematic](./Schematic_Pro-Micro_Pinouts%202024-12-14.pdf) is located in this directory.
|
||||
|
||||
### Note on DIO2, RXEN, TXEN, and RF switching
|
||||
|
||||
Several modules require external switching between transmit (Tx) and receive (Rx). This can be achieved using several methods:
|
||||
|
||||
1. Link the TXEN pin on the radio module to DIO2 on the same module, and then connect RXEN on the radio module to pin 0.17 on the Pro-Micro.
|
||||
2. Use DIO2 to drive a logic inverter, so that when DIO2 is `high`, RXEN is `low`, and vice versa.
|
||||
3. Use DIO2 to drive a pair of MOSFETs or transistors to supply the same function.
|
||||
|
||||
RXEN is not required to be connected if the selected module already has internal RF switching, or if external RF switching logic is already applied.
|
||||
Also worth noting that the Seeed WIO SX1262 in particular only has RXEN exposed (marked RF_SW) and has the DIO2-TXEN link internally.
|
||||
|
||||
<details>
|
||||
|
||||
<summary> The table of known modules is at the bottom of the variant.h, and reproduced here for convenience. </summary>
|
||||
|
||||
| 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 | Ext | Cute! DIO2/TXEN are not exposed |
|
||||
| AI-Thinker | RA-02 | No | Int | SX1278 **433mhz band only** |
|
||||
| RF Solutions | RFM95 | No | Int | Untested |
|
||||
| Ebyte | E80-900M2213S | Yes | Int | LR1121 radio |
|
||||
|
||||
</details>
|
||||
|
||||
## LR1121 modules - E80 is the default
|
||||
|
||||
The E80 from CDEbyte is the most obtainable module at present, and has been selected as the default option.
|
||||
|
||||
Naturally, CDEbyte have chosen to ignore the generic Semtech impelementation of the RF switching logic and have supplied confusing and contradictory documentation, which is explained below.
|
||||
|
||||
tl;dr: The E80 is chosen as the default. **If you wish to use another module, the table in `rfswitch.h` must be adjusted accordingly.**
|
||||
|
||||
### E80 switching - the saga
|
||||
|
||||
The CDEbyte implementation of the LR1121 is contained in their E80 module. As stated above, CDEbyte have chosen to ignore the generic Semtech implementation of the RF switching logic and have their own table, which is located at the bottom of the page [here](https://www.cdebyte.com/products/E80-900M2213S/2#Pin), and reflected on page 6 of their user manual, and reproduced below:
|
||||
|
||||
| DIO5/RFSW0 | DIO6/RFSW1 | RF status |
|
||||
| ---------- | ---------- | ----------------------------- |
|
||||
| 0 | 0 | RX |
|
||||
| 0 | 1 | TX (Sub-1GHz low power mode) |
|
||||
| 1 | 0 | TX (Sub-1GHz high power mode) |
|
||||
| 1 | 1 | TX(2.4GHz) |
|
||||
|
||||
However, looking at the sample code they provide on page 9, the values would be:
|
||||
|
||||
| DIO5/RFSW0 | DIO6/RFSW1 | RF status |
|
||||
| ---------- | ---------- | ----------------------------- |
|
||||
| 0 | 1 | RX |
|
||||
| 1 | 1 | TX (Sub-1GHz low power mode) |
|
||||
| 1 | 0 | TX (Sub-1GHz high power mode) |
|
||||
| 0 | 0 | TX(2.4GHz) |
|
||||
|
||||
The Semtech default, the values are (taken from [here](https://github.com/Lora-net/SWSD006/blob/v2.6.1/lib/app_subGHz_config_lr11xx.c#L145-L154)):
|
||||
|
||||
<details>
|
||||
|
||||
```cpp
|
||||
.rfswitch = {
|
||||
.enable = LR11XX_SYSTEM_RFSW0_HIGH | LR11XX_SYSTEM_RFSW1_HIGH | LR11XX_SYSTEM_RFSW2_HIGH,
|
||||
.standby = 0,
|
||||
.rx = LR11XX_SYSTEM_RFSW0_HIGH,
|
||||
.tx = LR11XX_SYSTEM_RFSW0_HIGH | LR11XX_SYSTEM_RFSW1_HIGH,
|
||||
.tx_hp = LR11XX_SYSTEM_RFSW1_HIGH,
|
||||
.tx_hf = 0,
|
||||
.gnss = LR11XX_SYSTEM_RFSW2_HIGH,
|
||||
.wifi = 0,
|
||||
},
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
| DIO5/RFSW0 | DIO6/RFSW1 | RF status |
|
||||
| ---------- | ---------- | ----------------------------- |
|
||||
| 1 | 0 | RX |
|
||||
| 1 | 1 | TX (Sub-1GHz low power mode) |
|
||||
| 0 | 1 | TX (Sub-1GHz high power mode) |
|
||||
| 0 | 0 | TX(2.4GHz) |
|
||||
|
||||
It is evident from the tables above that there is no real consistency to those provided by Ebyte.
|
||||
|
||||
#### An experiment
|
||||
|
||||
Tests were conducted in each of the three configurations between a known-good SX1262 and an E80, passing packets in both directions and recording the reported RSSI. The E80 was set at 22db and 14db to activate the high and low power settings respectively. The results are shown in the chart below.
|
||||
|
||||

|
||||
|
||||
## Conclusion
|
||||
|
||||
The RF switching is based on the code example given. Logically, this shows the DIO5 and DIO6 are swapped compared to the reference design.
|
||||
|
||||
If future DIYers wish to use an alternative module, the table in `rfswitch.h` must be adjusted accordingly.
|
||||
@@ -1,17 +1,20 @@
|
||||
#include "RadioLib.h"
|
||||
|
||||
// This is rewritten to match the requirements of the E80-900M2213S
|
||||
// The E80 does not conform to the reference Semtech switches(!) and therefore needs a custom matrix.
|
||||
// See footnote #3 in "https://www.cdebyte.com/products/E80-900M2213S/2#Pin"
|
||||
// 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) (LR11x0 only)
|
||||
// DIO7 -> not connected on E80 module - note that GNSS and Wifi scanning are not possible.
|
||||
|
||||
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_STBY, {LOW, LOW, LOW}}, {LR11x0::MODE_RX, {LOW, HIGH, LOW}},
|
||||
{LR11x0::MODE_TX, {HIGH, HIGH, LOW}}, {LR11x0::MODE_TX_HP, {HIGH, LOW, LOW}},
|
||||
{LR11x0::MODE_TX_HF, {LOW, LOW, LOW}}, {LR11x0::MODE_GNSS, {LOW, LOW, HIGH}},
|
||||
{LR11x0::MODE_WIFI, {LOW, LOW, LOW}}, END_OF_MODE_TABLE,
|
||||
};
|
||||
};
|
||||
|
||||
@@ -22,26 +22,26 @@ extern "C" {
|
||||
/*
|
||||
NRF52 PRO MICRO PIN ASSIGNMENT
|
||||
|
||||
| Pin | Function | | Pin | Function | RF95 |
|
||||
| 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 | | | | |
|
||||
| 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
|
||||
@@ -175,7 +175,7 @@ settings.
|
||||
| NiceRF | Lora1262 | yes | Int | |
|
||||
| Waveshare | Core1262-HF | yes | Ext | |
|
||||
| Waveshare | LoRa Node Module | yes | Int | |
|
||||
| Seeed | Wio-SX1262 | yes | Int | Sooooo cute! |
|
||||
| Seeed | Wio-SX1262 | yes | Ext | Cute! DIO2/TXEN are not exposed |
|
||||
| AI-Thinker | RA-02 | No | Int | SX1278 **433mhz band only** |
|
||||
| RF Solutions | RFM95 | No | Int | Untested |
|
||||
| Ebyte | E80-900M2213S | Yes | Int | LR1121 radio |
|
||||
@@ -183,8 +183,7 @@ settings.
|
||||
*/
|
||||
|
||||
#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
|
||||
#define TCXO_OPTIONAL // make it so that the firmware can try both TCXO and XTAL
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
@@ -194,4 +193,4 @@ extern float tcxoVoltage; // make this available everywhere
|
||||
* Arduino objects - C++ only
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -70,6 +70,20 @@ lib_deps =
|
||||
${nrf52840_base.lib_deps}
|
||||
debug_tool = jlink
|
||||
|
||||
; Seeed XIAO nRF52840 + XIAO Wio SX1262 DIY
|
||||
[env:seeed-xiao-nrf52840-wio-sx1262]
|
||||
board = xiao_ble_sense
|
||||
extends = nrf52840_base
|
||||
board_level = extra
|
||||
build_flags = ${nrf52840_base.build_flags} -Ivariants/diy/seeed-xiao-nrf52840-wio-sx1262 -D PRIVATE_HW
|
||||
-Isrc/platform/nrf52/softdevice -Isrc/platform/nrf52/softdevice/nrf52
|
||||
-L "${platformio.libdeps_dir}/${this.__env__}/bsec2/src/cortex-m4/fpv4-sp-d16-hard"
|
||||
board_build.ldscript = src/platform/nrf52/nrf52840_s140_v7.ld
|
||||
build_src_filter = ${nrf52_base.build_src_filter} +<../variants/diy/seeed-xiao-nrf52840-wio-sx1262>
|
||||
lib_deps =
|
||||
${nrf52840_base.lib_deps}
|
||||
debug_tool = jlink
|
||||
|
||||
; NanoVHF T-Energy-S3 + E22(0)-xxxM - DIY
|
||||
[env:t-energy-s3_e22]
|
||||
extends = esp32s3_base
|
||||
@@ -86,4 +100,4 @@ build_flags =
|
||||
-D BOARD_HAS_PSRAM
|
||||
-D ARDUINO_USB_MODE=0
|
||||
-D ARDUINO_USB_CDC_ON_BOOT=1
|
||||
-I variants/diy/t-energy-s3_e22
|
||||
-I variants/diy/t-energy-s3_e22
|
||||
43
variants/diy/seeed-xiao-nrf52840-wio-sx1262/README.md
Normal file
43
variants/diy/seeed-xiao-nrf52840-wio-sx1262/README.md
Normal file
@@ -0,0 +1,43 @@
|
||||
# XIAO nRF52840 + XIAO Wio SX1262
|
||||
|
||||
For a mere doubling in price you too can swap out the XIAO ESP32C3 for a XIAO nRF52840, stack the Wio SX1262 radio board either above or underneath the nRF52840, solder the pins, and achieve a massive improvement in battery life!
|
||||
|
||||
I'm not really sure why else you would want to as the ESP32C3 is perfectly cromulent, easily connects to the Wio SX1262 via the B2B connector and has an onboard IPEX connector for the included Bluetooth antenna. So you'll also lose BT range, but you will also have working ADC for the battery in Meshtastic and also have an ESP32C3 to use for something else!
|
||||
|
||||
If you're still reading you are clearly gonna do it anyway, so...mount the Wio SX1262 either on top or underneath depending on your preference. The `variant.h` will work with either configuration though it does map the Wio SX1262's button to nRF52840 Pin `D5` as it can still be used as a user button and it's nice to be able to gracefully shutdown a node by holding it down for 5 seconds.
|
||||
|
||||
If you do decide to wire up the button, orient it so looking straight-down at the Wio SX1262 the radio chip is at the bottom, button in the middle and the hole is at the top - the **left** side of the button should be soldered to `GND` (e.g. the 2nd pin down the top on the **right** row of pins) and the **right** side of the button should be soldered to `D5` (e.g. the 2nd pin up from the button on the **left** row of pins.). This mirrors the original wiring and wiring it in reverse could end up connecting GND to voltage and that's no beuno.
|
||||
|
||||
Serial Pins remain available on `D6` (TX) and `D7` (RX) should you want to use them, The same pins could be repurposed for `i2c` if you would like to have that instead of serial, in `variant.h` you would just need to change:
|
||||
|
||||
```c++
|
||||
// RX and TX pins
|
||||
#define PIN_SERIAL1_RX (6)
|
||||
#define PIN_SERIAL1_TX (7)
|
||||
```
|
||||
|
||||
to
|
||||
|
||||
```c++
|
||||
// RX and TX pins
|
||||
#define PIN_SERIAL1_RX (-1)
|
||||
#define PIN_SERIAL1_TX (-1)
|
||||
```
|
||||
|
||||
and
|
||||
|
||||
```c++
|
||||
#define PIN_WIRE_SDA (-1)
|
||||
#define PIN_WIRE_SCL (-1)
|
||||
// #define PIN_WIRE_SDA (6)
|
||||
// #define PIN_WIRE_SCL (7)
|
||||
```
|
||||
|
||||
to
|
||||
|
||||
```c++
|
||||
#define PIN_WIRE_SDA (6)
|
||||
#define PIN_WIRE_SCL (7)
|
||||
```
|
||||
|
||||
If you wanted both serial and i2c you could even go so far as to use the pads for the PDM mic which is missing on the non-sense board (`P1.00` / `P0.16`)... or move up to the nRF52840 Plus which has even more pins available but hasn't been checked/confirmed if it follows the same pin mapping as the non-plus.
|
||||
55
variants/diy/seeed-xiao-nrf52840-wio-sx1262/variant.cpp
Normal file
55
variants/diy/seeed-xiao-nrf52840-wio-sx1262/variant.cpp
Normal file
@@ -0,0 +1,55 @@
|
||||
#include "variant.h"
|
||||
#include "nrf.h"
|
||||
#include "wiring_constants.h"
|
||||
#include "wiring_digital.h"
|
||||
|
||||
const uint32_t g_ADigitalPinMap[] = {
|
||||
// D0 .. D13
|
||||
2, // D0 is P0.02 (A0)
|
||||
3, // D1 is P0.03 (A1)
|
||||
28, // D2 is P0.28 (A2)
|
||||
29, // D3 is P0.29 (A3)
|
||||
4, // D4 is P0.04 (A4,SDA)
|
||||
5, // D5 is P0.05 (A5,SCL)
|
||||
43, // D6 is P1.11 (TX)
|
||||
44, // D7 is P1.12 (RX)
|
||||
45, // D8 is P1.13 (SCK)
|
||||
46, // D9 is P1.14 (MISO)
|
||||
47, // D10 is P1.15 (MOSI)
|
||||
|
||||
// LEDs
|
||||
26, // D11 is P0.26 (LED RED)
|
||||
6, // D12 is P0.06 (LED BLUE)
|
||||
30, // D13 is P0.30 (LED GREEN)
|
||||
14, // D14 is P0.14 (READ_BAT)
|
||||
|
||||
// LSM6DS3TR
|
||||
40, // D15 is P1.08 (6D_PWR)
|
||||
27, // D16 is P0.27 (6D_I2C_SCL)
|
||||
7, // D17 is P0.07 (6D_I2C_SDA)
|
||||
11, // D18 is P0.11 (6D_INT1)
|
||||
|
||||
// MIC
|
||||
42, // 17,//42, // D19 is P1.10 (MIC_PWR)
|
||||
32, // 26,//32, // D20 is P1.00 (PDM_CLK)
|
||||
16, // 25,//16, // D21 is P0.16 (PDM_DATA)
|
||||
|
||||
// BQ25100
|
||||
13, // D22 is P0.13 (HICHG)
|
||||
17, // D23 is P0.17 (~CHG)
|
||||
|
||||
//
|
||||
21, // D24 is P0.21 (QSPI_SCK)
|
||||
25, // D25 is P0.25 (QSPI_CSN)
|
||||
20, // D26 is P0.20 (QSPI_SIO_0 DI)
|
||||
24, // D27 is P0.24 (QSPI_SIO_1 DO)
|
||||
22, // D28 is P0.22 (QSPI_SIO_2 WP)
|
||||
23, // D29 is P0.23 (QSPI_SIO_3 HOLD)
|
||||
|
||||
// NFC
|
||||
9, // D30 is P0.09 (NFC1)
|
||||
10, // D31 is P0.10 (NFC2)
|
||||
|
||||
// VBAT
|
||||
31, // D32 is P0.10 (VBAT)
|
||||
};
|
||||
186
variants/diy/seeed-xiao-nrf52840-wio-sx1262/variant.h
Normal file
186
variants/diy/seeed-xiao-nrf52840-wio-sx1262/variant.h
Normal file
@@ -0,0 +1,186 @@
|
||||
// basically xiao_ble with pins remapped for:
|
||||
// Seeed XIAO nRF52840 : https://www.seeedstudio.com/Seeed-XIAO-BLE-nRF52840-p-5201.html
|
||||
// Seeed Wio SX1626 : https://www.seeedstudio.com/Wio-SX1262-with-XIAO-ESP32S3-p-5982.html
|
||||
|
||||
#ifndef _SEEED_XIAO_NRF52840_SENSE_H_
|
||||
#define _SEEED_XIAO_NRF52840_SENSE_H_
|
||||
|
||||
/** 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 PINS_COUNT (33)
|
||||
#define NUM_DIGITAL_PINS (33)
|
||||
#define NUM_ANALOG_INPUTS (8) // A6 is used for battery, A7 is analog reference
|
||||
#define NUM_ANALOG_OUTPUTS (0)
|
||||
|
||||
// LEDs
|
||||
// ----
|
||||
#define LED_RED 11
|
||||
#define LED_BLUE 12
|
||||
#define LED_GREEN 13
|
||||
|
||||
#define PIN_LED1 LED_GREEN
|
||||
#define PIN_LED2 LED_BLUE
|
||||
#define PIN_LED3 LED_RED
|
||||
|
||||
#define PIN_LED PIN_LED1
|
||||
#define LED_PWR (PINS_COUNT)
|
||||
|
||||
#define LED_BUILTIN PIN_LED
|
||||
#define LED_STATE_ON 1 // State when LED is lit
|
||||
|
||||
// XIAO Wio-SX1262 Shield User button
|
||||
#define PIN_BUTTON1 5
|
||||
#define BUTTON_NEED_PULLUP
|
||||
|
||||
// Digital Pins
|
||||
// ------------
|
||||
#define D0 (0ul)
|
||||
#define D1 (1ul)
|
||||
#define D2 (2ul)
|
||||
#define D3 (3ul)
|
||||
#define D4 (4ul)
|
||||
#define D5 (5ul)
|
||||
#define D6 (6ul)
|
||||
#define D7 (7ul)
|
||||
#define D8 (8ul)
|
||||
#define D9 (9ul)
|
||||
#define D10 (10ul)
|
||||
|
||||
// Analog Pins
|
||||
// -----------
|
||||
#define PIN_A0 (0)
|
||||
#define PIN_A1 (1)
|
||||
#define PIN_A2 (2)
|
||||
#define PIN_A3 (3)
|
||||
#define PIN_A4 (4)
|
||||
#define PIN_A5 (5)
|
||||
#define PIN_VBAT (32)
|
||||
#define VBAT_ENABLE (14)
|
||||
|
||||
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 12
|
||||
|
||||
// Other Pins
|
||||
// ----------
|
||||
#define PIN_NFC1 (30)
|
||||
#define PIN_NFC2 (31)
|
||||
|
||||
// RX and TX pins
|
||||
#define PIN_SERIAL1_RX (-1)
|
||||
#define PIN_SERIAL1_TX (-1)
|
||||
// complains if not defined
|
||||
#define PIN_SERIAL2_RX (-1)
|
||||
#define PIN_SERIAL2_TX (-1)
|
||||
|
||||
// 4 is used as RF_SW and 5 for USR button so...
|
||||
#define PIN_WIRE_SDA (6)
|
||||
#define PIN_WIRE_SCL (7)
|
||||
|
||||
static const uint8_t SDA = PIN_WIRE_SDA;
|
||||
static const uint8_t SCL = PIN_WIRE_SCL;
|
||||
|
||||
// SPI SX1262
|
||||
// ----------
|
||||
#define SPI_SX1262
|
||||
#ifdef SPI_SX1262
|
||||
#define SPI_INTERFACES_COUNT 1
|
||||
|
||||
#define PIN_SPI_MISO (9)
|
||||
#define PIN_SPI_MOSI (10)
|
||||
#define PIN_SPI_SCK (8)
|
||||
|
||||
static const uint8_t SS = D3;
|
||||
static const uint8_t MOSI = PIN_SPI_MOSI;
|
||||
static const uint8_t MISO = PIN_SPI_MISO;
|
||||
static const uint8_t SCK = PIN_SPI_SCK;
|
||||
|
||||
// supported modules list
|
||||
#define USE_SX1262
|
||||
|
||||
// common pinouts for SX126X modules
|
||||
#define SX126X_CS D3
|
||||
#define SX126X_DIO1 D0
|
||||
#define SX126X_BUSY D1
|
||||
#define SX126X_RESET D2
|
||||
|
||||
// DIO2 controlls an antenna switch and the TCXO voltage is controlled by DIO3
|
||||
#define SX126X_DIO2_AS_RF_SWITCH
|
||||
#define SX126X_RXEN 38
|
||||
#define SX126X_TXEN RADIOLIB_NC
|
||||
#define SX126X_DIO3_TCXO_VOLTAGE 1.8
|
||||
#define SX126X_DIO3_TCXO_VOLTAGE 1.8
|
||||
#endif
|
||||
|
||||
// Wire Interfaces
|
||||
// -------------------
|
||||
#define WIRE_INTERFACES_COUNT 1 // 2
|
||||
|
||||
// Sense version has IMU and PDM Mic
|
||||
// #define XIAO_SENSE
|
||||
#ifndef XIAO_SENSE
|
||||
// 6 DoF IMU
|
||||
#define PIN_LSM6DS3TR_C_POWER (15)
|
||||
#define PIN_LSM6DS3TR_C_INT1 (18)
|
||||
// PDM Interfaces
|
||||
// ---------------
|
||||
#define PIN_PDM_PWR (19)
|
||||
#define PIN_PDM_CLK (20)
|
||||
#define PIN_PDM_DIN (21)
|
||||
#endif
|
||||
|
||||
// QSPI Pins
|
||||
// ---------
|
||||
#define PIN_QSPI_SCK (24)
|
||||
#define PIN_QSPI_CS (25)
|
||||
#define PIN_QSPI_IO0 (26)
|
||||
#define PIN_QSPI_IO1 (27)
|
||||
#define PIN_QSPI_IO2 (28)
|
||||
#define PIN_QSPI_IO3 (29)
|
||||
|
||||
// On-board QSPI Flash
|
||||
// -------------------
|
||||
#define EXTERNAL_FLASH_DEVICES P25Q16H
|
||||
#define EXTERNAL_FLASH_USE_QSPI
|
||||
|
||||
// Battery
|
||||
// -------
|
||||
// P0_14 = 14 Reads battery voltage from divider on signal board.
|
||||
// PIN_VBAT is reading voltage divider on XIAO and is program pin 32 / or P0.31
|
||||
#define BAT_READ 14
|
||||
#define BATTERY_SENSE_RESOLUTION_BITS 10
|
||||
#define CHARGE_LED 23 // P0_17 = 17 D23 YELLOW CHARGE LED
|
||||
#define HICHG 22 // P0_13 = 13 D22 Charge-select pin for Lipo for 100 mA instead of default 50mA charge
|
||||
|
||||
// The battery sense is hooked to pin A0 (5)
|
||||
#define BATTERY_PIN PIN_VBAT // PIN_A0
|
||||
|
||||
// ratio of voltage divider = 3.0 (R17=1M, R18=510k)
|
||||
#define ADC_MULTIPLIER 3 // 3.0 + a bit for being optimistic
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* Arduino objects - C++ only
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
||||
#endif
|
||||
@@ -10,12 +10,8 @@ build_flags =
|
||||
-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
|
||||
|
||||
@@ -11,12 +11,8 @@ build_flags =
|
||||
-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}
|
||||
|
||||
@@ -10,12 +10,8 @@ build_flags =
|
||||
-D EINK_HEIGHT=122
|
||||
-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_LIMIT_GHOSTING_PX=2000 ; (Optional) How much image ghosting is tolerated
|
||||
-D EINK_BACKGROUND_USES_FAST ; (Optional) Use FAST refresh for both BACKGROUND and RESPONSIVE, until a limit is reached.
|
||||
-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
|
||||
lib_deps =
|
||||
${esp32s3_base.lib_deps}
|
||||
https://github.com/meshtastic/GxEPD2#b202ebfec6a4821e098cf7a625ba0f6f2400292d
|
||||
|
||||
@@ -11,11 +11,7 @@ build_flags =
|
||||
-D EINK_HEIGHT=122
|
||||
-D USE_EINK_DYNAMICDISPLAY ; Enable Dynamic EInk
|
||||
-D EINK_LIMIT_FASTREFRESH=5 ; 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_LIMIT_GHOSTING_PX=2000 ; (Optional) How much image ghosting is tolerated
|
||||
;-D EINK_BACKGROUND_USES_FAST ; (Optional) Use FAST refresh for both BACKGROUND and RESPONSIVE, until a limit is reached.
|
||||
-D EINK_HASQUIRK_VICIOUSFASTREFRESH ; Identify that pixels drawn by fast-refresh are harder to clear
|
||||
lib_deps =
|
||||
${esp32s3_base.lib_deps}
|
||||
https://github.com/meshtastic/GxEPD2#55f618961db45a23eff0233546430f1e5a80f63a
|
||||
|
||||
30
variants/meshlink/platformio.ini
Normal file
30
variants/meshlink/platformio.ini
Normal file
@@ -0,0 +1,30 @@
|
||||
; MeshLink board developed by LoraItalia. NRF52840, eByte E22900M22S (Will also come with other frequencies), 25w MPPT solar charger (5v,12v,18v selectable), support for gps, buzzer, oled or e-ink display, 10 gpios, hardware watchdog
|
||||
; https://www.loraitalia.it
|
||||
; firmware for boards with or without oled display
|
||||
[env:meshlink]
|
||||
extends = nrf52840_base
|
||||
board = meshlink
|
||||
;board_check = true
|
||||
build_flags = ${nrf52840_base.build_flags} -I variants/meshlink -D MESHLINK
|
||||
-L "${platformio.libdeps_dir}/${this.__env__}/bsec2/src/cortex-m4/fpv4-sp-d16-hard"
|
||||
-D GPS_POWER_TOGGLE ; comment this line to disable triple press function on the user button to turn off gps entirely.
|
||||
-D EINK_DISPLAY_MODEL=GxEPD2_213_B74
|
||||
-D EINK_WIDTH=250
|
||||
-D EINK_HEIGHT=122
|
||||
-D USE_EINK_DYNAMICDISPLAY ; Enable Dynamic EInk
|
||||
-D EINK_LIMIT_FASTREFRESH=5 ; 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_LIMIT_GHOSTING_PX=2000 ; (Optional) How much image ghosting is tolerated
|
||||
-D EINK_BACKGROUND_USES_FAST ; (Optional) Use FAST refresh for both BACKGROUND and RESPONSIVE, until a limit is reached.
|
||||
-D EINK_HASQUIRK_VICIOUSFASTREFRESH ; Identify that pixels drawn by fast-refresh are harder to clear
|
||||
|
||||
|
||||
build_src_filter = ${nrf52_base.build_src_filter} +<../variants/meshlink>
|
||||
lib_deps =
|
||||
${nrf52840_base.lib_deps}
|
||||
https://github.com/meshtastic/GxEPD2#55f618961db45a23eff0233546430f1e5a80f63a
|
||||
debug_tool = jlink
|
||||
; 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
|
||||
23
variants/meshlink/variant.cpp
Normal file
23
variants/meshlink/variant.cpp
Normal file
@@ -0,0 +1,23 @@
|
||||
#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()
|
||||
{
|
||||
pinMode(PIN_LED1, OUTPUT);
|
||||
digitalWrite(PIN_LED1, HIGH); // turn off the white led while booting
|
||||
// otherwise it will stay lit for several seconds (could be annoying)
|
||||
|
||||
#ifdef PIN_WD_EN
|
||||
pinMode(PIN_WD_EN, OUTPUT);
|
||||
digitalWrite(PIN_WD_EN, HIGH); // Enable the Watchdog at boot
|
||||
#endif
|
||||
}
|
||||
153
variants/meshlink/variant.h
Normal file
153
variants/meshlink/variant.h
Normal file
@@ -0,0 +1,153 @@
|
||||
#ifndef _VARIANT_MESHLINK_
|
||||
#define _VARIANT_MESHLINK_
|
||||
#ifndef MESHLINK
|
||||
#define MESHLINK
|
||||
#endif
|
||||
/** 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 (2)
|
||||
#define NUM_ANALOG_OUTPUTS (0)
|
||||
|
||||
#define BUTTON_PIN (-1) // If defined, this will be used for user button presses,
|
||||
#define BUTTON_NEED_PULLUP
|
||||
|
||||
// LEDs
|
||||
#define PIN_LED1 (24) // Built in white led for status
|
||||
#define LED_BLUE PIN_LED1
|
||||
#define LED_BUILTIN PIN_LED1
|
||||
|
||||
#define LED_STATE_ON 0 // State when LED is litted
|
||||
#define LED_INVERTED 1
|
||||
|
||||
// Testing USB detection
|
||||
// #define NRF_APM
|
||||
|
||||
/*
|
||||
* Analog pins
|
||||
*/
|
||||
#define PIN_A1 (3) // P0.03/AIN1
|
||||
#define ADC_RESOLUTION 14
|
||||
|
||||
// Other pins
|
||||
// #define PIN_AREF (2)
|
||||
// static const uint8_t AREF = PIN_AREF;
|
||||
|
||||
/*
|
||||
* Serial interfaces
|
||||
*/
|
||||
#define PIN_SERIAL1_RX (32 + 8)
|
||||
#define PIN_SERIAL1_TX (7)
|
||||
|
||||
/*
|
||||
* SPI Interfaces
|
||||
*/
|
||||
#define SPI_INTERFACES_COUNT 2
|
||||
|
||||
#define PIN_SPI_MISO (8)
|
||||
#define PIN_SPI_MOSI (32 + 9)
|
||||
#define PIN_SPI_SCK (11)
|
||||
|
||||
#define PIN_SPI1_MISO (23)
|
||||
#define PIN_SPI1_MOSI (21)
|
||||
#define PIN_SPI1_SCK (19)
|
||||
|
||||
static const uint8_t SS = 12;
|
||||
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 USE_EINK
|
||||
|
||||
#define PIN_EINK_CS (15)
|
||||
#define PIN_EINK_BUSY (16)
|
||||
#define PIN_EINK_DC (14)
|
||||
#define PIN_EINK_RES (17)
|
||||
#define PIN_EINK_SCLK (19)
|
||||
#define PIN_EINK_MOSI (21) // also called SDI
|
||||
|
||||
/*
|
||||
* Wire Interfaces
|
||||
*/
|
||||
#define WIRE_INTERFACES_COUNT 1
|
||||
|
||||
#define PIN_WIRE_SDA (1)
|
||||
#define PIN_WIRE_SCL (27)
|
||||
|
||||
// QSPI Pins
|
||||
#define PIN_QSPI_SCK 19
|
||||
#define PIN_QSPI_CS 22
|
||||
#define PIN_QSPI_IO0 21
|
||||
#define PIN_QSPI_IO1 23
|
||||
#define PIN_QSPI_IO2 32
|
||||
#define PIN_QSPI_IO3 20
|
||||
|
||||
// On-board QSPI Flash
|
||||
#define EXTERNAL_FLASH_DEVICES W25Q16JVUXIQ
|
||||
#define EXTERNAL_FLASH_USE_QSPI
|
||||
|
||||
#define USE_SX1262
|
||||
#define SX126X_CS (12)
|
||||
#define SX126X_DIO1 (32 + 1)
|
||||
#define SX126X_BUSY (32 + 3)
|
||||
#define SX126X_RESET (6)
|
||||
// #define SX126X_RXEN (13)
|
||||
// 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
|
||||
|
||||
// pin 25 is used to enable or disable the watchdog. This pin has to be disabled when cpu is put to sleep
|
||||
// otherwise the timer will expire and wd will reboot the cpu
|
||||
#define PIN_WD_EN (25)
|
||||
|
||||
#define PIN_GPS_PPS (26) // Pulse per second input from the GPS
|
||||
|
||||
#define GPS_TX_PIN PIN_SERIAL1_RX // This is for bits going TOWARDS the CPU
|
||||
#define GPS_RX_PIN PIN_SERIAL1_TX // This is for bits going TOWARDS the GPS
|
||||
|
||||
// #define GPS_THREAD_INTERVAL 50
|
||||
|
||||
// Define pin to enable GPS toggle (set GPIO to LOW) via user button triple press
|
||||
#define PIN_GPS_EN (0)
|
||||
#define GPS_EN_ACTIVE LOW
|
||||
|
||||
#define PIN_BUZZER (31) // P0.31/AIN7
|
||||
|
||||
// Battery
|
||||
// The battery sense is hooked to pin A0 (2)
|
||||
#define BATTERY_PIN (2)
|
||||
// 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.42 // fine tuning of voltage
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* Arduino objects - C++ only
|
||||
*----------------------------------------------------------------------------*/
|
||||
#endif
|
||||
30
variants/meshlink_eink/platformio.ini
Normal file
30
variants/meshlink_eink/platformio.ini
Normal file
@@ -0,0 +1,30 @@
|
||||
; MeshLink board developed by LoraItalia. NRF52840, eByte E22900M22S (Will also come with other frequencies), 25w MPPT solar charger (5v,12v,18v selectable), support for gps, buzzer, oled or e-ink display, 10 gpios, hardware watchdog
|
||||
; https://www.loraitalia.it
|
||||
; firmware for boards with a 250x122 e-ink display
|
||||
[env:meshlink_eink]
|
||||
extends = nrf52840_base
|
||||
board = meshlink
|
||||
;board_check = true
|
||||
build_flags = ${nrf52840_base.build_flags} -I variants/meshlink_eink -D MESHLINK
|
||||
-L "${platformio.libdeps_dir}/${this.__env__}/bsec2/src/cortex-m4/fpv4-sp-d16-hard"
|
||||
-D GPS_POWER_TOGGLE ; comment this line to disable triple press function on the user button to turn off gps entirely.
|
||||
-D EINK_DISPLAY_MODEL=GxEPD2_213_B74
|
||||
-D EINK_WIDTH=250
|
||||
-D EINK_HEIGHT=122
|
||||
-D USE_EINK_DYNAMICDISPLAY ; Enable Dynamic EInk
|
||||
-D EINK_LIMIT_FASTREFRESH=5 ; 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_LIMIT_GHOSTING_PX=2000 ; (Optional) How much image ghosting is tolerated
|
||||
-D EINK_BACKGROUND_USES_FAST ; (Optional) Use FAST refresh for both BACKGROUND and RESPONSIVE, until a limit is reached.
|
||||
-D EINK_HASQUIRK_VICIOUSFASTREFRESH ; Identify that pixels drawn by fast-refresh are harder to clear
|
||||
|
||||
|
||||
build_src_filter = ${nrf52_base.build_src_filter} +<../variants/meshlink_eink>
|
||||
lib_deps =
|
||||
${nrf52840_base.lib_deps}
|
||||
https://github.com/meshtastic/GxEPD2#55f618961db45a23eff0233546430f1e5a80f63a
|
||||
debug_tool = jlink
|
||||
; 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
|
||||
23
variants/meshlink_eink/variant.cpp
Normal file
23
variants/meshlink_eink/variant.cpp
Normal file
@@ -0,0 +1,23 @@
|
||||
#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()
|
||||
{
|
||||
pinMode(PIN_LED1, OUTPUT);
|
||||
digitalWrite(PIN_LED1, HIGH); // turn off the white led while booting
|
||||
// otherwise it will stay lit for several seconds (could be annoying)
|
||||
|
||||
#ifdef PIN_WD_EN
|
||||
pinMode(PIN_WD_EN, OUTPUT);
|
||||
digitalWrite(PIN_WD_EN, HIGH); // Enable the Watchdog at boot
|
||||
#endif
|
||||
}
|
||||
153
variants/meshlink_eink/variant.h
Normal file
153
variants/meshlink_eink/variant.h
Normal file
@@ -0,0 +1,153 @@
|
||||
#ifndef _VARIANT_MESHLINK_
|
||||
#define _VARIANT_MESHLINK_
|
||||
#ifndef MESHLINK
|
||||
#define MESHLINK
|
||||
#endif
|
||||
/** 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 (2)
|
||||
#define NUM_ANALOG_OUTPUTS (0)
|
||||
|
||||
#define BUTTON_PIN (-1) // If defined, this will be used for user button presses,
|
||||
#define BUTTON_NEED_PULLUP
|
||||
|
||||
// LEDs
|
||||
#define PIN_LED1 (24) // Built in white led for status
|
||||
#define LED_BLUE PIN_LED1
|
||||
#define LED_BUILTIN PIN_LED1
|
||||
|
||||
#define LED_STATE_ON 0 // State when LED is litted
|
||||
#define LED_INVERTED 1
|
||||
|
||||
// Testing USB detection
|
||||
// #define NRF_APM
|
||||
|
||||
/*
|
||||
* Analog pins
|
||||
*/
|
||||
#define PIN_A1 (3) // P0.03/AIN1
|
||||
#define ADC_RESOLUTION 14
|
||||
|
||||
// Other pins
|
||||
// #define PIN_AREF (2)
|
||||
// static const uint8_t AREF = PIN_AREF;
|
||||
|
||||
/*
|
||||
* Serial interfaces
|
||||
*/
|
||||
#define PIN_SERIAL1_RX (32 + 8)
|
||||
#define PIN_SERIAL1_TX (7)
|
||||
|
||||
/*
|
||||
* SPI Interfaces
|
||||
*/
|
||||
#define SPI_INTERFACES_COUNT 2
|
||||
|
||||
#define PIN_SPI_MISO (8)
|
||||
#define PIN_SPI_MOSI (32 + 9)
|
||||
#define PIN_SPI_SCK (11)
|
||||
|
||||
#define PIN_SPI1_MISO (23)
|
||||
#define PIN_SPI1_MOSI (21)
|
||||
#define PIN_SPI1_SCK (19)
|
||||
|
||||
static const uint8_t SS = 12;
|
||||
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 USE_EINK
|
||||
|
||||
#define PIN_EINK_CS (15)
|
||||
#define PIN_EINK_BUSY (16)
|
||||
#define PIN_EINK_DC (14)
|
||||
#define PIN_EINK_RES (17)
|
||||
#define PIN_EINK_SCLK (19)
|
||||
#define PIN_EINK_MOSI (21) // also called SDI
|
||||
|
||||
/*
|
||||
* Wire Interfaces
|
||||
*/
|
||||
#define WIRE_INTERFACES_COUNT 1
|
||||
|
||||
#define PIN_WIRE_SDA (1)
|
||||
#define PIN_WIRE_SCL (27)
|
||||
|
||||
// QSPI Pins
|
||||
#define PIN_QSPI_SCK 19
|
||||
#define PIN_QSPI_CS 22
|
||||
#define PIN_QSPI_IO0 21
|
||||
#define PIN_QSPI_IO1 23
|
||||
#define PIN_QSPI_IO2 32
|
||||
#define PIN_QSPI_IO3 20
|
||||
|
||||
// On-board QSPI Flash
|
||||
#define EXTERNAL_FLASH_DEVICES W25Q16JVUXIQ
|
||||
#define EXTERNAL_FLASH_USE_QSPI
|
||||
|
||||
#define USE_SX1262
|
||||
#define SX126X_CS (12)
|
||||
#define SX126X_DIO1 (32 + 1)
|
||||
#define SX126X_BUSY (32 + 3)
|
||||
#define SX126X_RESET (6)
|
||||
// #define SX126X_RXEN (13)
|
||||
// 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
|
||||
|
||||
// pin 25 is used to enable or disable the watchdog. This pin has to be disabled when cpu is put to sleep
|
||||
// otherwise the timer will expire and wd will reboot the cpu
|
||||
#define PIN_WD_EN (25)
|
||||
|
||||
#define PIN_GPS_PPS (26) // Pulse per second input from the GPS
|
||||
|
||||
#define GPS_TX_PIN PIN_SERIAL1_RX // This is for bits going TOWARDS the CPU
|
||||
#define GPS_RX_PIN PIN_SERIAL1_TX // This is for bits going TOWARDS the GPS
|
||||
|
||||
// #define GPS_THREAD_INTERVAL 50
|
||||
|
||||
// Define pin to enable GPS toggle (set GPIO to LOW) via user button triple press
|
||||
#define PIN_GPS_EN (0)
|
||||
#define GPS_EN_ACTIVE LOW
|
||||
|
||||
#define PIN_BUZZER (31) // P0.31/AIN7
|
||||
|
||||
// Battery
|
||||
// The battery sense is hooked to pin A0 (2)
|
||||
#define BATTERY_PIN (2)
|
||||
// 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.42 // fine tuning of voltage
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* Arduino objects - C++ only
|
||||
*----------------------------------------------------------------------------*/
|
||||
#endif
|
||||
@@ -14,7 +14,9 @@ lib_deps =
|
||||
${esp32_base.lib_deps}
|
||||
zinggjm/GxEPD2@^1.5.1
|
||||
adafruit/Adafruit NeoPixel @ ^1.12.0
|
||||
build_unflags = -DARDUINO_USB_MODE=1
|
||||
build_unflags =
|
||||
${esp32s3_base.build_unflags}
|
||||
-DARDUINO_USB_MODE=1
|
||||
build_flags =
|
||||
;${esp32_base.build_flags} -D MY_ESP32S3_DIY -I variants/my_esp32s3_diy_eink
|
||||
${esp32_base.build_flags} -D PRIVATE_HW -I variants/my_esp32s3_diy_eink
|
||||
|
||||
@@ -13,7 +13,9 @@ platform_packages =
|
||||
lib_deps =
|
||||
${esp32_base.lib_deps}
|
||||
adafruit/Adafruit NeoPixel @ ^1.12.0
|
||||
build_unflags = -DARDUINO_USB_MODE=1
|
||||
build_unflags =
|
||||
${esp32s3_base.build_unflags}
|
||||
-DARDUINO_USB_MODE=1
|
||||
build_flags =
|
||||
;${esp32_base.build_flags} -D MY_ESP32S3_DIY -I variants/my_esp32s3_diy_oled
|
||||
${esp32_base.build_flags} -D PRIVATE_HW -I variants/my_esp32s3_diy_oled
|
||||
|
||||
@@ -1,183 +0,0 @@
|
||||
#ifdef HAS_RAKPROT
|
||||
#include "../variants/rak2560/RAK9154Sensor.h"
|
||||
#include "../mesh/generated/meshtastic/telemetry.pb.h"
|
||||
#include "../modules/Telemetry/Sensor/TelemetrySensor.h"
|
||||
#include "configuration.h"
|
||||
|
||||
#include "concurrency/Periodic.h"
|
||||
#include <RAK-OneWireSerial.h>
|
||||
|
||||
using namespace concurrency;
|
||||
|
||||
#define BOOT_DATA_REQ
|
||||
|
||||
RAK9154Sensor::RAK9154Sensor() : TelemetrySensor(meshtastic_TelemetrySensorType_SENSOR_UNSET, "RAK1954") {}
|
||||
|
||||
static Periodic *onewirePeriodic;
|
||||
|
||||
static SoftwareHalfSerial mySerial(HALF_UART_PIN); // Wire pin P0.15
|
||||
|
||||
static uint8_t buff[0x100];
|
||||
static uint16_t bufflen = 0;
|
||||
|
||||
static int16_t dc_cur = 0;
|
||||
static uint16_t dc_vol = 0;
|
||||
static uint8_t dc_prec = 0;
|
||||
static uint8_t provision = 0;
|
||||
|
||||
static void onewire_evt(const uint8_t pid, const uint8_t sid, const SNHUBAPI_EVT_E eid, uint8_t *msg, uint16_t len)
|
||||
{
|
||||
switch (eid) {
|
||||
case SNHUBAPI_EVT_RECV_REQ:
|
||||
case SNHUBAPI_EVT_RECV_RSP:
|
||||
break;
|
||||
|
||||
case SNHUBAPI_EVT_QSEND:
|
||||
mySerial.write(msg, len);
|
||||
break;
|
||||
|
||||
case SNHUBAPI_EVT_ADD_SID:
|
||||
// LOG_INFO("+ADD:SID:[%02x]", msg[0]);
|
||||
break;
|
||||
|
||||
case SNHUBAPI_EVT_ADD_PID:
|
||||
// LOG_INFO("+ADD:PID:[%02x]", msg[0]);
|
||||
#ifdef BOOT_DATA_REQ
|
||||
provision = msg[0];
|
||||
#endif
|
||||
break;
|
||||
|
||||
case SNHUBAPI_EVT_GET_INTV:
|
||||
break;
|
||||
|
||||
case SNHUBAPI_EVT_GET_ENABLE:
|
||||
break;
|
||||
|
||||
case SNHUBAPI_EVT_SDATA_REQ:
|
||||
|
||||
// LOG_INFO("+EVT:PID[%02x],IPSO[%02x]",pid,msg[0]);
|
||||
// for( uint16_t i=1; i<len; i++)
|
||||
// {
|
||||
// LOG_INFO("%02x,", msg[i]);
|
||||
// }
|
||||
// LOG_INFO("");
|
||||
switch (msg[0]) {
|
||||
case RAK_IPSO_CAPACITY:
|
||||
dc_prec = msg[1];
|
||||
if (dc_prec > 100) {
|
||||
dc_prec = 100;
|
||||
}
|
||||
break;
|
||||
case RAK_IPSO_DC_CURRENT:
|
||||
dc_cur = (msg[2] << 8) + msg[1];
|
||||
break;
|
||||
case RAK_IPSO_DC_VOLTAGE:
|
||||
dc_vol = (msg[2] << 8) + msg[1];
|
||||
dc_vol *= 10;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
break;
|
||||
case SNHUBAPI_EVT_REPORT:
|
||||
|
||||
// LOG_INFO("+EVT:PID[%02x],IPSO[%02x]",pid,msg[0]);
|
||||
// for( uint16_t i=1; i<len; i++)
|
||||
// {
|
||||
// LOG_INFO("%02x,", msg[i]);
|
||||
// }
|
||||
// LOG_INFO("");
|
||||
|
||||
switch (msg[0]) {
|
||||
case RAK_IPSO_CAPACITY:
|
||||
dc_prec = msg[1];
|
||||
if (dc_prec > 100) {
|
||||
dc_prec = 100;
|
||||
}
|
||||
break;
|
||||
case RAK_IPSO_DC_CURRENT:
|
||||
dc_cur = (msg[1] << 8) + msg[2];
|
||||
break;
|
||||
case RAK_IPSO_DC_VOLTAGE:
|
||||
dc_vol = (msg[1] << 8) + msg[2];
|
||||
dc_vol *= 10;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case SNHUBAPI_EVT_CHKSUM_ERR:
|
||||
LOG_INFO("+ERR:CHKSUM");
|
||||
break;
|
||||
|
||||
case SNHUBAPI_EVT_SEQ_ERR:
|
||||
LOG_INFO("+ERR:SEQUCE");
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static int32_t onewireHandle()
|
||||
{
|
||||
if (provision != 0) {
|
||||
RakSNHub_Protocl_API.get.data(provision);
|
||||
provision = 0;
|
||||
}
|
||||
|
||||
while (mySerial.available()) {
|
||||
char a = mySerial.read();
|
||||
buff[bufflen++] = a;
|
||||
delay(2); // continue data, timeout=2ms
|
||||
}
|
||||
|
||||
if (bufflen != 0) {
|
||||
RakSNHub_Protocl_API.process((uint8_t *)buff, bufflen);
|
||||
bufflen = 0;
|
||||
}
|
||||
|
||||
return 50;
|
||||
}
|
||||
|
||||
int32_t RAK9154Sensor::runOnce()
|
||||
{
|
||||
onewirePeriodic = new Periodic("onewireHandle", onewireHandle);
|
||||
|
||||
mySerial.begin(9600);
|
||||
|
||||
RakSNHub_Protocl_API.init(onewire_evt);
|
||||
|
||||
status = true;
|
||||
initialized = true;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void RAK9154Sensor::setup()
|
||||
{
|
||||
// Set up oversampling and filter initialization
|
||||
}
|
||||
|
||||
bool RAK9154Sensor::getMetrics(meshtastic_Telemetry *measurement)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
uint16_t RAK9154Sensor::getBusVoltageMv()
|
||||
{
|
||||
return dc_vol;
|
||||
}
|
||||
|
||||
int RAK9154Sensor::getBusBatteryPercent()
|
||||
{
|
||||
return (int)dc_prec;
|
||||
}
|
||||
|
||||
bool RAK9154Sensor::isCharging()
|
||||
{
|
||||
return (dc_cur > 0) ? true : false;
|
||||
}
|
||||
#endif // HAS_RAKPROT
|
||||
@@ -1,23 +0,0 @@
|
||||
#ifdef HAS_RAKPROT
|
||||
#ifndef _RAK9154SENSOR_H
|
||||
#define _RAK9154SENSOR_H 1
|
||||
#include "../mesh/generated/meshtastic/telemetry.pb.h"
|
||||
#include "../modules/Telemetry/Sensor/TelemetrySensor.h"
|
||||
#include "../modules/Telemetry/Sensor/VoltageSensor.h"
|
||||
|
||||
class RAK9154Sensor : public TelemetrySensor, VoltageSensor
|
||||
{
|
||||
private:
|
||||
protected:
|
||||
virtual void setup() override;
|
||||
|
||||
public:
|
||||
RAK9154Sensor();
|
||||
virtual int32_t runOnce() override;
|
||||
virtual bool getMetrics(meshtastic_Telemetry *measurement) override;
|
||||
virtual uint16_t getBusVoltageMv() override;
|
||||
int getBusBatteryPercent();
|
||||
bool isCharging();
|
||||
};
|
||||
#endif // _RAK9154SENSOR_H
|
||||
#endif // HAS_RAKPROT
|
||||
@@ -1,113 +0,0 @@
|
||||
import struct
|
||||
|
||||
Import("env") # noqa: F821
|
||||
|
||||
|
||||
# Parse input and create UF2 file
|
||||
def create_uf2(source, target, env):
|
||||
# source_hex = target[0].get_abspath()
|
||||
source_hex = target[0].get_string(False)
|
||||
source_hex = ".\\" + source_hex
|
||||
print("#########################################################")
|
||||
print("Create UF2 from " + source_hex)
|
||||
print("#########################################################")
|
||||
# print("Source: " + source_hex)
|
||||
target = source_hex.replace(".hex", "")
|
||||
target = target + ".uf2"
|
||||
# print("Target: " + target)
|
||||
|
||||
with open(source_hex, mode="rb") as f:
|
||||
inpbuf = f.read()
|
||||
|
||||
outbuf = convert_from_hex_to_uf2(inpbuf.decode("utf-8"))
|
||||
|
||||
write_file(target, outbuf)
|
||||
print("#########################################################")
|
||||
print(target + " is ready to flash to target device")
|
||||
print("#########################################################")
|
||||
|
||||
|
||||
# Add callback after .hex file was created
|
||||
env.AddPostAction("$BUILD_DIR/${PROGNAME}.hex", create_uf2) # noqa: F821
|
||||
|
||||
# UF2 creation taken from uf2conv.py
|
||||
UF2_MAGIC_START0 = 0x0A324655 # "UF2\n"
|
||||
UF2_MAGIC_START1 = 0x9E5D5157 # Randomly selected
|
||||
UF2_MAGIC_END = 0x0AB16F30 # Ditto
|
||||
|
||||
familyid = 0xADA52840
|
||||
|
||||
|
||||
class Block:
|
||||
def __init__(self, addr):
|
||||
self.addr = addr
|
||||
self.bytes = bytearray(256)
|
||||
|
||||
def encode(self, blockno, numblocks):
|
||||
global familyid
|
||||
flags = 0x0
|
||||
if familyid:
|
||||
flags |= 0x2000
|
||||
hd = struct.pack(
|
||||
"<IIIIIIII",
|
||||
UF2_MAGIC_START0,
|
||||
UF2_MAGIC_START1,
|
||||
flags,
|
||||
self.addr,
|
||||
256,
|
||||
blockno,
|
||||
numblocks,
|
||||
familyid,
|
||||
)
|
||||
hd += self.bytes[0:256]
|
||||
while len(hd) < 512 - 4:
|
||||
hd += b"\x00"
|
||||
hd += struct.pack("<I", UF2_MAGIC_END)
|
||||
return hd
|
||||
|
||||
|
||||
def write_file(name, buf):
|
||||
with open(name, "wb") as f:
|
||||
f.write(buf)
|
||||
# print("Wrote %d bytes to %s." % (len(buf), name))
|
||||
|
||||
|
||||
def convert_from_hex_to_uf2(buf):
|
||||
global appstartaddr
|
||||
appstartaddr = None
|
||||
upper = 0
|
||||
currblock = None
|
||||
blocks = []
|
||||
for line in buf.split("\n"):
|
||||
if line[0] != ":":
|
||||
continue
|
||||
i = 1
|
||||
rec = []
|
||||
while i < len(line) - 1:
|
||||
rec.append(int(line[i : i + 2], 16))
|
||||
i += 2
|
||||
tp = rec[3]
|
||||
if tp == 4:
|
||||
upper = ((rec[4] << 8) | rec[5]) << 16
|
||||
elif tp == 2:
|
||||
upper = ((rec[4] << 8) | rec[5]) << 4
|
||||
assert (upper & 0xFFFF) == 0
|
||||
elif tp == 1:
|
||||
break
|
||||
elif tp == 0:
|
||||
addr = upper | (rec[1] << 8) | rec[2]
|
||||
if appstartaddr is None:
|
||||
appstartaddr = addr
|
||||
i = 4
|
||||
while i < len(rec) - 1:
|
||||
if not currblock or currblock.addr & ~0xFF != addr & ~0xFF:
|
||||
currblock = Block(addr & ~0xFF)
|
||||
blocks.append(currblock)
|
||||
currblock.bytes[addr & 0xFF] = rec[i]
|
||||
addr += 1
|
||||
i += 1
|
||||
numblocks = len(blocks)
|
||||
resfile = b""
|
||||
for i in range(0, numblocks):
|
||||
resfile += blocks[i].encode(i, numblocks)
|
||||
return resfile
|
||||
@@ -15,8 +15,6 @@ lib_deps =
|
||||
${nrf52840_base.lib_deps}
|
||||
${networking_base.lib_deps}
|
||||
melopero/Melopero RV3028@^1.1.0
|
||||
rakwireless/RAKwireless NCP5623 RGB LED library@^1.0.2
|
||||
beegee-tokyo/RAKwireless RAK12034@^1.0.0
|
||||
https://github.com/beegee-tokyo/RAK-OneWireSerial.git#0.0.2
|
||||
debug_tool = jlink
|
||||
; If not set we will default to uploading over serial (first it forces bootloader entry by talking 1200bps to cdcacm)
|
||||
|
||||
@@ -107,15 +107,11 @@ static const uint8_t AREF = PIN_AREF;
|
||||
/*
|
||||
* SPI Interfaces
|
||||
*/
|
||||
#define SPI_INTERFACES_COUNT 2
|
||||
#define SPI_INTERFACES_COUNT 1
|
||||
|
||||
#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)
|
||||
#define PIN_SPI_MISO (29)
|
||||
#define PIN_SPI_MOSI (30)
|
||||
#define PIN_SPI_SCK (3)
|
||||
|
||||
static const uint8_t SS = 42;
|
||||
static const uint8_t MOSI = PIN_SPI_MOSI;
|
||||
@@ -130,8 +126,8 @@ static const uint8_t SCK = PIN_SPI_SCK;
|
||||
#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 PIN_EINK_SCLK PIN_SPI_SCK
|
||||
#define PIN_EINK_MOSI PIN_SPI_MOSI // also called SDI
|
||||
|
||||
// #define USE_EINK
|
||||
|
||||
@@ -259,7 +255,7 @@ SO GPIO 39/TXEN MAY NOT BE DEFINED FOR SUCCESSFUL OPERATION OF THE SX1262 - TG
|
||||
|
||||
#define PIN_ETHERNET_RESET 21
|
||||
#define PIN_ETHERNET_SS PIN_EINK_CS
|
||||
#define ETH_SPI_PORT SPI1
|
||||
#define ETH_SPI_PORT SPI
|
||||
#define AQ_SET_PIN 10
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
@@ -73,5 +73,8 @@
|
||||
#define SX126X_RESET LORA_RESET
|
||||
#define SX126X_DIO2_AS_RF_SWITCH
|
||||
|
||||
#define TCXO_OPTIONAL // handle Indicator V1 and V2
|
||||
#define SX126X_DIO3_TCXO_VOLTAGE 2.4
|
||||
|
||||
#define USE_VIRTUAL_KEYBOARD 1
|
||||
#define DISPLAY_CLOCK_FRAME 1
|
||||
|
||||
@@ -14,9 +14,6 @@ build_flags = ${nrf52840_base.build_flags} -Ivariants/t-echo
|
||||
-DEINK_HEIGHT=200
|
||||
-DUSE_EINK_DYNAMICDISPLAY ; Enable Dynamic EInk
|
||||
-DEINK_LIMIT_FASTREFRESH=20 ; 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
|
||||
; -DEINK_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.
|
||||
|
||||
build_src_filter = ${nrf52_base.build_src_filter} +<../variants/t-echo>
|
||||
|
||||
@@ -12,11 +12,6 @@ build_flags =
|
||||
-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
|
||||
-DEINK_HASQUIRK_VICIOUSFASTREFRESH ; Identify that pixels drawn by fast-refresh are harder to clear
|
||||
;-DEINK_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.
|
||||
|
||||
lib_deps =
|
||||
${esp32s3_base.lib_deps}
|
||||
|
||||
@@ -55,7 +55,7 @@ extern "C" {
|
||||
#define BUTTON_PIN (0 + 6) // P0.06
|
||||
#define BUTTON_ACTIVE_LOW false
|
||||
#define BUTTON_ACTIVE_PULLUP false
|
||||
#define BUTTON_SENSE_TYPE 0x6
|
||||
#define BUTTON_SENSE_TYPE 0x5 // enable input pull-down
|
||||
|
||||
#define HAS_WIRE 1
|
||||
|
||||
|
||||
Reference in New Issue
Block a user