📄 lowpower.txt
字号:
00006e f7fffffe BL LCD_DisplayStringLine
;;;137 LCD_DisplayStringLine(Line5, "To exit press Key ");
000072 a133 ADR r1,|L5.320|
000074 2078 MOVS r0,#0x78
000076 f7fffffe BL LCD_DisplayStringLine
;;;138 LCD_DisplayStringLine(Line6, "push button ");
00007a a137 ADR r1,|L5.344|
00007c 2090 MOVS r0,#0x90
00007e f7fffffe BL LCD_DisplayStringLine
;;;139
;;;140 /* Clear the RTC Alarm flag */
;;;141 RTC_ClearFlag(RTC_FLAG_ALR);
000082 2002 MOVS r0,#2
000084 f7fffffe BL RTC_ClearFlag
;;;142
;;;143 /* Save the GPIO pins current configuration then put all GPIO pins in Analog
;;;144 Input mode ...*/
;;;145 GPIO_SaveConfig();
000088 f7fffffe BL GPIO_SaveConfig
;;;146
;;;147 /* ... and keep PG.08 configuration which will be used as EXTI Line8 source */
;;;148 GPIOG->CRH = 0x4;
00008c 4938 LDR r1,|L5.368|
00008e 2004 MOVS r0,#4
000090 6048 STR r0,[r1,#4]
;;;149
;;;150 /* Request to enter STOP mode with regulator in low power */
;;;151 PWR_EnterSTOPMode(PWR_Regulator_LowPower, PWR_STOPEntry_WFI);
000092 2101 MOVS r1,#1
000094 4608 MOV r0,r1
000096 f7fffffe BL PWR_EnterSTOPMode
;;;152
;;;153 /* Restore the GPIO Configurations*/
;;;154 GPIO_RestoreConfig();
00009a f7fffffe BL GPIO_RestoreConfig
;;;155
;;;156 /* At this stage the system has resumed from STOP mode ************************/
;;;157 EXTI_InitStructure.EXTI_Mode = EXTI_Mode_Interrupt;
00009e f88d5004 STRB r5,[sp,#4]
;;;158 EXTI_InitStructure.EXTI_Line = EXTI_Line8;
;;;159 EXTI_InitStructure.EXTI_Trigger = EXTI_Trigger_Falling;
0000a2 f88da005 STRB r10,[sp,#5]
0000a6 f8cd9000 STR r9,[sp,#0]
;;;160 EXTI_InitStructure.EXTI_LineCmd = DISABLE;
0000aa f88d5006 STRB r5,[sp,#6]
;;;161 EXTI_Init(&EXTI_InitStructure);
0000ae 4668 MOV r0,sp
0000b0 f7fffffe BL EXTI_Init
;;;162
;;;163 /* Enable the EXTI9_5 Interrupt */
;;;164 NVIC_InitStructure.NVIC_IRQChannel = EXTI9_5_IRQChannel;
0000b4 f88d8008 STRB r8,[sp,#8]
;;;165 NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 2;
0000b8 2002 MOVS r0,#2
0000ba f88d0009 STRB r0,[sp,#9]
;;;166 NVIC_InitStructure.NVIC_IRQChannelSubPriority = 1;
0000be f88d400a STRB r4,[sp,#0xa]
;;;167 NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;
0000c2 f88d400b STRB r4,[sp,#0xb]
;;;168 NVIC_Init(&NVIC_InitStructure);
0000c6 a802 ADD r0,sp,#8
0000c8 f7fffffe BL NVIC_Init
;;;169
;;;170 /* Configures system clock after wake-up from STOP: enable HSE, PLL and select PLL
;;;171 as system clock source (HSE and PLL are disabled in STOP mode) */
;;;172 SYSCLKConfig_STOP();
0000cc f7fffffe BL SYSCLKConfig_STOP
|L5.208|
;;;173
;;;174 while(ReadKey() != NOKEY)
0000d0 f7fffffe BL ReadKey
0000d4 2800 CMP r0,#0
0000d6 d1fb BNE |L5.208|
;;;175 {
;;;176 }
;;;177
;;;178 if(STOPModeStatus != RESET)
0000d8 6838 LDR r0,[r7,#0] ; STOPModeStatus
;;;179 {
;;;180 LCD_DisplayStringLine(Line4, " STOP Mode ");
0000da a126 ADR r1,|L5.372|
0000dc 2800 CMP r0,#0 ;178
0000de f04f0060 MOV r0,#0x60
0000e2 d003 BEQ |L5.236|
0000e4 f7fffffe BL LCD_DisplayStringLine
;;;181 LCD_DisplayStringLine(Line5, "Wake-Up by RTC Alarm");
0000e8 a128 ADR r1,|L5.396|
;;;182 LCD_DisplayStringLine(Line6, "Press JoyStick to ");
;;;183 LCD_DisplayStringLine(Line7, "continue... ");
0000ea e002 B |L5.242|
|L5.236|
;;;184 }
;;;185 else
;;;186 {
;;;187 LCD_DisplayStringLine(Line4, " STOP Mode ");
0000ec f7fffffe BL LCD_DisplayStringLine
;;;188 LCD_DisplayStringLine(Line5, "WakeUp by Key Button");
0000f0 a12c ADR r1,|L5.420|
|L5.242|
0000f2 2078 MOVS r0,#0x78 ;181
0000f4 f7fffffe BL LCD_DisplayStringLine
0000f8 a130 ADR r1,|L5.444|
0000fa 2090 MOVS r0,#0x90 ;182
0000fc f7fffffe BL LCD_DisplayStringLine
000100 a134 ADR r1,|L5.468|
000102 20a8 MOVS r0,#0xa8 ;183
000104 f7fffffe BL LCD_DisplayStringLine
|L5.264|
;;;189 LCD_DisplayStringLine(Line6, "Press JoyStick to ");
;;;190 LCD_DisplayStringLine(Line7, "continue... ");
;;;191 }
;;;192
;;;193 while(ReadKey() == NOKEY)
000108 f7fffffe BL ReadKey
00010c 2800 CMP r0,#0
00010e d0fb BEQ |L5.264|
;;;194 {
;;;195 }
;;;196
;;;197 /* Clear the LCD */
;;;198 LCD_Clear(White);
000110 4630 MOV r0,r6
000112 f7fffffe BL LCD_Clear
;;;199 /* Display the previous menu */
;;;200 DisplayMenu();
000116 f7fffffe BL DisplayMenu
;;;201 /* Enable the JoyStick interrupts */
;;;202 IntExtOnOffConfig(ENABLE);
00011a 2001 MOVS r0,#1
00011c f7fffffe BL IntExtOnOffConfig
;;;203 }
000120 e8bd8ffe POP {r1-r11,pc}
;;;204
ENDP
|L5.292|
000124 00000000 DCD ||.data||
|L5.296|
000128 20204d435520696e2053544f50204d6f6465202000 DCB " MCU in STOP Mode ",0
00013d 00 DCB 0
00013e 00 DCB 0
00013f 00 DCB 0
|L5.320|
000140 546f2065786974207072657373204b657920202000 DCB "To exit press Key ",0
000155 00 DCB 0
000156 00 DCB 0
000157 00 DCB 0
|L5.344|
000158 7075736820627574746f6e20202020202020202000 DCB "push button ",0
00016d 00 DCB 0
00016e 00 DCB 0
00016f 00 DCB 0
|L5.368|
000170 40012000 DCD 0x40012000
|L5.372|
000174 20202020202053544f50204d6f6465202020202000 DCB " STOP Mode ",0
000189 00 DCB 0
00018a 00 DCB 0
00018b 00 DCB 0
|L5.396|
00018c 57616b652d55702062792052544320416c61726d00 DCB "Wake-Up by RTC Alarm",0
0001a1 00 DCB 0
0001a2 00 DCB 0
0001a3 00 DCB 0
|L5.420|
0001a4 57616b655570206279204b657920427574746f6e00 DCB "WakeUp by Key Button",0
0001b9 00 DCB 0
0001ba 00 DCB 0
0001bb 00 DCB 0
|L5.444|
0001bc 5072657373204a6f79537469636b20746f20202000 DCB "Press JoyStick to ",0
0001d1 00 DCB 0
0001d2 00 DCB 0
0001d3 00 DCB 0
|L5.468|
0001d4 636f6e74696e75652e2e2e20202020202020202000 DCB "continue... ",0
0001e9 00 DCB 0
0001ea 00 DCB 0
0001eb 00 DCB 0
AREA ||i.EnterSTOPMode_RTCAlarm||, CODE, READONLY, ALIGN=2
EnterSTOPMode_RTCAlarm PROC
;;;213 void EnterSTOPMode_RTCAlarm(void)
;;;214 {
000000 b570 PUSH {r4-r6,lr}
;;;215 u32 tmp = 0;
;;;216
;;;217 /* Clear the LCD */
;;;218 LCD_Clear(White);
000002 f64f75ff MOV r5,#0xffff
000006 4628 MOV r0,r5
000008 f7fffffe BL LCD_Clear
;;;219 /* Set the LCD Back Color */
;;;220 LCD_SetBackColor(Blue);
00000c 201f MOVS r0,#0x1f
00000e f7fffffe BL LCD_SetBackColor
;;;221
;;;222 /* Set the LCD Text Color */
;;;223 LCD_SetTextColor(White);
000012 4628 MOV r0,r5
000014 f7fffffe BL LCD_SetTextColor
;;;224
;;;225 /* Disable the JoyStick interrupts */
;;;226 IntExtOnOffConfig(DISABLE);
000018 2000 MOVS r0,#0
00001a f7fffffe BL IntExtOnOffConfig
;;;227
;;;228 while(ReadKey() != NOKEY)
00001e bf00 NOP
|L6.32|
000020 f7fffffe BL ReadKey
000024 2800 CMP r0,#0
000026 d1fb BNE |L6.32|
;;;229 {
;;;230 }
;;;231
;;;232 if(BKP_ReadBackupRegister(BKP_DR1) != 0xA5A5)
000028 2004 MOVS r0,#4
00002a f7fffffe BL BKP_ReadBackupRegister
00002e f5a04125 SUB r1,r0,#0xa500
000032 39a5 SUBS r1,r1,#0xa5
000034 d025 BEQ |L6.130|
;;;233 {
;;;234 LCD_DisplayStringLine(Line1, "Time and Date are ");
000036 a133 ADR r1,|L6.260|
000038 2018 MOVS r0,#0x18
00003a f7fffffe BL LCD_DisplayStringLine
;;;235 LCD_DisplayStringLine(Line2, "not configured, ");
00003e a137 ADR r1,|L6.284|
000040 2030 MOVS r0,#0x30
000042 f7fffffe BL LCD_DisplayStringLine
;;;236 LCD_DisplayStringLine(Line3, "please go to the ");
000046 a13b ADR r1,|L6.308|
000048 2048 MOVS r0,#0x48
00004a f7fffffe BL LCD_DisplayStringLine
;;;237 LCD_DisplayStringLine(Line4, "calendar menu and ");
00004e a13f ADR r1,|L6.332|
000050 2060 MOVS r0,#0x60
000052 f7fffffe BL LCD_DisplayStringLine
;;;238 LCD_DisplayStringLine(Line5, "set the time and ");
000056 a143 ADR r1,|L6.356|
000058 2078 MOVS r0,#0x78
00005a f7fffffe BL LCD_DisplayStringLine
;;;239 LCD_DisplayStringLine(Line6, "date parameters. ");
00005e a147 ADR r1,|L6.380|
000060 2090 MOVS r0,#0x90
000062 f7fffffe BL LCD_DisplayStringLine
;;;240 LCD_DisplayStringLine(Line7, "Press JoyStick to ");
000066 a14b ADR r1,|L6.404|
000068 20a8 MOVS r0,#0xa8
00006a f7fffffe BL LCD_DisplayStringLine
;;;241 LCD_DisplayStringLine(Line8, "continue... ");
00006e a14f ADR r1,|L6.428|
000070 20c0 MOVS r0,#0xc0
000072 f7fffffe BL LCD_DisplayStringLine
;;;242 while(ReadKey() == NOKEY)
000076 bf00 NOP
|L6.120|
000078 f7fffffe BL ReadKey
00007c 2800 CMP r0,#0
00007e d0fb BEQ |L6.120|
000080 e036 B |L6.240|
|L6.130|
;;;243 {
;;;244 }
;;;245 /* Clear the LCD */
;;;246 LCD_Clear(White);
;;;247 /* Display the previous menu */
;;;248 DisplayMenu();
;;;249 /* Enable the JoyStick interrupts */
;;;250 IntExtOnOffConfig(ENABLE);
;;;251 return;
;;;252 }
;;;253 tmp = RTC_GetCounter();
000082 f7fffffe BL RTC_GetCounter
000086 4604 MOV r4,r0
;;;254
;;;255 /* Save the Alarm value in the Backup register */
;;;256 BKP_WriteBackupRegister(BKP_DR6, (tmp & 0x0000FFFF));
000088 b281 UXTH r1,r0
00008a 2018 MOVS r0,#0x18
00008c f7fffffe BL BKP_WriteBackupRegister
;;;257 BKP_WriteBackupRegister(BKP_DR7, (tmp >> 16));
000090 0c21 LSRS r1,r4,#16
000092 201c MOVS r0,#0x1c
000094 f7fffffe BL BKP_WriteBackupRegister
;;;258
;;;259 Alarm_PreAdjust();
000098 f7fffffe BL Alarm_PreAdjust
;;;260 LCD_ClearLine(Line8);
00009c 20c0 MOVS r0,#0xc0
00009e f7fffffe BL LCD_ClearLine
;;;261 LCD_DisplayStringLine(Line6, " MCU in STOP Mode ");
0000a2 a148 ADR r1,|L6.452|
0000a4 2090 MOVS r0,#0x90
0000a6 f7fffffe BL LCD_DisplayStringLine
;;;262 LCD_DisplayStringLine(Line7, " Wait For RTC Alarm ");
0000aa a14c ADR r1,|L6.476|
0000ac 20a8 MOVS r0,#0xa8
0000ae f7fffffe BL LCD_DisplayStringLine
;;;263
;;;264 /* Save the GPIO pins current configuration then put all GPIO pins in Analog Input mode */
;;;265 GPIO_SaveConfig();
0000b2 f7fffffe BL GPIO_SaveConfig
;;;266
;;;267 /* Request to enter STOP mode with regulator in low power */
;;;268 PWR_EnterSTOPMode(PWR_Regulator_LowPower, PWR_STOPEntry_WFI);
0000b6 2101 MOVS r1,#1
0000b8 4608 MOV r0,r1
0000ba f7fffffe BL PWR_EnterSTOPMode
;;;269
;;;270 /* Restore the GPIO Configurations*/
;;;271 GPIO_RestoreConfig();
0000be f7fffffe BL GPIO_RestoreConfig
;;;272
;;;273 /* Configures system clock after wake-up from STOP: enable HSE, PLL and select PLL
;;;274 as system clock source (HSE and PLL are disabled in STOP mode) */
;;;275 SYSCLKConfig_STOP();
0000c2 f7fffffe BL SYSCLKConfig_STOP
;;;276
;;;277 LCD_DisplayStringLine(Line4, " STOP Mode ");
0000c6 a14b ADR r1,|L6.500|
0000c8 2060 MOVS r0,#0x60
0000ca f7fffffe BL LCD_DisplayStringLine
;;;278 LCD_DisplayStringLine(Line5, "Wake-Up by RTC Alarm");
0000ce a14f ADR r1,|L6.524|
0000d0 2078 MOVS r0,#0x78
0000d2 f7fffffe BL LCD_DisplayStringLine
;;;279 LCD_DisplayStringLine(Line6, "Press JoyStick to ");
0000d6 a12f ADR r1,|L6.404|
0000d8 2090 MOVS r0,#0x90
0000da f7fffffe BL LCD_DisplayStringLine
;;;280 LCD_DisplayStringLine(Line7, "continue... ");
0000de a133 ADR r1,|L6.428|
0000e0 20a8 MOVS r0,#0xa8
0000e2 f7fffffe BL LCD_DisplayStringLine
;;;281
;;;282 while(ReadKey() == NOKEY)
0000e6 bf00 NOP
|L6.232|
0000e8 f7fffffe BL ReadKey
0000ec 2800 CMP r0,#0
0000ee d0fb BEQ |L6.232|
|L6.240|
;;;283 {
;;;284 }
;;;285
;;;286 /* Clear the LCD */
;;;287 LCD_Clear(White);
0000f0 4628 MOV r0,r5
0000f2 f7fffffe BL LCD_Clear
;;;288 /* Display the previous menu */
;;;289 DisplayMenu();
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -