The question about timers in the MQX

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

The question about timers in the MQX

跳至解决方案
916 次查看
小勇邹
Contributor II

There are two timer examples “hwtimer” and “timer”.

What is the difference between “hwtimer” and “timer”?

C:\Freescale\Freescale_MQX_4_1_TWRK64F120M\mqx\examples\hwtimer

C:\Freescale\Freescale_MQX_4_1_TWRK64F120M\mqx\examples\timer

0 项奖励
1 解答
263 次查看
soledad
NXP Employee
NXP Employee

Hello Robin,

The Timers are an optional component that extends the core-time component. An application can use timers:

• To cause a notification function to run at a specific time - when MQX RTOS creates the timer component, it starts Timer task, which maintains timers and their application-defined notification functions. When a timer expires, Timer Task calls

the appropriate notification function.

• To communicate that a time period has expired.

A task can start a timer at a specific time or at some specific time after the current time. Timers can use elapsed time or absolute time. There are two types of timers:

• One-shot timers, which expire once.

• Periodic timers, which expire repeatedly at a specified interval. When a periodic timer expires, MQX RTOS resets the timer

The HWTimer is a driver and it provides a C language API for uniform access to the features of various HW timer modules such as PIT and SysTick.

The hwtimer example shows usage of HW timer driver abstraction. Demonstrates how to initialize HW timer for various modules, set frequency, callback, start, and stop the timer.

The timer example is a simple demonstration of MQX timer component.

I hope this helps,


Have a great day,
Sol

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

在原帖中查看解决方案

0 项奖励
1 回复
264 次查看
soledad
NXP Employee
NXP Employee

Hello Robin,

The Timers are an optional component that extends the core-time component. An application can use timers:

• To cause a notification function to run at a specific time - when MQX RTOS creates the timer component, it starts Timer task, which maintains timers and their application-defined notification functions. When a timer expires, Timer Task calls

the appropriate notification function.

• To communicate that a time period has expired.

A task can start a timer at a specific time or at some specific time after the current time. Timers can use elapsed time or absolute time. There are two types of timers:

• One-shot timers, which expire once.

• Periodic timers, which expire repeatedly at a specified interval. When a periodic timer expires, MQX RTOS resets the timer

The HWTimer is a driver and it provides a C language API for uniform access to the features of various HW timer modules such as PIT and SysTick.

The hwtimer example shows usage of HW timer driver abstraction. Demonstrates how to initialize HW timer for various modules, set frequency, callback, start, and stop the timer.

The timer example is a simple demonstration of MQX timer component.

I hope this helps,


Have a great day,
Sol

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 项奖励