mirror of
https://github.com/apache/nuttx.git
synced 2026-09-06 17:06:31 +00:00
Add a parameterised NuttX timer lower-half for the Realtek Ameba general-purpose timers, sitting on the SDK fwlib RTIM register layer and registered at /dev/timerN. The shared driver (arch/arm/src/common/ameba/ameba_timer.c) reads a per-chip instance table (ameba_timer_chip.h) for each timer's base, input clock, RCC gate masks and IRQ; the period is programmed directly in microseconds and converted to the 32-bit auto-reload with one clkfreq formula. On the pke8721daf two of the 32.768 kHz "basic" (LTIM) timers are exposed: /dev/timer0 is TIM1 and /dev/timer1 is TIM2. TIM0 is left untouched because the boot ROM claims it as the always-on system timer (SYSTIMER); reprogramming it would break every SDK delay. The RTIM time-base entry points resolve to ROM, while the interrupt-clear and period-change helpers come from the fwlib RAM source ameba_tim.c (shared with the PWM driver). Verified on hardware with examples/timer against both devices: the update interrupt fires at the requested 1 s interval (measured with the independent ROM SYSTIMER = 32768 ticks = 1.000 s). Also whitelist the vendor RTIM_ symbol prefix in tools/nxstyle.c, alongside the existing RCC_/SYSTIMER_ Ameba SDK entries. Assisted-by: Claude <noreply@anthropic.com> Signed-off-by: dechao_gong <dechao_gong@realsil.com.cn> |
||
|---|---|---|
| .. | ||
| arm | ||
| arm64 | ||
| avr | ||
| ceva | ||
| dummy | ||
| hc | ||
| mips | ||
| misoc | ||
| or1k | ||
| renesas | ||
| risc-v | ||
| sim | ||
| sparc | ||
| tricore | ||
| x86 | ||
| x86_64 | ||
| xtensa | ||
| z16 | ||
| z80 | ||
| CMakeLists.txt | ||
| Kconfig | ||