sleep() [ Sleep ]

usart (SystemSleepConfiguration)

// PROTOTYPE
SystemSleepConfiguration& usart(const USARTSerial& serial)

// EXAMPLE
SystemSleepConfiguration config;
config.mode(SystemSleepMode::STOP)
      .usart(Serial1);

Wake from a hardware UART (USART). This can only be done with a hardware serial port; you cannot wake from the USB virtual serial port (Serial).

Note: Keeping the USART active in ultra-low power mode significanly increases the current used while sleeping.

USART Wake Support Gen 2 Gen 3 Gen 4
Wake from STOP sleep  
Wake from ULTRA_LOW_POWER sleep    
Wake from HIBERNATE sleep      

Gen 4 Devices (RTL872x) (P2, Photon 2, and M-SoM):

Wake on serial is not supported on the P2, Photon 2, or M-SoM.