![]() |
Morse Micro IoT SDK
2.10.4
|
These are basic HAL functions required for the core Morse library to operate.
Enumerations | |
| enum | mmhal_veto_id { MMHAL_VETO_ID_APP_MIN = 0 , MMHAL_VETO_ID_APP_MAX = 7 , MMHAL_VETO_ID_HAL_MIN = 8 , MMHAL_VETO_ID_HAL_MAX = 15 , MMHAL_VETO_ID_MORSELIB_MIN = 16 , MMHAL_VETO_ID_MORSELIB_MAX = 19 , MMHAL_VETO_ID_DATALINK = 20 , MMHAL_VETO_ID_MMCONFIG = 21 , MMHAL_VETO_ID_RESERVED_MIN = 22 , MMHAL_VETO_ID_RESERVED_MAX = 31 } |
| Enumeration of veto_id ranges for use with mmhal_set_deep_sleep_veto() and mmhal_clear_deep_sleep_veto(). More... | |
Functions | |
| uint32_t | mmhal_random_u32 (uint32_t min, uint32_t max) |
| Generate a random 32 bit integer within the given range. More... | |
| void | mmhal_set_deep_sleep_veto (uint8_t veto_id) |
| Sets a deep sleep veto that will prevent the device from entering deep sleep. More... | |
| void | mmhal_clear_deep_sleep_veto (uint8_t veto_id) |
| Clears a deep sleep veto that was preventing the device from entering deep sleep (see mmhal_set_deep_sleep_veto()). More... | |
| enum mmhal_veto_id |
Enumeration of veto_id ranges for use with mmhal_set_deep_sleep_veto() and mmhal_clear_deep_sleep_veto().
| Enumerator | |
|---|---|
| MMHAL_VETO_ID_APP_MIN | Start of deep sleep veto ID range that is available for application use. |
| MMHAL_VETO_ID_APP_MAX | End of deep sleep veto ID range that is available for application use. |
| MMHAL_VETO_ID_HAL_MIN | Start of deep sleep veto ID range that is available for HAL use. |
| MMHAL_VETO_ID_HAL_MAX | End of deep sleep veto ID range that is available for HAL use. |
| MMHAL_VETO_ID_MORSELIB_MIN | Start of deep sleep veto ID range that is allocated for morselib use. Note that this must not be changed as it is built into morselib. |
| MMHAL_VETO_ID_MORSELIB_MAX | End of deep sleep veto ID range that is allocated for morselib use. Note that this must not be changed as it is built into morselib. |
| MMHAL_VETO_ID_DATALINK | Deep sleep veto ID for data-link subsystem. |
| MMHAL_VETO_ID_MMCONFIG | Deep sleep veto ID allocated to Morse Micro Persistent Configuration Store. |
| MMHAL_VETO_ID_RESERVED_MIN | Start of deep sleep veto ID range reserved for future use. |
| MMHAL_VETO_ID_RESERVED_MAX | End of deep sleep veto ID range reserved for future use. |
Definition at line 38 of file mmhal_core.h.
| void mmhal_clear_deep_sleep_veto | ( | uint8_t | veto_id | ) |
Clears a deep sleep veto that was preventing the device from entering deep sleep (see mmhal_set_deep_sleep_veto()).
If the given veto was not already set then this has no effect.
| veto_id | The veto identifier. Valid values are 0-31, and these are split up into ranges for use by different subsystems – see mmhal_veto_id. |
| uint32_t mmhal_random_u32 | ( | uint32_t | min, |
| uint32_t | max | ||
| ) |
Generate a random 32 bit integer within the given range.
| min | Minimum value (inclusive). |
| max | Maximum value (inclusive). |
| void mmhal_set_deep_sleep_veto | ( | uint8_t | veto_id | ) |
Sets a deep sleep veto that will prevent the device from entering deep sleep.
The device will not enter deep sleep until there are no vetoes remaining. This veto can be cleared by a call to mmhal_clear_deep_sleep_veto() with the same veto_id.
Up to 32 vetoes are supported (ID numbers 0-31). Each veto should be used exclusively by a given aspect of the system (e.g., to prevent deep sleep when a DMA transfer is in progress, or to prevent deep sleep when there is log data buffered for transmit, etc.).
| veto_id | The veto identifier. Valid values are 0-31, and these are split up into ranges for use by different subsystems – see mmhal_veto_id. |