Core events peripheral driver.
More...
|
npmx_error_t | npmx_core_task_trigger (npmx_instance_t const *p_pm, npmx_core_task_t task) |
| Function for activating the specified main core task.
|
|
npmx_error_t | npmx_core_init (npmx_instance_t *p_pm, npmx_backend_t *p_backend, npmx_callback_t generic_callback, bool restore_values) |
| Function for initialization of nPM device instance with default values. Should be called in setup function to avoid runtime errors.
|
|
void | npmx_core_register_cb (npmx_instance_t *p_pm, npmx_callback_t cb, npmx_callback_type_t type) |
| Function for registering callback handler to specified callback type event/error. If no callback is registered, generlic callback specified in pm->generic_cb is called.
|
|
void | npmx_core_interrupt (npmx_instance_t *p_pm) |
| Function for signaling an interrupt.
|
|
npmx_error_t | npmx_core_proc (npmx_instance_t *p_pm) |
| Function for running in loop a task to handle all interrupts from nPM device.
|
|
npmx_error_t | npmx_core_event_interrupt_enable (npmx_instance_t *p_pm, npmx_event_group_t event, uint8_t flags_mask) |
| Function for enabling event interrupt.
|
|
npmx_error_t | npmx_core_event_interrupt_disable (npmx_instance_t *p_pm, npmx_event_group_t event, uint8_t flags_mask) |
| Function for disabling and clearing event interrupt.
|
|
void | npmx_core_context_set (npmx_instance_t *p_pm, void *p_context) |
| Function for setting user-defined context data.
|
|
void * | npmx_core_context_get (npmx_instance_t *p_pm) |
| Function for getting user-defined context data.
|
|
Core events peripheral driver.
◆ npmx_core_task_t
Main core tasks.
Enumerator |
---|
NPMX_CORE_TASK_RESET | Turn off all power supplies and apply an internal reset.
|
◆ npmx_core_context_get()
Function for getting user-defined context data.
- Parameters
-
[in] | p_pm | Pointer to the instance of nPM device. |
- Returns
- Pointer to context data.
◆ npmx_core_context_set()
Function for setting user-defined context data.
- Parameters
-
[in] | p_pm | Pointer to the instance of nPM device. |
[in] | p_context | Pointer to context data. |
◆ npmx_core_event_interrupt_disable()
Function for disabling and clearing event interrupt.
- Parameters
-
[in] | p_pm | Pointer to the instance of nPM device. |
[in] | event | Specified event group type. |
[in] | flags_mask | Specified bits in event group, see npmx_event_group_xxx_t for selected event to be disabled. |
- Return values
-
NPMX_SUCCESS | Operation performed successfully. |
NPMX_ERROR_IO | Error using IO bus line. |
◆ npmx_core_event_interrupt_enable()
Function for enabling event interrupt.
- Parameters
-
[in] | p_pm | Pointer to the instance of nPM device. |
[in] | event | Specified event group type. |
[in] | flags_mask | Specified bits in event group, see npmx_event_group_xxx_t for selected event to be enabled. |
- Return values
-
NPMX_SUCCESS | Operation performed successfully. |
NPMX_ERROR_IO | Error using IO bus line. |
◆ npmx_core_init()
Function for initialization of nPM device instance with default values. Should be called in setup function to avoid runtime errors.
- Parameters
-
[in] | p_pm | Pointer to the instance of nPM device. |
[in] | p_backend | Pointer to the initialized backend instance. |
[in] | generic_callback | Function callback pointer to be registered as generic callback. |
[in] | restore_values | True if initial values are to be restored from nPM device, false for setting default values. If true, scratch registers are used to store state and cannot be used by application. |
- Return values
-
NPMX_SUCCESS | Operation performed successfully. |
NPMX_ERROR_IO | Error using IO bus line. |
◆ npmx_core_interrupt()
Function for signaling an interrupt.
This function should be called when an interrupt associated with nPM device's GPIO pin is handled, to register event from nPM device.
- Parameters
-
[in] | p_pm | Pointer to the instance of nPM device. |
◆ npmx_core_proc()
Function for running in loop a task to handle all interrupts from nPM device.
- Parameters
-
[in] | p_pm | Pointer to the instance of nPM device. |
- Return values
-
NPMX_SUCCESS | Operation performed successfully. |
NPMX_ERROR_IO | Error using IO bus line. |
◆ npmx_core_register_cb()
Function for registering callback handler to specified callback type event/error. If no callback is registered, generlic callback specified in pm->generic_cb is called.
- Parameters
-
[in] | p_pm | Instance of nPM device. |
[in] | cb | Function callback pointer to be registered. |
[in] | type | Type of registered function callback pointer. |
◆ npmx_core_task_trigger()
Function for activating the specified main core task.
- Parameters
-
p_pm | Pointer to the instance of nPM device. |
task | Task to be activated. |
- Return values
-
NPMX_SUCCESS | Operation performed successfully. |
NPMX_ERROR_IO | Error using IO bus line. |