Software Timer Module

Timer provides the facility to measure desired amount of time. The SAM R34 has five hardware timers that can measure only five individual amounts of time simultaneously. Every component in MLS such as radio, MAC and APP have timer requirements. Therefore, timers need to be efficiently shared by all the required components.

The software timer module provides the needed abstractions for MLS to use timers. It handles the operation of the hardware timer, for measuring the given amount of time, thus freeing the user from managing the hardware timers.

The software timer provides a set of interfaces to initialize, create, start, stop timers and so on. If the user calls timer start, the software timer module takes Timer duration and callback function as input. Once the duration is elapsed, user-supplied callback function is invoked.

Simultaneously, more than one software timer can be started, which is automatically sorted according to their duration and expires accordingly. Besides, running for user-desired duration, the software timer module also keeps track of system time. System time is measured starting from the initialization of the software timer during reset.

MLS currently supports a maximum of 25 software timer instances. It can be customized as per application requirements by changing the TOTAL_NUMBER_OF_TIMERS macro in the conf_app.h file.

Note: To change the number of software timers, the user must rebuild an application firmware.