mirror of
https://github.com/meshcore-dev/MeshCore.git
synced 2026-03-30 12:45:45 +00:00
T-Beam Supreme: Repeater and BLE working. Added PCF8563 RTC
This commit is contained in:
@@ -569,13 +569,16 @@ build_flags =
|
||||
-D SX126X_RX_BOOSTED_GAIN=1
|
||||
lib_deps =
|
||||
${esp32_base.lib_deps}
|
||||
adafruit/Adafruit SSD1306 @ ^2.5.13
|
||||
lewisxhe/PCF8563_Library@^1.0.1
|
||||
lewisxhe/XPowersLib @ ^0.2.7
|
||||
build_src_filter = ${esp32_base.build_src_filter}
|
||||
+<../variants/lilygo_tbeam_supreme_SX1262>
|
||||
board_build.partitions = min_spiffs.csv
|
||||
|
||||
[env:T_Beam_S3_Supreme_SX1262_Repeater]
|
||||
extends = T_Beam_S3_Supreme_SX1262
|
||||
build_flags =
|
||||
${T_Beam_S3_Supreme_SX1262.build_flags}
|
||||
-D DISPLAY_CLASS=SSD1306Display
|
||||
-D ADVERT_NAME='"T-Beam S3 Supreme SX1262 Repeater"'
|
||||
-D ADVERT_LAT=0
|
||||
-D ADVERT_LON=0
|
||||
@@ -583,18 +586,9 @@ build_flags =
|
||||
build_src_filter = ${T_Beam_S3_Supreme_SX1262.build_src_filter}
|
||||
+<helpers/ui/*.cpp>
|
||||
+<../examples/simple_repeater>
|
||||
lib_deps =
|
||||
lib_deps =
|
||||
${T_Beam_S3_Supreme_SX1262.lib_deps}
|
||||
${esp32_ota.lib_deps}
|
||||
lib_deps =
|
||||
me-no-dev/AsyncTCP@^3.3.2
|
||||
esp32async/ESPAsyncWebServer@^3.7.5
|
||||
rweather/Crypto@^0.4.0
|
||||
jgromes/RadioLib@^7.1.2
|
||||
adafruit/RTClib@^2.1.4
|
||||
melopero/Melopero RV3028@^1.1.0
|
||||
adafruit/Adafruit GFX Library@^1.12.0
|
||||
adafruit/Adafruit SSD1306@^2.5.13
|
||||
|
||||
[LilyGo_TLora_V2_1_1_6]
|
||||
extends = esp32_base
|
||||
@@ -908,6 +902,7 @@ lib_deps =
|
||||
jgromes/RadioLib@^7.1.2
|
||||
adafruit/RTClib@^2.1.4
|
||||
melopero/Melopero RV3028@^1.1.0
|
||||
lewisxhe/PCF8563_Library@^1.0.1
|
||||
adafruit/Adafruit GFX Library@^1.12.0
|
||||
adafruit/Adafruit SSD1306@^2.5.13
|
||||
|
||||
@@ -931,6 +926,7 @@ lib_deps =
|
||||
jgromes/RadioLib@^7.1.2
|
||||
adafruit/RTClib@^2.1.4
|
||||
melopero/Melopero RV3028@^1.1.0
|
||||
lewisxhe/PCF8563_Library@^1.0.1
|
||||
adafruit/Adafruit GFX Library@^1.12.0
|
||||
adafruit/Adafruit SSD1306@^2.5.13
|
||||
|
||||
@@ -1129,6 +1125,7 @@ lib_deps =
|
||||
jgromes/RadioLib@^7.1.2
|
||||
adafruit/RTClib@^2.1.4
|
||||
melopero/Melopero RV3028@^1.1.0
|
||||
lewisxhe/PCF8563_Library@^1.0.1
|
||||
adafruit/Adafruit GFX Library@^1.12.0
|
||||
adafruit/Adafruit SSD1306@^2.5.13
|
||||
|
||||
@@ -1150,6 +1147,7 @@ lib_deps =
|
||||
jgromes/RadioLib@^7.1.2
|
||||
adafruit/RTClib@^2.1.4
|
||||
melopero/Melopero RV3028@^1.1.0
|
||||
lewisxhe/PCF8563_Library@^1.0.1
|
||||
adafruit/Adafruit GFX Library@^1.12.0
|
||||
adafruit/Adafruit SSD1306@^2.5.13
|
||||
|
||||
@@ -1214,6 +1212,7 @@ lib_deps =
|
||||
jgromes/RadioLib@^7.1.2
|
||||
adafruit/RTClib@^2.1.4
|
||||
melopero/Melopero RV3028@^1.1.0
|
||||
lewisxhe/PCF8563_Library@^1.0.1
|
||||
adafruit/Adafruit GFX Library@^1.12.0
|
||||
adafruit/Adafruit SSD1306@^2.5.13
|
||||
|
||||
@@ -1233,6 +1232,7 @@ lib_deps =
|
||||
jgromes/RadioLib@^7.1.2
|
||||
adafruit/RTClib@^2.1.4
|
||||
melopero/Melopero RV3028@^1.1.0
|
||||
lewisxhe/PCF8563_Library@^1.0.1
|
||||
adafruit/Adafruit GFX Library@^1.12.0
|
||||
adafruit/Adafruit SSD1306@^2.5.13
|
||||
|
||||
@@ -1401,4 +1401,23 @@ build_src_filter = ${Xiao_S3_WIO.build_src_filter}
|
||||
lib_deps =
|
||||
${Xiao_S3_WIO.lib_deps}
|
||||
densaugeo/base64 @ ~1.4.0
|
||||
|
||||
[env:T_Beam_S3_Supreme_SX1262_companion_radio_ble]
|
||||
extends = T_Beam_S3_Supreme_SX1262
|
||||
build_flags =
|
||||
${T_Beam_S3_Supreme_SX1262.build_flags}
|
||||
-D DISPLAY_CLASS=SSD1306Display
|
||||
-D MAX_CONTACTS=100
|
||||
-D MAX_GROUP_CHANNELS=8
|
||||
-D BLE_PIN_CODE=123456
|
||||
-D BLE_DEBUG_LOGGING=1
|
||||
-D MESH_PACKET_LOGGING=1
|
||||
-D MESH_DEBUG=1
|
||||
build_src_filter = ${T_Beam_S3_Supreme_SX1262.build_src_filter}
|
||||
+<helpers/esp32/*.cpp>
|
||||
+<helpers/ui/*.cpp>
|
||||
+<../examples/companion_radio>
|
||||
lib_deps =
|
||||
${T_Beam_S3_Supreme_SX1262.lib_deps}
|
||||
densaugeo/base64 @ ~1.4.0
|
||||
adafruit/Adafruit SSD1306@^2.5.13
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#include "AutoDiscoverRTCClock.h"
|
||||
#include "RTClib.h"
|
||||
#include <Melopero_RV3028.h>
|
||||
#include "pcf8563.h"
|
||||
|
||||
static RTC_DS3231 rtc_3231;
|
||||
static bool ds3231_success = false;
|
||||
@@ -8,8 +9,12 @@ static bool ds3231_success = false;
|
||||
static Melopero_RV3028 rtc_rv3028;
|
||||
static bool rv3028_success = false;
|
||||
|
||||
static RTC_PCF8563 rtc_8563;
|
||||
static bool rtc_8563_success = false;
|
||||
|
||||
#define DS3231_ADDRESS 0x68
|
||||
#define RV3028_ADDRESS 0x52
|
||||
#define PCF8563_ADDRESS 0x51
|
||||
|
||||
bool AutoDiscoverRTCClock::i2c_probe(TwoWire& wire, uint8_t addr) {
|
||||
wire.beginTransmission(addr);
|
||||
@@ -28,6 +33,9 @@ void AutoDiscoverRTCClock::begin(TwoWire& wire) {
|
||||
rtc_rv3028.set24HourMode(); // Set the device to use the 24hour format (default) instead of the 12 hour format
|
||||
rv3028_success = true;
|
||||
}
|
||||
if(i2c_probe(wire,PCF8563_ADDRESS)){
|
||||
rtc_8563_success = rtc_8563.begin(&wire);
|
||||
}
|
||||
}
|
||||
|
||||
uint32_t AutoDiscoverRTCClock::getCurrentTime() {
|
||||
@@ -44,6 +52,9 @@ uint32_t AutoDiscoverRTCClock::getCurrentTime() {
|
||||
rtc_rv3028.getSecond()
|
||||
).unixtime();
|
||||
}
|
||||
if(rtc_8563_success){
|
||||
return rtc_8563.now().unixtime();
|
||||
}
|
||||
return _fallback->getCurrentTime();
|
||||
}
|
||||
|
||||
@@ -52,9 +63,10 @@ void AutoDiscoverRTCClock::setCurrentTime(uint32_t time) {
|
||||
rtc_3231.adjust(DateTime(time));
|
||||
} else if (rv3028_success) {
|
||||
auto dt = DateTime(time);
|
||||
uint8_t weekday = (dt.day() + (uint16_t)((2.6 * dt.month()) - 0.2) - (2 * (dt.year() / 100)) + dt.year() + (uint16_t)(dt.year() / 4) + (uint16_t)(dt.year() / 400)) % 7;
|
||||
|
||||
uint8_t weekday = (dt.day() + (uint16_t)((2.6 * dt.month()) - 0.2) - (2 * (dt.year() / 100)) + dt.year() + (uint16_t)(dt.year() / 4) + (uint16_t)(dt.year() / 400)) % 7;
|
||||
rtc_rv3028.setTime(dt.year(), dt.month(), weekday, dt.day(), dt.hour(), dt.minute(), dt.second());
|
||||
} else if (rtc_8563_success) {
|
||||
rtc_8563.adjust(DateTime(time));
|
||||
} else {
|
||||
_fallback->setCurrentTime(time);
|
||||
}
|
||||
|
||||
@@ -18,9 +18,9 @@
|
||||
#define PIN_BOARD_SDA 17 //SDA for OLED, BME280, and QMC6310U (0x1C)
|
||||
#define PIN_BOARD_SCL 18 //SCL for OLED, BME280, and QMC6310U (0x1C)
|
||||
|
||||
#define PIN_BOARD_SDA_1 42 //SDA for PMU and PFC8563 (RTC)
|
||||
#define PIN_BOARD_SCL_1 41 //SCL for PMU and PFC8563 (RTC)
|
||||
#define PIN_PMU_IRQ 40 //IRQ pin for PMU
|
||||
#define PIN_BOARD_SDA1 42 //SDA for PMU and PFC8563 (RTC)
|
||||
#define PIN_BOARD_SCL1 41 //SCL for PMU and PFC8563 (RTC)
|
||||
#define PIN_PMU_IRQ 40 //IRQ pin for PMU
|
||||
|
||||
#define PIN_USER_BTN 0
|
||||
|
||||
@@ -38,6 +38,16 @@
|
||||
#define P_GPS_WAKE 7 //GPS Wakeup pin
|
||||
#define P_GPS_1PPS 6 //GPS 1PPS pin
|
||||
|
||||
//I2C Wire addresses
|
||||
#define I2C_BME280_ADD 0x76 //BME280 sensor I2C address on Wire
|
||||
#define I2C_OLED_ADD 0x3C //SSD1306/SH1106 OLED I2C address on Wire
|
||||
#define I2C_QMC6310U_ADD 0x1C //QMC6310U mag sensor I2C address on Wire
|
||||
|
||||
//I2C Wire1 addresses
|
||||
#define I2C_RTC_ADD 0x51 //RTC I2C address on Wire1
|
||||
#define I2C_PMU_ADD 0x34 //AXP2101 I2C address on Wire1
|
||||
|
||||
|
||||
|
||||
class TBeamS3SupremeBoard : public ESP32Board {
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ build_src_filter = ${esp32_base.build_src_filter}
|
||||
board_build.partitions = min_spiffs.csv ; get around 4mb flash limit
|
||||
lib_deps =
|
||||
${esp32_base.lib_deps}
|
||||
adafruit/Adafruit SSD1306 @ ^2.5.13
|
||||
lewisxhe/PCF8563_Library@^1.0.1
|
||||
lewisxhe/XPowersLib @ ^0.2.7
|
||||
|
||||
; === LILYGO T-Beam S3 Supreme with SX1262 environments ===
|
||||
@@ -22,7 +22,6 @@ lib_deps =
|
||||
extends = T_Beam_S3_Supreme_SX1262
|
||||
build_flags =
|
||||
${T_Beam_S3_Supreme_SX1262.build_flags}
|
||||
-D DISPLAY_CLASS=SSD1306Display
|
||||
-D ADVERT_NAME='"T-Beam S3 Supreme SX1262 Repeater"'
|
||||
-D ADVERT_LAT=0
|
||||
-D ADVERT_LON=0
|
||||
@@ -43,7 +42,7 @@ build_flags =
|
||||
${T_Beam_S3_Supreme_SX1262.build_flags}
|
||||
-D DISPLAY_CLASS=SSD1306Display
|
||||
-D MAX_CONTACTS=100
|
||||
-D MAX_GROUP_CHANNELS=8
|
||||
-D MAX_GROUP_CHANNELS=1
|
||||
-D BLE_PIN_CODE=123456
|
||||
-D BLE_DEBUG_LOGGING=1
|
||||
; -D ENABLE_PRIVATE_KEY_IMPORT=1
|
||||
|
||||
@@ -30,7 +30,9 @@ static void setPMUIntFlag(){
|
||||
}
|
||||
|
||||
bool power_init() {
|
||||
|
||||
//Start up Wire1 with PMU address
|
||||
Wire1.begin(I2C_PMU_ADD);
|
||||
|
||||
//Set LED to indicate charge state
|
||||
PMU.setChargingLedMode(XPOWERS_CHG_LED_CTRL_CHG);
|
||||
|
||||
@@ -109,7 +111,7 @@ bool power_init() {
|
||||
|
||||
bool radio_init() {
|
||||
fallback_clock.begin();
|
||||
rtc_clock.begin(Wire);
|
||||
rtc_clock.begin(Wire1);
|
||||
|
||||
#ifdef SX126X_DIO3_TCXO_VOLTAGE
|
||||
float tcxo = SX126X_DIO3_TCXO_VOLTAGE;
|
||||
|
||||
Reference in New Issue
Block a user