Recycle example.cydsn/Generated_Source/PSoC5/XBEE.c
void XBEE_Sleep(void) 
{
    #if defined(CY_SCB_XBEE_UART_H)
    while(XBEE_UART_SpiUartGetTxBufferSize()); // block until TX ends
    #elif defined(CY_UART_XBEE_UART_H)
    while(XBEE_UART_GetTxBufferSize());
    #else
        #error "UART not defined"
    #endif
    
    XBEE_SaveConfig();
    
    XBEE_SLEEP_RQ_Write(1);
    XBEE_UART_Sleep();
}
/**
* This is the preferred API to prepare the component for sleep. The
* XBEE_Sleep() API saves the current component state. Then it calls the
* XBEE_Stop() function and calls XBEE_SaveConfig() to save the hardware
* configuration. Call the UART_Sleep() function before calling the CyPmSleep()
* or the CyPmHibernate() function. Refer to the PSoC Creator System Reference
* Guide for more information about power management functions.
*
* @see XBEE_SaveConfig()
* @see XBEE_Stop()
*/
This is the preferred API to prepare the component for sleep. The
XBEE_Sleep() API saves the current component state. Then it calls the
XBEE_Stop() function and calls XBEE_SaveConfig() to save the hardware
configuration. Call the UART_Sleep() function before calling the CyPmSleep()
or the CyPmHibernate() function. Refer to the PSoC Creator System Reference
Guide for more information about power management functions.
This is the preferred API to prepare the component for sleep . The XBEE_Sleep () API saves the current component state . Then it calls the XBEE_Stop () function and calls XBEE_SaveConfig () to save the hardware configuration . Call the UART_Sleep () function before calling the CyPmSleep () or the CyPmHibernate () function . Refer to the PSoC Creator System Reference Guide for more information about power management functions .
void XBEE_Sleep(void) 
{
    #if defined(CY_SCB_XBEE_UART_H)
    while(XBEE_UART_SpiUartGetTxBufferSize()); 
    #elif defined(CY_UART_XBEE_UART_H)
    while(XBEE_UART_GetTxBufferSize());
    #else
        #error "UART not defined"
    #endif
    XBEE_SaveConfig();
    XBEE_SLEEP_RQ_Write(1);
    XBEE_UART_Sleep();
}
void XBEE_Sleep ( void ) { #if defined ( CY_SCB_XBEE_UART_H ) while ( XBEE_UART_SpiUartGetTxBufferSize ( ) ) ; #elif defined ( CY_UART_XBEE_UART_H ) while ( XBEE_UART_GetTxBufferSize ( ) ) ; #else #error  "UART not defined" #endif XBEE_SaveConfig ( ) ; XBEE_SLEEP_RQ_Write ( 1 ) ; XBEE_UART_Sleep ( ) ; }
This is the preferred API to prepare the component for sleep.
This is the preferred API to prepare the component for sleep .
// block until TX ends