boardSupplySetWakeup (Function)

Top  Previous  Next

Architecture:

NX32L

Device support:

All

Firmware version:

1.36.00


This function is used to configure the system to wake from suspend when the external power is applied or removed.

It is similar to using the PowerFail and PowerApply parameters on pmWaitEvent.

 

pmSuspend return codes for this wake-up source:

Error

Type

ID

Value

Description

True

1

3

-11

External supply is disabled using pmExternalPower.

False

1

3

1

Wake-up on power apply

False

1

3

0

Wake-up on power fail.

 

 

Input:

 

Enable : BOOL (default: TRUE)

Set to true to enable the wake-up, set to false to disable it.

 

Fail : BOOL (default: TRUE)

If set to true, the device will wake when the external power is removed.

 

 

Apply : BOOL (default: FALSE)

If set to true, the device will wake when the external power is connected.

 

Returns:

1

- The system has been configured to wake.

0

- This function is not supported.

-2

- Neither fail nor apply are enabled.

 

Declaration:

FUNCTION ALIGN boardSupplySetWakeup:INT;
VAR_INPUT
  enable: BOOL := TRUE;
  fail : BOOL := TRUE;
  apply : BOOL := FALSE;
END_VAR;
 

 

Example:

INCLUDE rtcu.inc
 
PROGRAM test;
 
BEGIN
  ...
  // Enable wake on power apply
  boardSupplySetWakeup(apply := TRUE);
  ...
END;
 
END_PROGRAM;