1 /******************************************************************************
2 ** File Name: sc8810_sleep_cfg.h *
5 ** Copyright: 2007 Spreatrum, Incoporated. All Rights Reserved. *
6 ** Description: This file defines the basic function for ldo management. *
7 ******************************************************************************/
9 /******************************************************************************
11 ** ------------------------------------------------------------------------- *
12 ** DATE NAME DESCRIPTION *
13 ** 07/09/2007 jiexia.yu Create. *
14 ******************************************************************************/
15 #ifndef _SC8810_SLEEP_CFG_H_
16 #define _SC8810_SLEEP_CFG_H_
18 /**---------------------------------------------------------------------------*
20 **---------------------------------------------------------------------------*/
23 /**---------------------------------------------------------------------------*
25 **---------------------------------------------------------------------------*/
31 /**---------------------------------------------------------------------------*
33 **---------------------------------------------------------------------------*/
34 #define SLEEP_MODULE_CONFIG_SLEEP_PIN_FEATURE 0
36 #define SLEEP_SUPPORT_BTCLK 0
37 #define SLEEP_SUPPORT_IVSP 1
38 #define SLEEP_SUPPORT_ISP 1
39 #define SLEEP_SUPPORT_DCAM 1
40 #define SLEEP_SUPPORT_LCDC 1
41 #define SLEEP_SUPPORT_SDIO 1
42 #define SLEEP_SUPPORT_BKLIGHT 1
43 #define SLEEP_SUPPORT_MMI 1
44 #define SLEEP_SUPPORT_USBD 0
45 #define SLEEP_SUPPORT_RETENTION 1
47 typedef void (*SLP_ENTER_FUNC) (uint8 slp_type);
51 SLP_CFG_NULL = 0, //id for NULL
59 SLP_AHB_NULL = 0, //id for NULL
60 SLP_AHB_DCAM, //id for AHB device dcam
61 SLP_AHB_USBD, //id for AHB device usbd
62 SLP_AHB_EMC, //id for AHB device emc
63 SLP_AHB_DMA, //id for AHB device dma
64 SLP_AHB_BUS, //id for AHB device bus
70 SLP_APB_NULL = 0, //id for NULL
71 SLP_APB_WDG, //id for APB device watchdog
72 SLP_APB_ADC, //id for APB device adc
73 SLP_APB_TMR, //id for APB device timer
74 SLP_APB_SIM, //id for APB device sim
75 SLP_APB_I2C, //id for APB device i2c
76 SLP_APB_TPC, //id for APB device tpc
77 SLP_APB_PWM, //id for APB device pwm
78 SLP_APB_KPD, //id for APB device keypad
79 SLP_APB_GPIO, //id for APB device gpio
80 SLP_APB_GEA, //id for APB device gea
81 SLP_APB_SYSTMR, //id for APB device sys timer
82 SLP_APB_UART0, //id for APB device uart0
83 SLP_APB_UART1, //id for APB device uart1
84 SLP_APB_SPI0, //id for APB device spi0
85 SLP_APB_IIS, //id for APB device iis
86 SLP_APB_SPI1, //id for APB device spi1
87 SLP_APB_PIN, //id for APB device pin
94 SLP_CTL_NULL = 0, //id for NULL
95 SLP_CTRL_MCU_FORCE_STOP, //id for arm and ahb ctrl
96 SLP_CTRL_MCU_DMA_WAKEUP_EN, //id for dma wake up ctrl
97 SLP_CTRL_MCU_SYS_SLEEP_EN, //id for sys sleep ctrl
98 SLP_CTRL_MCU_DEEP_SLEEP_EN, //id for deep sleep ctrl
99 SLP_CTRL_APB_STOP, //id for APB sleep ctrl
100 SLP_CTRL_APB_FORCE_ON, //id for APB sleep ctrl
101 SLP_CTRL_APB_FORCE_SLEEP, //id for APB sleep ctrl
102 SLP_CTRL_XTLEN, //id for xtlen sleep ctrl
103 SLP_CTRL_DMA_SLEEP_MOD, //id for dma sleep mode ctrl
104 SLP_CTRL_MCU_PLL_EN, //id for mcu pll enable
111 AHB_CAN_SLP_APB_CAN_SLP,
112 AHB_CAN_SLP_APB_NO_SLP,
113 AHB_NO_SLP_APB_CAN_SLP,
114 AHB_NO_SLP_APB_NO_SLP,
116 } SLP_AHB_APB_TYPE_E;
144 } SLP_AHB_CTL_T, * SLP_AHB_CTL_PTR;
154 } SLP_APB_CTL_T, * SLP_APB_CTL_PTR;
164 } SLP_BIT_CTL_T, * SLP_BIT_CTL_PTR;
168 SLP_AHB_CTL_T ahb_ctrl[SLP_AHB_DEV_MAX];
169 SLP_APB_CTL_T apb_ctrl[SLP_APB_DEV_MAX];
170 SLP_BIT_CTL_T slp_bit_ctrl[SLP_CTRL_MAX];
171 SLP_ENTER_FUNC slp_handler;
172 } SLP_COM_CTL_T, *SLPCOMCTL_PTR;
176 SLP_COM_CTL_T slp_com_cfg;
177 } SLP_CTL_T, * SLPCTL_PTR;
181 CHIP_TYPE_E chip_type;
182 SLPCTL_PTR sleep_ctl;
183 } SLP_CFG_T, * SLP_CFG_PTR;
185 /*****************************************************************************/
186 // Function name: Slp_Get_Cfg
187 // Description : this function get sleep table entry according to chip type
188 // Global resource dependence:
191 /*****************************************************************************/
192 PUBLIC SLPCTL_PTR Slp_Get_Cfg (void);
193 /*****************************************************************************/
194 // Function name: Slp_Get_Apb_Status
195 // Description : this function get chip sleep status according ahb and apb
197 // Global resource dependence:
200 /*****************************************************************************/
202 PUBLIC int tx_enter_deep_sleep (uint32 level);
204 /**---------------------------------------------------------------------------*
206 **---------------------------------------------------------------------------*/
211 #endif // _SC8810_SLEEP_CFG_H_