Class PowerStatus

Class Documentation

class PowerStatus

This class represents the SuperCAP Module

connected via eMOD bus to controller module. This module warns us when one of the following power supply change occurs:

1) Power source switches from external power (AC) to internal (supercap module), or vice versa.

2) Power fault is detected and imminently (100ms) the system runs out of power.

Public Functions

inline virtual ~PowerStatus()

Class destructor

virtual EmodRet setStatusChangeCallback(const PowerStatusChangeCallback cb, void *const ctx) = 0

Defines the function and context to be passed to the callback that notifies you when there is a change in the power supply.

When power source switches from external power (AC) to internal (if supercap module is present), or vice versa, it generates a callback to db function. The callback passes two input parameters: externa_lpower indicates if supercap is present or not, and ctx pointer to user context.

Parameters
  • cb -- [in] pointer to power status change function. It's the function called in teh callback.

  • ctx -- [in] pointer to user context. It's passed to user in callback.

virtual EmodRet setFailCallback(const PowerFailCallback cb, void *const ctx) = 0

Defines the function and context to be passed to the callback that notifies you when there is a power fail.

When power fault is detected, it generates a callback to db function. It is generated when there is no Supercap module and the power is cut off or there is a Supercap and the power runs out. The callback passes an input parameter ctx that pointer to user context.

Parameters
  • cb -- [in] pointer to power fail change function. It's the function called in teh callback.

  • ctx -- [in] pointer to user context. It's passed to user in callback.