Add T3S3 target and different variants of the board
This commit is contained in:
parent
236ea0b999
commit
35e9f36ffd
25
Boards.h
25
Boards.h
@ -24,6 +24,7 @@
|
|||||||
#define MCU_ESP32 0x81
|
#define MCU_ESP32 0x81
|
||||||
#define MCU_NRF52 0x71
|
#define MCU_NRF52 0x71
|
||||||
|
|
||||||
|
// Boards
|
||||||
#define BOARD_RNODE 0x31
|
#define BOARD_RNODE 0x31
|
||||||
#define BOARD_HMBRW 0x32
|
#define BOARD_HMBRW 0x32
|
||||||
#define BOARD_TBEAM 0x33
|
#define BOARD_TBEAM 0x33
|
||||||
@ -36,10 +37,16 @@
|
|||||||
#define BOARD_HELTEC32_V3 0x3A
|
#define BOARD_HELTEC32_V3 0x3A
|
||||||
#define BOARD_RNODE_NG_20 0x40
|
#define BOARD_RNODE_NG_20 0x40
|
||||||
#define BOARD_RNODE_NG_21 0x41
|
#define BOARD_RNODE_NG_21 0x41
|
||||||
#define BOARD_RNODE_NG_22 0x42
|
#define BOARD_T3S3 0x42
|
||||||
#define BOARD_GENERIC_NRF52 0x50
|
#define BOARD_GENERIC_NRF52 0x50
|
||||||
#define BOARD_RAK4631 0x51
|
#define BOARD_RAK4631 0x51
|
||||||
|
|
||||||
|
// Variants
|
||||||
|
#define BOARD_T3S3_SX1262 0x01
|
||||||
|
#define BOARD_T3S3_SX1280 0x02
|
||||||
|
#define BOARD_T3S3_SX1280_PA 0x03
|
||||||
|
|
||||||
|
// Displays
|
||||||
#define OLED 0x01
|
#define OLED 0x01
|
||||||
#define EINK_BW 0x02
|
#define EINK_BW 0x02
|
||||||
#define EINK_3C 0x03
|
#define EINK_3C 0x03
|
||||||
@ -545,7 +552,7 @@
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
#elif BOARD_MODEL == BOARD_RNODE_NG_22
|
#elif BOARD_MODEL == BOARD_T3S3
|
||||||
#define IS_ESP32S3 true
|
#define IS_ESP32S3 true
|
||||||
|
|
||||||
#define HAS_DISPLAY true
|
#define HAS_DISPLAY true
|
||||||
@ -585,7 +592,7 @@
|
|||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if BOARD_VARIANT == BOARD_T3S3_SX1262
|
||||||
const uint8_t interfaces[INTERFACE_COUNT] = {SX1262};
|
const uint8_t interfaces[INTERFACE_COUNT] = {SX1262};
|
||||||
const bool interface_cfg[INTERFACE_COUNT][3] = {
|
const bool interface_cfg[INTERFACE_COUNT][3] = {
|
||||||
// SX1262
|
// SX1262
|
||||||
@ -595,6 +602,17 @@
|
|||||||
true // DIO2_AS_RF_SWITCH
|
true // DIO2_AS_RF_SWITCH
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
#elif BOARD_VARIANT == BOARD_T3S3_SX1280_PA
|
||||||
|
const uint8_t interfaces[INTERFACE_COUNT] = {SX1280};
|
||||||
|
const bool interface_cfg[INTERFACE_COUNT][3] = {
|
||||||
|
// SX1262
|
||||||
|
{
|
||||||
|
false, // DEFAULT_SPI
|
||||||
|
false, // HAS_TCXO
|
||||||
|
false // DIO2_AS_RF_SWITCH
|
||||||
|
},
|
||||||
|
};
|
||||||
|
#endif
|
||||||
const uint8_t interface_pins[INTERFACE_COUNT][10] = {
|
const uint8_t interface_pins[INTERFACE_COUNT][10] = {
|
||||||
// SX1262
|
// SX1262
|
||||||
{
|
{
|
||||||
@ -610,7 +628,6 @@
|
|||||||
-1 // pin_tcxo_enable
|
-1 // pin_tcxo_enable
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
#else
|
#else
|
||||||
#error An unsupported ESP32 board was selected. Cannot compile RNode firmware.
|
#error An unsupported ESP32 board was selected. Cannot compile RNode firmware.
|
||||||
#endif
|
#endif
|
||||||
|
@ -68,7 +68,7 @@ void busyCallback(const void* p) {
|
|||||||
#define DISP_RST -1
|
#define DISP_RST -1
|
||||||
#define DISP_ADDR 0x3C
|
#define DISP_ADDR 0x3C
|
||||||
#endif
|
#endif
|
||||||
#elif BOARD_MODEL == BOARD_RNODE_NG_22
|
#elif BOARD_MODEL == BOARD_T3S3
|
||||||
#if DISPLAY == OLED
|
#if DISPLAY == OLED
|
||||||
#define DISP_RST 21
|
#define DISP_RST 21
|
||||||
#define DISP_ADDR 0x3C
|
#define DISP_ADDR 0x3C
|
||||||
@ -200,7 +200,7 @@ bool display_init() {
|
|||||||
digitalWrite(pin_display_en, LOW);
|
digitalWrite(pin_display_en, LOW);
|
||||||
delay(50);
|
delay(50);
|
||||||
digitalWrite(pin_display_en, HIGH);
|
digitalWrite(pin_display_en, HIGH);
|
||||||
#elif BOARD_MODEL == BOARD_RNODE_NG_22
|
#elif BOARD_MODEL == BOARD_T3S3
|
||||||
Wire.begin(SDA_OLED, SCL_OLED);
|
Wire.begin(SDA_OLED, SCL_OLED);
|
||||||
#elif BOARD_MODEL == BOARD_HELTEC32_V2
|
#elif BOARD_MODEL == BOARD_HELTEC32_V2
|
||||||
Wire.begin(SDA_OLED, SCL_OLED);
|
Wire.begin(SDA_OLED, SCL_OLED);
|
||||||
|
7
Makefile
7
Makefile
@ -71,8 +71,11 @@ firmware-tbeam:
|
|||||||
firmware-tbeam_sx126x:
|
firmware-tbeam_sx126x:
|
||||||
arduino-cli compile --fqbn esp32:esp32:t-beam -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0x33\" \"-DMODEM=0x03\""
|
arduino-cli compile --fqbn esp32:esp32:t-beam -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0x33\" \"-DMODEM=0x03\""
|
||||||
|
|
||||||
firmware-t3s3:
|
firmware-t3s3_sx1262:
|
||||||
arduino-cli compile --fqbn "esp32:esp32:esp32s3:CDCOnBoot=cdc" -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0x42\""
|
arduino-cli compile --fqbn "esp32:esp32:esp32s3:CDCOnBoot=cdc" -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0x42\" \"-DBOARD_VARIANT=0x01\""
|
||||||
|
|
||||||
|
firmware-t3s3_sx1280_pa:
|
||||||
|
arduino-cli compile --fqbn "esp32:esp32:esp32s3:CDCOnBoot=cdc" -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0x42\" \"-DBOARD_VARIANT=0x03\""
|
||||||
|
|
||||||
firmware-lora32_v10:
|
firmware-lora32_v10:
|
||||||
arduino-cli compile --fqbn esp32:esp32:ttgo-lora32 -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0x39\""
|
arduino-cli compile --fqbn esp32:esp32:ttgo-lora32 -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0x39\""
|
||||||
|
@ -87,7 +87,7 @@ void setup() {
|
|||||||
|
|
||||||
Serial.begin(serial_baudrate);
|
Serial.begin(serial_baudrate);
|
||||||
|
|
||||||
#if BOARD_MODEL != BOARD_RAK4631 && BOARD_MODEL != BOARD_RNODE_NG_22
|
#if BOARD_MODEL != BOARD_RAK4631 && BOARD_MODEL != BOARD_T3S3
|
||||||
// Some boards need to wait until the hardware UART is set up before booting
|
// Some boards need to wait until the hardware UART is set up before booting
|
||||||
// the full firmware. In the case of the RAK4631, the line below will wait
|
// the full firmware. In the case of the RAK4631, the line below will wait
|
||||||
// until a serial connection is actually established with a master. Thus, it
|
// until a serial connection is actually established with a master. Thus, it
|
||||||
@ -1283,7 +1283,7 @@ void process_serial() {
|
|||||||
|
|
||||||
void sleep_now() {
|
void sleep_now() {
|
||||||
#if HAS_SLEEP == true
|
#if HAS_SLEEP == true
|
||||||
#if BOARD_MODEL == BOARD_RNODE_NG_22
|
#if BOARD_MODEL == BOARD_T3S3
|
||||||
display_intensity = 0;
|
display_intensity = 0;
|
||||||
update_display(true);
|
update_display(true);
|
||||||
#endif
|
#endif
|
||||||
|
@ -735,7 +735,7 @@ void sx126x::enableTCXO() {
|
|||||||
uint8_t buf[4] = {MODE_TCXO_3_3V_6X, 0x00, 0x00, 0xFF};
|
uint8_t buf[4] = {MODE_TCXO_3_3V_6X, 0x00, 0x00, 0xFF};
|
||||||
#elif BOARD_MODEL == BOARD_TBEAM
|
#elif BOARD_MODEL == BOARD_TBEAM
|
||||||
uint8_t buf[4] = {MODE_TCXO_1_8V_6X, 0x00, 0x00, 0xFF};
|
uint8_t buf[4] = {MODE_TCXO_1_8V_6X, 0x00, 0x00, 0xFF};
|
||||||
#elif BOARD_MODEL == BOARD_RNODE_NG_22
|
#elif BOARD_MODEL == BOARD_T3S3
|
||||||
uint8_t buf[4] = {MODE_TCXO_1_8V_6X, 0x00, 0x00, 0xFF};
|
uint8_t buf[4] = {MODE_TCXO_1_8V_6X, 0x00, 0x00, 0xFF};
|
||||||
#else
|
#else
|
||||||
uint8_t buf[4] = {0};
|
uint8_t buf[4] = {0};
|
||||||
|
@ -65,9 +65,9 @@ uint8_t eeprom_read(uint32_t mapped_addr);
|
|||||||
#if BOARD_MODEL == BOARD_HELTEC32_V3
|
#if BOARD_MODEL == BOARD_HELTEC32_V3
|
||||||
//https://github.com/espressif/esp-idf/issues/8855
|
//https://github.com/espressif/esp-idf/issues/8855
|
||||||
#include "hal/wdt_hal.h"
|
#include "hal/wdt_hal.h"
|
||||||
#elif BOARD_MODEL == BOARD_RNODE_NG_22
|
#elif BOARD_MODEL == BOARD_T3S3
|
||||||
#include "hal/wdt_hal.h"
|
#include "hal/wdt_hal.h"
|
||||||
#else BOARD_MODEL != BOARD_RNODE_NG_22
|
#else BOARD_MODEL != BOARD_T3S3
|
||||||
#include "soc/rtc_wdt.h"
|
#include "soc/rtc_wdt.h"
|
||||||
#endif
|
#endif
|
||||||
#define ISR_VECT IRAM_ATTR
|
#define ISR_VECT IRAM_ATTR
|
||||||
@ -137,7 +137,7 @@ uint8_t boot_vector = 0x00;
|
|||||||
void led_rx_off() { digitalWrite(pin_led_rx, LOW); }
|
void led_rx_off() { digitalWrite(pin_led_rx, LOW); }
|
||||||
void led_tx_on() { digitalWrite(pin_led_tx, HIGH); }
|
void led_tx_on() { digitalWrite(pin_led_tx, HIGH); }
|
||||||
void led_tx_off() { digitalWrite(pin_led_tx, LOW); }
|
void led_tx_off() { digitalWrite(pin_led_tx, LOW); }
|
||||||
#elif BOARD_MODEL == BOARD_RNODE_NG_22
|
#elif BOARD_MODEL == BOARD_T3S3
|
||||||
void led_rx_on() { digitalWrite(pin_led_rx, HIGH); }
|
void led_rx_on() { digitalWrite(pin_led_rx, HIGH); }
|
||||||
void led_rx_off() { digitalWrite(pin_led_rx, LOW); }
|
void led_rx_off() { digitalWrite(pin_led_rx, LOW); }
|
||||||
void led_tx_on() { digitalWrite(pin_led_tx, HIGH); }
|
void led_tx_on() { digitalWrite(pin_led_tx, HIGH); }
|
||||||
@ -1332,7 +1332,7 @@ bool eeprom_model_valid() {
|
|||||||
if (model == MODEL_A3 || model == MODEL_A8) {
|
if (model == MODEL_A3 || model == MODEL_A8) {
|
||||||
#elif BOARD_MODEL == BOARD_RNODE_NG_21
|
#elif BOARD_MODEL == BOARD_RNODE_NG_21
|
||||||
if (model == MODEL_A2 || model == MODEL_A7) {
|
if (model == MODEL_A2 || model == MODEL_A7) {
|
||||||
#elif BOARD_MODEL == BOARD_RNODE_NG_22
|
#elif BOARD_MODEL == BOARD_T3S3
|
||||||
if (model == MODEL_A1 || model == MODEL_A6) {
|
if (model == MODEL_A1 || model == MODEL_A6) {
|
||||||
#elif BOARD_MODEL == BOARD_HMBRW
|
#elif BOARD_MODEL == BOARD_HMBRW
|
||||||
if (model == MODEL_FF || model == MODEL_FE) {
|
if (model == MODEL_FF || model == MODEL_FE) {
|
||||||
|
Loading…
Reference in New Issue
Block a user