🛰️Zafer Satılmış - Aviora

External Real-Time Clock (Ext RTC)

When extRTC.use is true, the generator includes the driver header from deviceConfig.driverPath (for example DrvM41T11_RTC.h), defines EXT_RTC_I2C_ADDR and EXT_RTC_I2C_LINE from JSON, and relies on driver-provided macros EXT_RTC_INIT_FUNC, EXT_RTC_GET_TIME_FUNC, EXT_RTC_SET_TIME_FUNC. Middleware MiddRTC uses those macros for the external path. Autogen calls middRtcExtInit, middRtcExtGetTime, and middRtcExtSetTime when external RTC is selected.

JSON Fields

Field Meaning
extRTC.use Enables external RTC path when timeService.use is true.
deviceConfig.i2cAddress Becomes EXT_RTC_I2C_ADDR (e.g. 0x68).
deviceConfig.i2cBusName Becomes EXT_RTC_I2C_LINE (e.g. I2C_LINE_1).
deviceConfig.driverPath Header pulled into Cus_TimeService_Config.h; must define the EXT_RTC_* macro block.

Data Path (Midd RTC)

Figure — External RTC Read Path
flowchart LR
  A[appTimeServiceAutogenGetEpochFromPreferredSource] --> B[middRtcExtGetTime]
  B --> C[MiddRtcStr_t]
  C --> D[appTimeServiceRtcStrToEpoch]
  D --> E[U32 epoch UTC]
              

When Disabled

If extRTC.use is false, Cus defines EXT_RTC_* stubs to FAILURE and I2C macros to safe defaults; autogen does not call external RTC APIs. Internal RTC or Linux local time or soft tick may still be active per priority rules on the Overview page.