Fix-Point commented on PR #17345:
URL: https://github.com/apache/nuttx/pull/17345#issuecomment-3560964929

   > @Fix-Point See the message we got in the Discord:
   > 
   > "Parthiban (Linumiz) — 10/16/25, 11:51 PM Morgen. Currently am analyzing 
to implement system timer for a new architecture. There are 3 timers available,
   > 
   > ```
   > timer
   > oneshot
   > arch timer
   > ```
   > 
   > I couldn't find the difference and when to use what. System timer for the 
tick / scheduler needs to be arch timer? Thanks."
   > 
   > Please include an brief explanation about it in your Documentation 
introduction, it will help people that are starting to use NuttX to get some 
better understanding
   
   The current driver abstraction in NuttX's time subsystem can be broadly 
categorized into four layers:
   <img width="556" height="276" alt="image" 
src="https://github.com/user-attachments/assets/b0802f8b-f98a-4e31-845b-87a8f14c6e80";
 />
   
   **Hardware Timer Drivers**: Includes implementations of various hardware 
timer drivers.
   **Timer Driver Abstraction**: Such as `Oneshot` and `Timer`, which provide 
oneshot/periodical timer hardware abstraction.
   **OS Timer Interfaces**: `Arch_Timer(up_timer_*)` and 
`Arch_Alarm(up_alarm_*)`, offering relative timer (trigger an event with a 
certain delay) and absolute timer (trigger an event at a certain time) 
interfaces.
   OS Timer Abstraction: The `wdog` manages software timers and provides a 
unified timer API to upper layers.
   
   The timer driver abstraction is not mandatory. If the driver is simple 
enough (e.g., just providing a periodic ticks), the OS Timer interfaces 
`Arch_Timer` can be implemented directly, bypassing the timer driver 
abstraction layer.
   
   The purpose of the timer driver abstraction is to simplify driver 
implementation, improve performance, and enhance the reusability of driver code.
   
   Given NuttX's current state, for better performance and simplicity, I 
recommend that periodic tick timers directly implement the `up_timer_*` 
interfaces, and non-periodic timers implement the new count-based `oneshot` 
driver abstraction interface.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to