Battery measurement module API.
More...
Battery measurement module API.
◆ anonymous enum
The m_batt_meas return status codes.
Enumerator |
---|
M_BATT_STATUS_CODE_SUCCESS | Successfull.
|
M_BATT_STATUS_CODE_INVALID_PARAM | Invalid parameters.
|
◆ m_batt_meas_event_type_t
Battery and charge event codes.
Enumerator |
---|
M_BATT_MEAS_EVENT_DATA | Is called back at the desired frequency.
|
M_BATT_MEAS_EVENT_LOW | Low battery event (<= set by user).
|
M_BATT_MEAS_EVENT_FULL | Full battery event (>= value set by user).
|
M_BATT_MEAS_EVENT_USB_CONN_CHARGING | Battery main og tricle charging active.
|
M_BATT_MEAS_EVENT_USB_CONN_CHARGING_FINISHED | Battery charging finished/not charging.
|
M_BATT_MEAS_EVENT_USB_DISCONN | USB disconnected, battery not charging.
|
M_BATT_MEAS_EVENT_ERROR | Error state detected signalled by the charger (not implemeted, CHG and CHG finished will toggle in case of error).
|
◆ m_batt_meas_disable()
uint32_t m_batt_meas_disable |
( |
void |
| ) |
|
Function for stopping the battery measurement.
- Returns
- M_BATT_STATUS_CODE_SUCCESS
-
Other codes from the underlying driver.
◆ m_batt_meas_enable()
uint32_t m_batt_meas_enable |
( |
uint32_t |
meas_interval_ms | ) |
|
Function for enabling battery measurement at the given interval.
- Parameters
-
meas_interval_ms | Sampling interval given in milliseconds. |
- Note
- This will call the handler supplied in p_batt_meas_init at the given interval which is supplied with a m_batt_meas_event_t struct containing the information.
- Returns
- M_BATT_STATUS_CODE_SUCCESS
-
Other codes from the underlying driver.
◆ m_batt_meas_init()
Function for initializing the battery driver.
- Parameters
-
[out] | p_handle | Pointer to the location to store the service handle. |
[in] | p_batt_meas_init | Struct containing the configuration parameters. |
- Returns
- M_BATT_STATUS_CODE_SUCCESS
-
M_BATT_STATUS_CODE_INVALID_PARAM
-
NRF_ERROR_NULL
-
Other codes from the underlying driver.