Coulomb Counter#

API and Callbacks for the Coulomb Counter Component.

Approximates energy consumption by keeping time spent in different device states. This is used for testing.

Modules#

Coulomb Counter

API#

uint16_t

Return the current core mode.

uint16_t

Return the current state of all additive modes.

uint32_t

Return the cumulative energy usage metric since last value reset.

void

Reset the energy usage metric.

Enumerations#

enum
EMBER_AF_PLUGIN_COULOMB_COUNTER_RADIO_MODE_RX_SHIFT = 0
EMBER_AF_PLUGIN_COULOMB_COUNTER_RADIO_MODE_TX_SHIFT = 1
EMBER_AF_PLUGIN_COULOMB_COUNTER_CORE_MODE_SLEEP_SHIFT = 2
EMBER_AF_PLUGIN_COULOMB_COUNTER_CORE_MODE_IDLE_SHIFT = 3
EMBER_AF_PLUGIN_COULOMB_COUNTER_CORE_MODE_AWAKE_SHIFT = 4
EMBER_AF_PLUGIN_COULOMB_COUNTER_EEPROM_STATE_SHIFT = 5
EMBER_AF_PLUGIN_COULOMB_COUNTER_CORE_MODE_MAX = 32
}

Macros#

#define
EMBER_AF_PLUGIN_COULOMB_COUNTER_RADIO_MODE_RX (1U << EMBER_AF_PLUGIN_COULOMB_COUNTER_RADIO_MODE_RX_SHIFT)
#define
EMBER_AF_PLUGIN_COULOMB_COUNTER_RADIO_MODE_TX (1U << EMBER_AF_PLUGIN_COULOMB_COUNTER_RADIO_MODE_TX_SHIFT)
#define
EMBER_AF_PLUGIN_COULOMB_COUNTER_CORE_MODE_SLEEP (1U << EMBER_AF_PLUGIN_COULOMB_COUNTER_CORE_MODE_SLEEP_SHIFT)
#define
EMBER_AF_PLUGIN_COULOMB_COUNTER_CORE_MODE_IDLE (1U << EMBER_AF_PLUGIN_COULOMB_COUNTER_CORE_MODE_IDLE_SHIFT)
#define
EMBER_AF_PLUGIN_COULOMB_COUNTER_CORE_MODE_AWAKE (1U << EMBER_AF_PLUGIN_COULOMB_COUNTER_CORE_MODE_AWAKE_SHIFT)

API Documentation#

emberAfPluginCommandCoulombCounterGetCurrentCoreMode#

uint16_t emberAfPluginCommandCoulombCounterGetCurrentCoreMode (void )

Return the current core mode.

Parameters
N/A

Returns the current core mode of the system. The core mode is the basis for energy consumption measurements. Each core mode is mutually exclusive.

Returns

  • the current core mode.


Definition at line 86 of file app/framework/plugin/coulomb-counter/coulomb-counter.h

emberAfPluginCommandCoulombCounterGetAdditiveModesBitfield#

uint16_t emberAfPluginCommandCoulombCounterGetAdditiveModesBitfield (void )

Return the current state of all additive modes.

Parameters
N/A

Returns the current state of all additive modes. All bits raised in the bitfield indicate that the state is current 'On'.

Returns

  • the current additive modes bitfield.


Definition at line 95 of file app/framework/plugin/coulomb-counter/coulomb-counter.h

emberAfPluginCommandCoulombCounterGetEnergyUsage#

uint32_t emberAfPluginCommandCoulombCounterGetEnergyUsage (void )

Return the cumulative energy usage metric since last value reset.

Parameters
N/A

Returns the cumulative energy usage metric since last value reset. This value is in the same unit as all other provided values and is persisted until explicitly reset.

Returns

  • the currently recorded energy usage.


Definition at line 104 of file app/framework/plugin/coulomb-counter/coulomb-counter.h

emberAfPluginCommandCoulombCounterResetEnergyUsage#

void emberAfPluginCommandCoulombCounterResetEnergyUsage (void )

Reset the energy usage metric.

Parameters
N/A

Resets the energy usage metric. This calls clears both the volatile and non volatile values.


Definition at line 110 of file app/framework/plugin/coulomb-counter/coulomb-counter.h

Enumeration Documentation#

EmberAfPluginCoulombCounterCoreMode#

EmberAfPluginCoulombCounterCoreMode
Enumerator
EMBER_AF_PLUGIN_COULOMB_COUNTER_RADIO_MODE_RX_SHIFT
EMBER_AF_PLUGIN_COULOMB_COUNTER_RADIO_MODE_TX_SHIFT
EMBER_AF_PLUGIN_COULOMB_COUNTER_CORE_MODE_SLEEP_SHIFT
EMBER_AF_PLUGIN_COULOMB_COUNTER_CORE_MODE_IDLE_SHIFT
EMBER_AF_PLUGIN_COULOMB_COUNTER_CORE_MODE_AWAKE_SHIFT
EMBER_AF_PLUGIN_COULOMB_COUNTER_EEPROM_STATE_SHIFT
EMBER_AF_PLUGIN_COULOMB_COUNTER_CORE_MODE_MAX

