Research breakthrough possible @S-Logix pro@slogix.in

Office Address

  • 2nd Floor, #7a, High School Road, Secretariat Colony Ambattur, Chennai-600053 (Landmark: SRM School) Tamil Nadu, India
  • pro@slogix.in
  • +91- 81240 01111

Social List

What Are The Energest Module Types Used in Contiki-Ng Platforms?

Energest Module Types are Used in Contiki-Ng Platforms

The Energest Module Types Used in Contiki-Ng Platforms

Description:

   The Energest module provides functions for keeping track when components are on, off or in different modes. The API for the Energest module is shown in the following table.

Function Purpose
ENERGEST_TIME_T ENERGEST_CURRENT_TIME() Get the system time from the Energest time source.
ENERGEST_SECOND The number of ticks per second from the Energest time source.
ENERGEST_ON(type) Set the specified type to on and start tracking the time.
ENERGEST_OFF(type) Set the specified type to off and update the total time.
ENERGEST_SWITCH(type_off, type_on) Switch from tracking time for the first type to the second type.
ENERGEST_GET_TOTAL_TIME() Get the total time Energest has been tracking.
void energest_flush(void) Flush the Energest times for all components that are currently turned on.
uint64_t energest_type_time(energest_type_t type) Read the total time the specified type has been turned on.
void energest_init(void) Initialize the Energest module.

1. The macro ENERGEST_CURRENT_TIME returns a platform dependent system time for use by the Energest module and the constant ENERGEST_SECOND specifies the number of ticks per second.

2. The macros ENERGEST_ON, ENERGEST_OFF, and ENERGEST_SWITCH are used to tell the Energest module when a component changes mode and is normally only called by platforms and device drivers. When a component switches from one mode to another, it is recommended to use ENERGEST_SWITCH as it provides better accuracy.

3. The macro ENERGEST_GET_TOTAL_TIME() returns the total time the Energest module has been tracking. This is normally the same as CPU + LPM + DEEP_LPM but can be overridden by platforms that provide additional Energest types.

4. The function energest_flush updates the total time for all types that are currently turned on.

5. The function energest_type_time returns the total time the specified type has been turned on. energy_flush should be called before reading the total time to ensure the total time has been updated.

6. The function energest_init() is called by the system during the boot-up procedure to initialize the Energest module.