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> |
||
|---|---|---|
| .. | ||
| arm | ||
| arm64 | ||
| avr | ||
| dummy | ||
| hc/m9s12 | ||
| mips | ||
| misoc/lm32/misoc | ||
| or1k/mor1kx/or1k | ||
| renesas | ||
| risc-v | ||
| sim/sim/sim | ||
| sparc | ||
| tricore | ||
| x86/qemu/qemu-i486 | ||
| x86_64/qemu/qemu-intel64 | ||
| xtensa | ||
| z16/z16f/z16f2800100zcog | ||
| z80 | ||
| .gitignore | ||
| Board.mk | ||
| boardctl.c | ||
| CMakeLists.txt | ||
| dummy.c | ||
| Kconfig | ||
| Makefile | ||