1 /******************************************************************************
2 ** File Name: dsp_sleep.h *
3 ** Author: Richard Yang *
5 ** Copyright: 2003 Spreatrum, Incoporated. All Rights Reserved. *
6 ** Description: This file defines the basic operation interfaces of *
7 ** DSP and MCU for deep sleep. *
8 ******************************************************************************
10 ******************************************************************************
12 ** ------------------------------------------------------------------------- *
13 ** DATE NAME DESCRIPTION *
14 ** 08/25/2003 Richard.Yang Create. *
15 ******************************************************************************/
16 #ifndef _DEEP_SLEEP_V3_MODULE_H
17 #define _DEEP_SLEEP_V3_MODULE_H
19 /**---------------------------------------------------------------------------*
21 **---------------------------------------------------------------------------*/
22 #include "sci_types.h"
25 /**---------------------------------------------------------------------------*
27 **---------------------------------------------------------------------------*/
34 #include "tx_api_thumb.h"
35 /**---------------------------------------------------------------------------*
36 ** Constant Variables *
37 **---------------------------------------------------------------------------*/
38 #define NEW_SLEEP_ROUTINE
39 #define SLEEP_DRV_NONE 0
40 #define SLEEP_DRV_L1 BIT_0
41 #define SLEEP_DRV_MMI BIT_1
42 #define SLEEP_DRV_SIM BIT_2
43 #define SLEEP_DRV_AUDIO BIT_3
44 #define SLEEP_DRV_LCD BIT_4
45 #define SLEEP_DRV_CHARGE BIT_5
46 #define SLEEP_DRV_ENGINEER BIT_6
47 #define SLEEP_DRV_BT BIT_7
48 #define SLEEP_DRV_PCM BIT_8
49 #define SLEEP_DRV_BTCLK BIT_9
50 #define SLEEP_DRV_UPM BIT_10
51 #define SLEEP_DRV_CALIBRATION BIT_11
52 #define SLEEP_DRV_ATC BIT_12
53 #define SLEEP_DRV_TV BIT_13
55 #define MILLISECOND 180
57 #define ENABLE_DEEP_SLEEP 1
58 #define DISABLE_DEEP_SLEEP 0
60 #define ENABLE_AHB_SLEEP 1
61 #define DISABLE_AHB_SLEEP 0
63 //AHB_CTL0 bit define bit5,bit6 reserved
64 #define AHB_CTL0_DCAM_EB BIT_1
65 #define AHB_CTL0_USBD_EB BIT_2
66 #define AHB_CTL0_DMA_EB BIT_3
67 #define AHB_DMA_SLEEP_MODE BIT_4
68 #define AHB_CTL0_TIC_EB BIT_7
69 #define AHB_CTL0_MON_EB BIT_8
70 #define AHB_CTL0_EMC_EB BIT_9
71 //APB REG related bit definition
72 #define MISC0_APB_FORCE_SLP BIT_8
73 #define MISC0_APB_FORCE_ON BIT_20
74 //Mcu_misc_en reg related bit definition
75 #define DSP_CLK_OUT_EN BIT_15
76 #define MCU_MISC_HPASS BIT_31
86 SLP_LDOCORE_AUTO_CHANGE,
88 } SLEEP_LDO_AUTO_CTRL_E;
101 } SLEEP_CLK_AUTO_CTRL_E;
114 /*sleep_mode's bit map
115 -------------------------------------------------------------------------
116 | 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 |
117 -------------------------------------------------------------------------
119 -------------------------------------------------------------------------
120 -------------------------------------------------------------------------
121 | 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 |
122 -------------------------------------------------------------------------
123 | | | | ATC | Calibra| UPM | BT_CLK | PCM |
124 -------------------------------------------------------------------------
125 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
126 -------------------------------------------------------------------------
127 | BT |ENGINEER| CHR | LCD | AUD | SIM | MMI | L1 |
128 -------------------------------------------------------------------------*/
129 /* Note: Please remember to modify the sleep_mode initial value
130 * in deep_sleep.c when you modify the struct definition! */
131 typedef union _sleep_sturct
154 #define SLEEP_DRV_NONE 0
155 #define SLEEP_DRV_L1 BIT_0
156 #define SLEEP_DRV_MMI BIT_1
157 #define SLEEP_DRV_SIM BIT_2
158 #define SLEEP_DRV_AUDIO BIT_3
159 #define SLEEP_DRV_LCD BIT_4
160 #define SLEEP_DRV_CHARGE BIT_5
161 #define SLEEP_DRV_ENGINEER BIT_6
162 #define SLEEP_DRV_BT BIT_7
163 #define SLEEP_DRV_PCM BIT_8
164 #define SLEEP_DRV_BTCLK BIT_9
165 #define SLEEP_DRV_UPM BIT_10
166 #define SLEEP_DRV_CALIBRATION BIT_11
167 #define SLEEP_DRV_ATC BIT_12
168 #define SLEEP_DRV_AP BIT_13
170 /*ahb_sleep_mode's bit map
171 -------------------------------------------------------------------------
172 | 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 |
173 -------------------------------------------------------------------------
175 -------------------------------------------------------------------------
176 -------------------------------------------------------------------------
177 | 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 |
178 -------------------------------------------------------------------------
179 | | | | | | Arch_eb| emc_eb |Busmon_eb|
180 -------------------------------------------------------------------------
181 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
182 -------------------------------------------------------------------------
183 |Tic_eb |RESERVED|RESERVED|dma_s_mod| dma_eb| Usbd_en| Dcam_eb| |
184 -------------------------------------------------------------------------*/
185 /* Note: Please remember to modify the g_ahb_sleep_mode initial value
186 in deep_sleep.c when you modify the struct definition!*/
187 typedef union _ahb_sleep_sturct
201 /*apb_sleep_mode's bit map*/
204 /*-------------------------------------------------------------------------
205 | 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 |
206 -------------------------------------------------------------------------
208 -------------------------------------------------------------------------
209 -------------------------------------------------------------------------
210 | 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 |
211 -------------------------------------------------------------------------
213 -----------------------------------------------------------------------------------
214 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
215 -----------------------------------------------------------------------------------
216 | | pwm | tpc | i2c_eb| sim_eb | | adc_eb|
217 ----------------------------------------------------------------------------------*/
219 /*-------------------------------------------------------------------------
220 | 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 |
221 -------------------------------------------------------------------------
222 | | | | | pin | spi1 | iis | spi0| uart1 | uart0 |
223 -------------------------------------------------------------------------
224 -------------------------------------------------------------------------
225 | 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 |
226 -------------------------------------------------------------------------
227 | | | | | | | | gea_eb |
228 -----------------------------------------------------------------------------------
229 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
230 -----------------------------------------------------------------------------------
232 ----------------------------------------------------------------------------------*/
233 /* Note: Please remember to modify the g_apb_sleep_mode initial value
234 in deep_sleep.c when you modify the struct definition! */
235 typedef union _apb_sleep_sturct
261 /**---------------------------------------------------------------------------*
263 **---------------------------------------------------------------------------*/
267 #endif // End of _DEEP_SLEEP_V0_MODULE_H