This is the interface of LoRaWAN power management module.
Copyright (c) 2018 Microchip Technology Inc. and its subsidiaries.
Data Structures | |
struct | _PMM_SleepReq_t |
Macros | |
#define | PMM_SLEEPTIME_MAX_MS 130990000u |
#define | PMM_SLEEPTIME_MIN_MS 1000u |
#define | PMM_WAKEUPTIME_MS 10u |
Typedefs | |
typedef struct _PMM_SleepReq_t | PMM_SleepReq_t |
typedef enum _PMM_State_t | PMM_State_t |
typedef enum _PMM_Status_t | PMM_Status_t |
Enumerations | |
enum | _PMM_State_t { PMM_STATE_ACTIVE = 0, PMM_STATE_SLEEP } |
enum | _PMM_Status_t { PMM_SLEEP_REQ_DENIED = 0, PMM_SLEEP_REQ_PROCESSED } |
Functions | |
PMM_Status_t | PMM_Sleep (PMM_SleepReq_t *req) |
This function puts the system to sleep if possible. More... | |
void | PMM_Wakeup (void) |
Wakeup from sleep. More... | |
#define PMM_SLEEPTIME_MAX_MS 130990000u |
Referenced by PMM_Sleep(), and validateSleepDuration().
#define PMM_SLEEPTIME_MIN_MS 1000u |
Referenced by validateSleepDuration().
#define PMM_WAKEUPTIME_MS 10u |
Referenced by PMM_Sleep().
typedef struct _PMM_SleepReq_t PMM_SleepReq_t |
typedef enum _PMM_State_t PMM_State_t |
typedef enum _PMM_Status_t PMM_Status_t |
enum _PMM_State_t |
enum _PMM_Status_t |
PMM_Status_t PMM_Sleep | ( | PMM_SleepReq_t * | req | ) |
This function puts the system to sleep if possible.
[in] | *req | - pointer to PMM_SleepReq_t request structure |
[in] | *req | - pointer to PMM_SleepReq_t request structure |
References HAL_Sleep(), MS_TO_SLEEP_TICKS, PMM_SLEEP_REQ_DENIED, PMM_SLEEP_REQ_PROCESSED, PMM_SLEEPTIME_MAX_MS, PMM_STATE_ACTIVE, PMM_STATE_SLEEP, PMM_Wakeup(), PMM_WAKEUPTIME_MS, pmmState, _PMM_SleepReq_t::sleep_mode, _PMM_SleepReq_t::sleepTimeMs, SleepTimerStart(), SWTIMER_INVALID_TIMEOUT, SwTimerNextExpiryDuration(), SYSTEM_ReadyToSleep(), SystemTimerSuspend(), US_TO_MS, and validateSleepDuration().
Referenced by processJoinAndSend().
void PMM_Wakeup | ( | void | ) |
Wakeup from sleep.
References NULL, PMM_STATE_ACTIVE, PMM_STATE_SLEEP, pmmState, _PMM_SleepReq_t::pmmWakeupCallback, SLEEP_TICKS_TO_US, SleepTimerGetElapsedTime(), SleepTimerStop(), SystemTimerSync(), and US_TO_MS.
Referenced by HAL_RadioDIO0Callback(), HAL_RadioDIO1Callback(), HAL_RadioDIO2Callback(), and PMM_Sleep().