Add support for RX8030 RTC (#23855)

This commit is contained in:
Theo Arends 2025-08-31 22:56:32 +02:00
parent 89dc419134
commit d20cebb654
7 changed files with 26 additions and 8 deletions

View File

@ -113,6 +113,7 @@ Note: the `minimal` variant is not listed as it shouldn't be used outside of the
| -USE_PCF85063 | - | - / - | - | - | - | - | | -USE_PCF85063 | - | - / - | - | - | - | - |
| -USE_PCF85363 | - | - / - | - | - | - | - | | -USE_PCF85363 | - | - / - | - | - | - | - |
| -USE_RX8010 | - | - / - | - | - | - | - | | -USE_RX8010 | - | - / - | - | - | - | - |
| -USE_RX8030 | - | - / - | - | - | - | - |
| USE_SHT | - | - / x | - | x | - | - | | USE_SHT | - | - / x | - | x | - | - |
| USE_HTU | - | - / x | - | x | - | - | | USE_HTU | - | - / x | - | x | - | - |
| USE_BMP | - | - / x | - | x | - | - | | USE_BMP | - | - / x | - | x | - | - |

View File

@ -8,6 +8,7 @@ All notable changes to this project will be documented in this file.
- ESP32 ROM SHA Hardware Acceleration to BearSSL (#23819) - ESP32 ROM SHA Hardware Acceleration to BearSSL (#23819)
- Extend state JSON message with functional hostname and ipaddress which could be WiFi or Ethernet - Extend state JSON message with functional hostname and ipaddress which could be WiFi or Ethernet
- Berry multiplication between string and int (#23850) - Berry multiplication between string and int (#23850)
- Support for RX8030 RTC (#23855)
### Breaking Changed ### Breaking Changed
- Berry `animate` framework is DEPRECATED, will be replace by `animation` framework (#23854) - Berry `animate` framework is DEPRECATED, will be replace by `animation` framework (#23854)

View File

@ -128,6 +128,7 @@ Index | Define | Driver | Device | Address(es) | Bus2 | Descrip
88 | USE_QMP6988 | xsns_28 | QMP6988 | 0x56, 0x70 | Yes | Pressure and temperature sensor 88 | USE_QMP6988 | xsns_28 | QMP6988 | 0x56, 0x70 | Yes | Pressure and temperature sensor
89 | USE_HX711_M5SCALES | xsns_34 | M5SCALES | 0x26 | Yes | M5Unit (Mini)Scales(HX711 STM32) U177 89 | USE_HX711_M5SCALES | xsns_34 | M5SCALES | 0x26 | Yes | M5Unit (Mini)Scales(HX711 STM32) U177
90 | USE_RX8010 | xdrv_56 | RX8010 | 0x32 | Yes | RX8010 RTC from IOTTIMER 90 | USE_RX8010 | xdrv_56 | RX8010 | 0x32 | Yes | RX8010 RTC from IOTTIMER
90 | USE_RX8030 | xdrv_56 | RX8030 | 0x32 | Yes | RX8030 RTC from #23855
91 | USE_MS5837 | xsns_116 | MS5837 | 0x76 | | Pressure and temperature sensor 91 | USE_MS5837 | xsns_116 | MS5837 | 0x76 | | Pressure and temperature sensor
92 | USE_PCF85063 | xdrv_56 | PCF85063 | 0x51 | | PCF85063 Real time clock 92 | USE_PCF85063 | xdrv_56 | PCF85063 | 0x51 | | PCF85063 Real time clock
93 | USE_AS33772S | xdrv_119 | AS33772S | 0x52 | Yes | AS33772S USB PD Sink Controller 93 | USE_AS33772S | xdrv_119 | AS33772S | 0x52 | Yes | AS33772S USB PD Sink Controller

View File

@ -119,6 +119,7 @@ The latter links can be used for OTA upgrades too like ``OtaUrl https://ota.tasm
- Commands `LoRaWanDecoder "` and `LoRaWanName "` to clear name [#23394](https://github.com/arendst/Tasmota/issues/23394) - Commands `LoRaWanDecoder "` and `LoRaWanName "` to clear name [#23394](https://github.com/arendst/Tasmota/issues/23394)
- Command `I2sPause` [#23646](https://github.com/arendst/Tasmota/issues/23646) - Command `I2sPause` [#23646](https://github.com/arendst/Tasmota/issues/23646)
- Support for RV3028 RTC [#23672](https://github.com/arendst/Tasmota/issues/23672) - Support for RV3028 RTC [#23672](https://github.com/arendst/Tasmota/issues/23672)
- Support for RX8030 RTC [#23855](https://github.com/arendst/Tasmota/issues/23855)
- Extend state JSON message with functional hostname and ipaddress which could be WiFi or Ethernet - Extend state JSON message with functional hostname and ipaddress which could be WiFi or Ethernet
- Internal function 'WSContentSendRaw_P' [#23641](https://github.com/arendst/Tasmota/issues/23641) - Internal function 'WSContentSendRaw_P' [#23641](https://github.com/arendst/Tasmota/issues/23641)
- Universal display driver for ZJY169S0800TG01 ST7789 280x240 [#23638](https://github.com/arendst/Tasmota/issues/23638) - Universal display driver for ZJY169S0800TG01 ST7789 280x240 [#23638](https://github.com/arendst/Tasmota/issues/23638)

View File

@ -801,6 +801,7 @@
// #define USE_BM8563 // [I2cDriver59] Enable BM8563 RTC - used by M5Stack - support both I2C buses on ESP32 (I2C address 0x51) (+2.5k code) // #define USE_BM8563 // [I2cDriver59] Enable BM8563 RTC - used by M5Stack - support both I2C buses on ESP32 (I2C address 0x51) (+2.5k code)
// #define USE_PCF85363 // [I2cDriver66] Enable PCF85363 RTC - used by Shelly 3EM (I2C address 0x51) (+0k7 code) // #define USE_PCF85363 // [I2cDriver66] Enable PCF85363 RTC - used by Shelly 3EM (I2C address 0x51) (+0k7 code)
// #define USE_RX8010 // [I2cDriver90] Enable RX8010 RTC - used by IOTTIMER - support both I2C buses on ESP32 (I2C address 0x32) (+0k7 code) // #define USE_RX8010 // [I2cDriver90] Enable RX8010 RTC - used by IOTTIMER - support both I2C buses on ESP32 (I2C address 0x32) (+0k7 code)
// #define USE_RX8030 // [I2cDriver90] Enable RX8030 RTC - used by #23855 - support both I2C buses on ESP32 (I2C address 0x32) (+0k7 code)
// #define USE_PCF85063 // [I2cDriver92] Enable PCF85063 RTC support (I2C address 0x51) // #define USE_PCF85063 // [I2cDriver92] Enable PCF85063 RTC support (I2C address 0x51)
// #define USE_DISPLAY // Add I2C/TM1637/MAX7219 Display Support (+2k code) // #define USE_DISPLAY // Add I2C/TM1637/MAX7219 Display Support (+2k code)

View File

@ -928,7 +928,7 @@ constexpr uint32_t feature[] = {
#if defined(USE_I2C) && defined(USE_HX711_M5SCALES) #if defined(USE_I2C) && defined(USE_HX711_M5SCALES)
0x00000100 | // xsns_34_hx711.ino 0x00000100 | // xsns_34_hx711.ino
#endif #endif
#if defined(USE_I2C) && defined(USE_RTC_CHIPS) && defined(USE_RX8010) #if defined(USE_I2C) && defined(USE_RTC_CHIPS) && (defined(USE_RX8010) || defined(USE_RX8030))
0x00000200 | // xdrv_56_rtc_chips.ino 0x00000200 | // xdrv_56_rtc_chips.ino
#endif #endif
#if defined(USE_I2C) && defined(USE_RTC_CHIPS) && defined(USE_PCF85063) #if defined(USE_I2C) && defined(USE_RTC_CHIPS) && defined(USE_PCF85063)

View File

@ -26,6 +26,9 @@
* #define USE_RX8010 * #define USE_RX8010
* RX8010 at I2C address 0x32 * RX8010 at I2C address 0x32
* Used by IOTTIMER (v1 and v2) * Used by IOTTIMER (v1 and v2)
* #define USE_RX8030
* RX8010 at I2C address 0x32
* Used by #23855
\*********************************************************************************************/ \*********************************************************************************************/
#define XDRV_56 56 #define XDRV_56 56
@ -637,12 +640,12 @@ void Pcf85363Detected(void) {
#endif // USE_PCF85363 #endif // USE_PCF85363
/*********************************************************************************************\ /*********************************************************************************************\
* RX8010 - Real Time Clock * RX8010 and RX8030 - Real Time Clock
* based on linux/rtc-rx8010.c * based on linux/rtc-rx8010.c
* *
* I2C Address: 0x32 * I2C Address: 0x32
\*********************************************************************************************/ \*********************************************************************************************/
#ifdef USE_RX8010 #if defined(USE_RX8010) || defined(USE_RX8030)
#define XI2C_90 90 // See I2CDEVICES.md #define XI2C_90 90 // See I2CDEVICES.md
@ -656,7 +659,13 @@ void Pcf85363Detected(void) {
#define RX8010_REG_MDAY 0x14 #define RX8010_REG_MDAY 0x14
#define RX8010_REG_MONTH 0x15 #define RX8010_REG_MONTH 0x15
#define RX8010_REG_YEAR 0x16 #define RX8010_REG_YEAR 0x16
#define RX8010_REG_CTRL 0x1F #ifdef USE_RX8030
#define RX80x0_REG_CTRL 0x1E
#endif
#ifdef USE_RX8010
#undef RX80x0_REG_CTRL
#define RX80x0_REG_CTRL 0x1F
#endif
// Control Register (1Fh) bit positions // Control Register (1Fh) bit positions
#define RX8010_BIT_CTRL_STOP 6 #define RX8010_BIT_CTRL_STOP 6
@ -687,7 +696,7 @@ void Rx8010SetTime(uint32_t epoch_time) {
TIME_T tm; TIME_T tm;
BreakTime(epoch_time, tm); BreakTime(epoch_time, tm);
// Set STOP bit before changing clock/calendar // Set STOP bit before changing clock/calendar
I2cWrite8(RtcChip.address, RX8010_REG_CTRL, I2cRead8(RtcChip.address, RX8010_REG_CTRL, RtcChip.bus) | _BV(RX8010_BIT_CTRL_STOP), RtcChip.bus); I2cWrite8(RtcChip.address, RX80x0_REG_CTRL, I2cRead8(RtcChip.address, RX80x0_REG_CTRL, RtcChip.bus) | _BV(RX8010_BIT_CTRL_STOP), RtcChip.bus);
uint8_t data[7]; uint8_t data[7];
data[0] = Dec2Bcd(tm.second); data[0] = Dec2Bcd(tm.second);
data[1] = Dec2Bcd(tm.minute); data[1] = Dec2Bcd(tm.minute);
@ -698,7 +707,7 @@ void Rx8010SetTime(uint32_t epoch_time) {
data[6] = Dec2Bcd(tm.day_of_week); data[6] = Dec2Bcd(tm.day_of_week);
I2cWriteBuffer(RtcChip.address, RX8010_REG_SEC, data, 7, RtcChip.bus); I2cWriteBuffer(RtcChip.address, RX8010_REG_SEC, data, 7, RtcChip.bus);
// Clear STOP bit after changing clock/calendar // Clear STOP bit after changing clock/calendar
I2cWrite8(RtcChip.address, RX8010_REG_CTRL, I2cRead8(RtcChip.address, RX8010_REG_CTRL, RtcChip.bus) & ~_BV(RX8010_BIT_CTRL_STOP), RtcChip.bus); I2cWrite8(RtcChip.address, RX80x0_REG_CTRL, I2cRead8(RtcChip.address, RX80x0_REG_CTRL, RtcChip.bus) & ~_BV(RX8010_BIT_CTRL_STOP), RtcChip.bus);
} }
/*-------------------------------------------------------------------------------------------*\ /*-------------------------------------------------------------------------------------------*\
@ -709,9 +718,13 @@ void Rx8010Detected(void) {
RtcChip.address = RX8010_ADDRESS; RtcChip.address = RX8010_ADDRESS;
for (RtcChip.bus = 0; RtcChip.bus < 2; RtcChip.bus++) { for (RtcChip.bus = 0; RtcChip.bus < 2; RtcChip.bus++) {
if (!I2cSetDevice(RtcChip.address, RtcChip.bus)) { continue; } if (!I2cSetDevice(RtcChip.address, RtcChip.bus)) { continue; }
if (I2cValidRead(RtcChip.address, RX8010_REG_CTRL, 1, RtcChip.bus)) { if (I2cValidRead(RtcChip.address, RX80x0_REG_CTRL, 1, RtcChip.bus)) {
RtcChip.detected = 1; RtcChip.detected = 1;
#ifdef USE_RX8030
strcpy_P(RtcChip.name, PSTR("RX8030"));
#else
strcpy_P(RtcChip.name, PSTR("RX8010")); strcpy_P(RtcChip.name, PSTR("RX8010"));
#endif
RtcChip.ReadTime = &Rx8010ReadTime; RtcChip.ReadTime = &Rx8010ReadTime;
RtcChip.SetTime = &Rx8010SetTime; RtcChip.SetTime = &Rx8010SetTime;
RtcChip.mem_size = -1; RtcChip.mem_size = -1;
@ -742,7 +755,7 @@ void RtcChipDetect(void) {
#ifdef USE_PCF85363 #ifdef USE_PCF85363
Pcf85363Detected(); Pcf85363Detected();
#endif // USE_PCF85363 #endif // USE_PCF85363
#ifdef USE_RX8010 #if defined(USE_RX8010) || defined(USE_RX8030)
Rx8010Detected(); Rx8010Detected();
#endif // USE_RX8010 #endif // USE_RX8010
#ifdef USE_PCF85063 #ifdef USE_PCF85063