Ejemplo n.º 1
0
/*******************************************************************************
* Function Name: LCD_Sleep
********************************************************************************
*
* Summary:
*  Prepares component for entering the sleep mode.
*
* Parameters:
*  None.
*
* Return:
*  None.
*
* Reentrant:
*  No.
*
*******************************************************************************/
void LCD_Sleep(void) 
{
    LCD_backup.enableState = LCD_enableState;
    LCD_SaveConfig();
    LCD_Stop();
}
Ejemplo n.º 2
0
/*******************************************************************************
* Function Name: LCD_Sleep
****************************************************************************//**
*
*  Prepares the LCD component to enter Deep Sleep.
*  The “Enable wakeup from Deep Sleep Mode” selection has an influence on this 
*  function implementation:
*  - Checked: configures the component to be wakeup source from Deep Sleep.
*  - Unchecked: stores the current component state (enabled or disabled) and 
*    disables the component. See SCB_Stop() function for details about component 
*    disabling.
*
*  Call the LCD_Sleep() function before calling the 
*  CyPmSysDeepSleep() function. 
*  Refer to the PSoC Creator System Reference Guide for more information about 
*  power management functions and Low power section of this document for the 
*  selected mode.
*
*  This function should not be called before entering Sleep.
*
*******************************************************************************/
void LCD_Sleep(void)
{
#if(LCD_SCB_MODE_UNCONFIG_CONST_CFG)

    if(LCD_SCB_WAKE_ENABLE_CHECK)
    {
        if(LCD_SCB_MODE_I2C_RUNTM_CFG)
        {
            LCD_I2CSaveConfig();
        }
        else if(LCD_SCB_MODE_EZI2C_RUNTM_CFG)
        {
            LCD_EzI2CSaveConfig();
        }
    #if(!LCD_CY_SCBIP_V1)
        else if(LCD_SCB_MODE_SPI_RUNTM_CFG)
        {
            LCD_SpiSaveConfig();
        }
        else if(LCD_SCB_MODE_UART_RUNTM_CFG)
        {
            LCD_UartSaveConfig();
        }
    #endif /* (!LCD_CY_SCBIP_V1) */
        else
        {
            /* Unknown mode */
        }
    }
    else
    {
        LCD_backup.enableState = (uint8) LCD_GET_CTRL_ENABLED;

        if(0u != LCD_backup.enableState)
        {
            LCD_Stop();
        }
    }

#else

    #if (LCD_SCB_MODE_I2C_CONST_CFG && LCD_I2C_WAKE_ENABLE_CONST)
        LCD_I2CSaveConfig();

    #elif (LCD_SCB_MODE_EZI2C_CONST_CFG && LCD_EZI2C_WAKE_ENABLE_CONST)
        LCD_EzI2CSaveConfig();

    #elif (LCD_SCB_MODE_SPI_CONST_CFG && LCD_SPI_WAKE_ENABLE_CONST)
        LCD_SpiSaveConfig();

    #elif (LCD_SCB_MODE_UART_CONST_CFG && LCD_UART_WAKE_ENABLE_CONST)
        LCD_UartSaveConfig();

    #else

        LCD_backup.enableState = (uint8) LCD_GET_CTRL_ENABLED;

        if(0u != LCD_backup.enableState)
        {
            LCD_Stop();
        }

    #endif /* defined (LCD_SCB_MODE_I2C_CONST_CFG) && (LCD_I2C_WAKE_ENABLE_CONST) */

#endif /* (LCD_SCB_MODE_UNCONFIG_CONST_CFG) */
}