Ship and hibernate modes peripheral driver. More...
Data Structures | |
struct | npmx_ship_t |
Data structure of the SHIP driver instance. More... | |
struct | npmx_ship_config_t |
Configuration structure for ship hold. More... | |
struct | npmx_ship_reset_config_t |
Configuration structure for reset button. More... | |
Enumerations | |
enum | npmx_ship_task_t { NPMX_SHIP_TASK_HIBERNATE , NPMX_SHIP_TASK_CONFIG_SHIPHOLD , NPMX_SHIP_TASK_SHIPMODE , NPMX_SHIP_TASK_CONFIG_RESET , NPMX_SHIP_TASK_COUNT } |
Ship and hibernate tasks. More... | |
enum | npmx_ship_time_t { NPMX_SHIP_TIME_16_MS = SHPHLD_SHPHLDCONFIG_SHPHLDTIM_16ms , NPMX_SHIP_TIME_32_MS = SHPHLD_SHPHLDCONFIG_SHPHLDTIM_32ms , NPMX_SHIP_TIME_64_MS = SHPHLD_SHPHLDCONFIG_SHPHLDTIM_64ms , NPMX_SHIP_TIME_96_MS = SHPHLD_SHPHLDCONFIG_SHPHLDTIM_96ms , NPMX_SHIP_TIME_304_MS = SHPHLD_SHPHLDCONFIG_SHPHLDTIM_304ms , NPMX_SHIP_TIME_608_MS = SHPHLD_SHPHLDCONFIG_SHPHLDTIM_608ms , NPMX_SHIP_TIME_1008_MS = SHPHLD_SHPHLDCONFIG_SHPHLDTIM_1008ms , NPMX_SHIP_TIME_3008_MS = SHPHLD_SHPHLDCONFIG_SHPHLDTIM_3008ms , NPMX_SHIP_TIME_COUNT , NPMX_SHIP_TIME_MIN = NPMX_SHIP_TIME_16_MS , NPMX_SHIP_TIME_DEFAULT = NPMX_SHIP_TIME_96_MS , NPMX_SHIP_TIME_MAX = NPMX_SHIP_TIME_3008_MS , NPMX_SHIP_TIME_INVALID = NPMX_INVALID_ENUM_VALUE } |
SHPHLD duration button must be pressed to exit ship or hibernate mode. More... | |
Functions | |
npmx_ship_t * | npmx_ship_get (npmx_instance_t *p_pmic, uint8_t idx) |
Function for returning SHIP instance based on index. | |
npmx_ship_time_t | npmx_ship_time_convert (uint32_t time_ms) |
Function for converting milliseconds to npmx_ship_time_t enumeration. | |
bool | npmx_ship_time_convert_to_ms (npmx_ship_time_t enum_value, uint32_t *p_val) |
Function for converting npmx_ship_time_t enumeration to milliseconds. | |
npmx_error_t | npmx_ship_task_trigger (npmx_ship_t const *p_instance, npmx_ship_task_t task) |
Function for activating the specified SHIP task. | |
npmx_error_t | npmx_ship_config_set (npmx_ship_t *p_instance, npmx_ship_config_t const *p_config) |
Function for setting the ship hold configuration. | |
npmx_error_t | npmx_ship_config_get (npmx_ship_t *p_instance, npmx_ship_config_t *p_config) |
Function for reading the ship hold configuration. | |
npmx_error_t | npmx_ship_gpio_status_check (npmx_ship_t const *p_instance, bool *p_active) |
Function for checking whether the ship button is active. | |
npmx_error_t | npmx_ship_reset_config_set (npmx_ship_t const *p_instance, npmx_ship_reset_config_t const *p_config) |
Function for setting long press reset button configuration. | |
npmx_error_t | npmx_ship_reset_config_get (npmx_ship_t const *p_instance, npmx_ship_reset_config_t *p_config) |
Function for reading the long press reset button configuration. | |
Ship and hibernate modes peripheral driver.
enum npmx_ship_task_t |
enum npmx_ship_time_t |
SHPHLD duration button must be pressed to exit ship or hibernate mode.
npmx_error_t npmx_ship_config_get | ( | npmx_ship_t * | p_instance, |
npmx_ship_config_t * | p_config ) |
Function for reading the ship hold configuration.
[in] | p_instance | Pointer to the SHIP instance. |
[out] | p_config | Pointer to the SHIP configuration structure. |
NPMX_SUCCESS | Operation performed successfully. |
NPMX_ERROR_IO | Error using IO bus line. |
npmx_error_t npmx_ship_config_set | ( | npmx_ship_t * | p_instance, |
npmx_ship_config_t const * | p_config ) |
Function for setting the ship hold configuration.
[in] | p_instance | Pointer to the SHIP instance. |
[in] | p_config | Pointer to the configuration of the SHIP to be applied. |
NPMX_SUCCESS | Operation performed successfully. |
NPMX_ERROR_IO | Error using IO bus line. |
npmx_ship_t * npmx_ship_get | ( | npmx_instance_t * | p_pmic, |
uint8_t | idx ) |
Function for returning SHIP instance based on index.
[in] | p_pmic | Pointer to the SHIP instance. |
[in] | idx | Index of the SHIP instance. |
npmx_error_t npmx_ship_gpio_status_check | ( | npmx_ship_t const * | p_instance, |
bool * | p_active ) |
Function for checking whether the ship button is active.
[in] | p_instance | Pointer to the SHIP instance. |
[out] | p_active | Pointer to the variable to be filled with ship button status. True if button is active, false otherwise. |
NPMX_SUCCESS | Operation performed successfully. |
NPMX_ERROR_IO | Error using IO bus line. |
npmx_error_t npmx_ship_reset_config_get | ( | npmx_ship_t const * | p_instance, |
npmx_ship_reset_config_t * | p_config ) |
Function for reading the long press reset button configuration.
[in] | p_instance | Pointer to the SHIP instance. |
[out] | p_config | Pointer to the reset button configuration structure. |
NPMX_SUCCESS | Operation performed successfully. |
NPMX_ERROR_IO | Error using IO bus line. |
npmx_error_t npmx_ship_reset_config_set | ( | npmx_ship_t const * | p_instance, |
npmx_ship_reset_config_t const * | p_config ) |
Function for setting long press reset button configuration.
[in] | p_instance | Pointer to the SHIP instance. |
[in] | p_config | Pointer to the configuration of the reset button to be applied. |
NPMX_SUCCESS | Operation performed successfully. |
NPMX_ERROR_IO | Error using IO bus line. |
npmx_error_t npmx_ship_task_trigger | ( | npmx_ship_t const * | p_instance, |
npmx_ship_task_t | task ) |
Function for activating the specified SHIP task.
p_instance | Pointer to the SHIP instance. |
task | Task to be activated. |
NPMX_SUCCESS | Operation performed successfully. |
NPMX_ERROR_IO | Error using IO bus line. |
npmx_ship_time_t npmx_ship_time_convert | ( | uint32_t | time_ms | ) |
Function for converting milliseconds to npmx_ship_time_t enumeration.
[in] | time_ms | Time in milliseconds to be converted into npmx_ship_time_t enumeration. |
bool npmx_ship_time_convert_to_ms | ( | npmx_ship_time_t | enum_value, |
uint32_t * | p_val ) |
Function for converting npmx_ship_time_t enumeration to milliseconds.
[in] | enum_value | Time defined as npmx_ship_time_t enumeration to be converted into milliseconds. |
[out] | p_val | Pointer to the variable that stores the conversion result. |
true | Conversion is valid. |
false | Conversion is invalid - an invalid argument was passed to the function. |