mirror of
https://github.com/apache/nuttx.git
synced 2026-08-27 12:20:46 +00:00
Expose the Ameba on-chip RTC as a NuttX date/time RTC at /dev/rtc0 (rdtime/settime) with a single one-shot alarm (setalarm/rdalarm/ cancelalarm/setrelative) that fires the RTC interrupt and the upper-half callback. The same hardware also backs the arch date/time RTC hooks (up_rtc_initialize/getdatetime/settime, g_rtc_enabled) so the NuttX system time is seeded from it. The driver sits on the SDK fwlib RTC API (mirrored structures + local externs, no vendor headers pulled into the NuttX include world). The fwlib RTC API lives in the RAM source ameba_rtc.c, so it is added to the board fwlib build under CONFIG_AMEBA_RTC. The hardware keeps a year plus a day-of-year (no month/day register); the driver bridges that to the NuttX month/day calendar with the libc UTC routines (timegm/gmtime_r), which is exact and reversible. The only per-chip fact -- the RTC interrupt vector -- lives in the per-chip ameba_rtc_chip.h; the shared driver is never edited for a new Ameba chip. A configs/rtc profile (examples/alarm) is added for verification. Signed-off-by: dechao_gong <dechao_gong@realsil.com.cn> Assisted-by: Claude <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| _extensions | ||
| _static | ||
| _templates | ||
| applications | ||
| components | ||
| contributing | ||
| debugging | ||
| faq | ||
| guides | ||
| implementation | ||
| introduction | ||
| logos | ||
| platforms | ||
| quickstart | ||
| reference | ||
| ReleaseNotes | ||
| standards | ||
| testing | ||
| .gitignore | ||
| conf.py | ||
| glossary.rst | ||
| index.rst | ||
| known-warnings.txt | ||
| legacy_README.md | ||
| make.bat | ||
| Makefile | ||
| Pipfile | ||
| Pipfile.lock | ||
| security.rst | ||
| substitutions.rst | ||