Definition at line 37 of file app/framework/plugin/coulomb-counter/coulomb-counter.h

Macro Definition Documentation#

COULOMB_COUNTER_MAX_NB_USER_DEFINED_ADDITIVE_STATES#

#define COULOMB_COUNTER_MAX_NB_USER_DEFINED_ADDITIVE_STATES
Value:
(16U)

Definition at line 36 of file app/framework/plugin/coulomb-counter/coulomb-counter.h

EMBER_AF_PLUGIN_COULOMB_COUNTER_RADIO_MODE_RX#

#define EMBER_AF_PLUGIN_COULOMB_COUNTER_RADIO_MODE_RX
Value:
(1U << EMBER_AF_PLUGIN_COULOMB_COUNTER_RADIO_MODE_RX_SHIFT)

Radio in Idle state Radio in Receive state


Definition at line 51 of file app/framework/plugin/coulomb-counter/coulomb-counter.h

EMBER_AF_PLUGIN_COULOMB_COUNTER_RADIO_MODE_TX#

#define EMBER_AF_PLUGIN_COULOMB_COUNTER_RADIO_MODE_TX
Value:
(1U << EMBER_AF_PLUGIN_COULOMB_COUNTER_RADIO_MODE_TX_SHIFT)

Radio in Transmit state


Definition at line 53 of file app/framework/plugin/coulomb-counter/coulomb-counter.h

EMBER_AF_PLUGIN_COULOMB_COUNTER_CORE_MODE_SLEEP#

#define EMBER_AF_PLUGIN_COULOMB_COUNTER_CORE_MODE_SLEEP
Value:
(1U << EMBER_AF_PLUGIN_COULOMB_COUNTER_CORE_MODE_SLEEP_SHIFT)

Definition at line 55 of file app/framework/plugin/coulomb-counter/coulomb-counter.h

EMBER_AF_PLUGIN_COULOMB_COUNTER_CORE_MODE_IDLE#

#define EMBER_AF_PLUGIN_COULOMB_COUNTER_CORE_MODE_IDLE
Value:
(1U << EMBER_AF_PLUGIN_COULOMB_COUNTER_CORE_MODE_IDLE_SHIFT)

Definition at line 57 of file app/framework/plugin/coulomb-counter/coulomb-counter.h

EMBER_AF_PLUGIN_COULOMB_COUNTER_CORE_MODE_AWAKE#

#define EMBER_AF_PLUGIN_COULOMB_COUNTER_CORE_MODE_AWAKE
Value:
(1U << EMBER_AF_PLUGIN_COULOMB_COUNTER_CORE_MODE_AWAKE_SHIFT)

Definition at line 59 of file app/framework/plugin/coulomb-counter/coulomb-counter.h

EMBER_AF_PLUGIN_COULOMB_COUNTER_RADIO_EVENT_MASK#

#define EMBER_AF_PLUGIN_COULOMB_COUNTER_RADIO_EVENT_MASK
Value:
(0x03U)

A mask representing all Radio state options <bit1:bit0>


Definition at line 62 of file app/framework/plugin/coulomb-counter/coulomb-counter.h

EMBER_AF_PLUGIN_COULOMB_COUNTER_EM_MODE_MASK#

#define EMBER_AF_PLUGIN_COULOMB_COUNTER_EM_MODE_MASK
Value:
(0x1CU)

A mask representing all EM mode options <bit4:bit2>


Definition at line 65 of file app/framework/plugin/coulomb-counter/coulomb-counter.h

EMBER_AF_PLUGIN_COULOMB_COUNTER_EEPROM_MODE_MASK#

#define EMBER_AF_PLUGIN_COULOMB_COUNTER_EEPROM_MODE_MASK
Value:
(0x1E0U)

A mask representing all EEPROM mode options <bit8:bit5>


Definition at line 68 of file app/framework/plugin/coulomb-counter/coulomb-counter.h

EMBER_AF_PLUGIN_COULOMB_COUNTER_MASK#

#define EMBER_AF_PLUGIN_COULOMB_COUNTER_MASK
Value:
(0xFFFFU)

Definition at line 70 of file app/framework/plugin/coulomb-counter/coulomb-counter.h

EMBER_AF_PLUGIN_COULOMB_COUNTER_USER_DEF_STATES#

#define EMBER_AF_PLUGIN_COULOMB_COUNTER_USER_DEF_STATES
Value:
(EMBER_AF_PLUGIN_COULOMB_COUNTER_MASK \
<< COULOMB_COUNTER_MAX_NB_USER_DEFINED_ADDITIVE_STATES)

Definition at line 71 of file app/framework/plugin/coulomb-counter/coulomb-counter.h