Wake-Lock#

Component that provides support for sleep and remote wake-up functionality. The UART driver is not able to receive data in EM2 (deep sleep) mode, therefore an external signal is needed to wake the controller up before UART communication. This component can be used with NCP host and NCP target applications. Waking up is automatic after signal arrival, but application has to decide about sleep. This functionality requires two dedicated pins to work. This is a No-Code component if used together with NCP Interface or NCP Host Communication Interface components.

Macros#

#define
SL_WAKE_LOCK_ENABLE_LOCAL 1
#define
SL_WAKE_LOCK_ENABLE_REMOTE 1
#define
SL_WAKE_LOCK_INPUT_POLARITY_ACTIVE_HIGH 0
#define
SL_WAKE_LOCK_OUTPUT_POLARITY_ACTIVE_HIGH 0
#define
SL_WAKE_LOCK_INPUT_PORT SL_GPIO_PORT_D
#define
SL_WAKE_LOCK_INPUT_PIN 9
#define
SL_WAKE_LOCK_OUTPUT_PORT SL_GPIO_PORT_D
#define
SL_WAKE_LOCK_OUTPUT_PIN 8

Function Documentation#

sl_wake_lock_init#

void sl_wake_lock_init (void )
Parameters
TypeDirectionArgument NameDescription
voidN/A

Wake and sleep (lock) initialization function


sl_wake_lock_set_remote_req#

void sl_wake_lock_set_remote_req (void )
Parameters
TypeDirectionArgument NameDescription
voidN/A

Signal wake-up to remote controller.


sl_wake_lock_clear_remote_req#

void sl_wake_lock_clear_remote_req (void )
Parameters
TypeDirectionArgument NameDescription
voidN/A

Signal go to sleep (lock) to remote controller.


sl_wake_lock_set_req_rx_cb#

void sl_wake_lock_set_req_rx_cb (void )
Parameters
TypeDirectionArgument NameDescription
voidN/A

Wake-up signal arrived from remote controller.


sl_wake_lock_clear_req_rx_cb#

void sl_wake_lock_clear_req_rx_cb (void )
Parameters
TypeDirectionArgument NameDescription
voidN/A

Go to sleep (lock) signal arrived from remote controller.


sl_wake_lock_set_local#

void sl_wake_lock_set_local (void )
Parameters
TypeDirectionArgument NameDescription
voidN/A

Enable sleep mode locally.


sl_wake_lock_clear_local#

void sl_wake_lock_clear_local (void )
Parameters
TypeDirectionArgument NameDescription
voidN/A

Disable sleep mode locally.