Diagnostics for the power subsystem.
More...
Diagnostics for the power subsystem.
◆ FLEX_OnExternalPowerHandler
typedef void(* FLEX_OnExternalPowerHandler) (const bool *const IsOnExternalPower) |
On External Power Handler Function Pointer Declaration.
- Parameters
-
[in] | IsOnExternalPower | if the FlexSense is using external power or not. |
◆ FLEX_GetBatteryVoltage()
int FLEX_GetBatteryVoltage |
( |
int32_t *const | VoltageMilliVolts | ) |
|
Reads the FlexSense's battery voltage in mV.
- Note
- When the FlexSense is operating on external power, the battery Voltage reports zero.
- Parameters
-
[out] | VoltageMilliVolts | the current battery voltage in mV. |
- Returns
- FLEX_SUCCESS (0) if succeeded and < 0 if failed.
- Return values
-
-FLEX_ERROR_ENOTRECOVERABLE | BLE module comms in an unrecoverable state. |
-FLEX_ERROR_EPROTO | BLE module comms protocol error most likely a version miss match. |
-FLEX_ERROR_ECOMM | Failed to communicate with the BLE module. |
◆ FLEX_IsOnExternalPower()
int FLEX_IsOnExternalPower |
( |
bool *const | IsOnExternalPower | ) |
|
- Parameters
-
[out] | IsOnExternalPower | current state of the external power. |
- Returns
- FLEX_SUCCESS (0) if succeeded and < 0 if failed.
- Return values
-
-FLEX_ERROR_ENOTRECOVERABLE | BLE module comms in an unrecoverable state. |
-FLEX_ERROR_EPROTO | BLE module comms protocol error most likely a version miss match. |
-FLEX_ERROR_ECOMM | Failed to communicate with the BLE module. |
◆ FLEX_OnExternalPowerHandlerSet()
Adds an event handler for when the external power state changes.
- Note
- There can only be one handler subscribed to the event at a time, so passing in a new handler will remove the current one.
- Parameters
-
[in] | Handler | the event handler to be called on external power state change. |