1 ;-------------------------------------------------------- 2 ; File Created by SDCC : free open source ISO C Compiler 3 ; Version 4.5.0 #15242 (Linux) 4 ;-------------------------------------------------------- 5 .module stm8l15x_pwr 6 7 ;-------------------------------------------------------- 8 ; Public variables in this module 9 ;-------------------------------------------------------- 10 .globl _PWR_DeInit 11 .globl _PWR_PVDLevelConfig 12 .globl _PWR_PVDCmd 13 .globl _PWR_FastWakeUpCmd 14 .globl _PWR_UltraLowPowerCmd 15 .globl _PWR_PVDITConfig 16 .globl _PWR_GetFlagStatus 17 .globl _PWR_PVDClearFlag 18 .globl _PWR_PVDGetITStatus 19 .globl _PWR_PVDClearITPendingBit 20 ;-------------------------------------------------------- 21 ; ram data 22 ;-------------------------------------------------------- 23 .area DATA 24 ;-------------------------------------------------------- 25 ; ram data 26 ;-------------------------------------------------------- 27 .area INITIALIZED 28 ;-------------------------------------------------------- 29 ; absolute external ram data 30 ;-------------------------------------------------------- 31 .area DABS (ABS) 32 33 ; default segment ordering for linker 34 .area HOME 35 .area GSINIT 36 .area GSFINAL 37 .area CONST 38 .area INITIALIZER 39 .area CODE 40 41 ;-------------------------------------------------------- 42 ; global & static initialisations 43 ;-------------------------------------------------------- 44 .area HOME 45 .area GSINIT 46 .area GSFINAL 47 .area GSINIT 48 ;-------------------------------------------------------- 49 ; Home 50 ;-------------------------------------------------------- 51 .area HOME 52 .area HOME 53 ;-------------------------------------------------------- 54 ; code 55 ;-------------------------------------------------------- 56 .area CODE 57 ; ../inc/stm8l151x/src/stm8l15x_pwr.c: 82: void PWR_DeInit(void) 58 ; ----------------------------------------- 59 ; function PWR_DeInit 60 ; ----------------------------------------- 008969 61 _PWR_DeInit: 62 ; ../inc/stm8l151x/src/stm8l15x_pwr.c: 84: PWR->CSR1 = PWR_CSR1_PVDIF; 008969 35 20 50 B2 [ 1] 63 mov 0x50b2+0, #0x20 64 ; ../inc/stm8l151x/src/stm8l15x_pwr.c: 85: PWR->CSR2 = PWR_CSR2_RESET_VALUE; 00896D 35 00 50 B3 [ 1] 65 mov 0x50b3+0, #0x00 66 ; ../inc/stm8l151x/src/stm8l15x_pwr.c: 86: } 008971 81 [ 4] 67 ret 68 ; ../inc/stm8l151x/src/stm8l15x_pwr.c: 102: void PWR_PVDLevelConfig(PWR_PVDLevel_TypeDef PWR_PVDLevel) 69 ; ----------------------------------------- 70 ; function PWR_PVDLevelConfig 71 ; ----------------------------------------- 008972 72 _PWR_PVDLevelConfig: 008972 88 [ 1] 73 push a 008973 6B 01 [ 1] 74 ld (0x01, sp), a 75 ; ../inc/stm8l151x/src/stm8l15x_pwr.c: 108: PWR->CSR1 &= (uint8_t)(~PWR_CSR1_PLS); 008975 C6 50 B2 [ 1] 76 ld a, 0x50b2 008978 A4 F1 [ 1] 77 and a, #0xf1 00897A C7 50 B2 [ 1] 78 ld 0x50b2, a 79 ; ../inc/stm8l151x/src/stm8l15x_pwr.c: 111: PWR->CSR1 |= PWR_PVDLevel; 00897D C6 50 B2 [ 1] 80 ld a, 0x50b2 008980 1A 01 [ 1] 81 or a, (0x01, sp) 008982 C7 50 B2 [ 1] 82 ld 0x50b2, a 83 ; ../inc/stm8l151x/src/stm8l15x_pwr.c: 113: } 008985 84 [ 1] 84 pop a 008986 81 [ 4] 85 ret 86 ; ../inc/stm8l151x/src/stm8l15x_pwr.c: 121: void PWR_PVDCmd(FunctionalState NewState) 87 ; ----------------------------------------- 88 ; function PWR_PVDCmd 89 ; ----------------------------------------- 008987 90 _PWR_PVDCmd: 008987 88 [ 1] 91 push a 008988 6B 01 [ 1] 92 ld (0x01, sp), a 93 ; ../inc/stm8l151x/src/stm8l15x_pwr.c: 129: PWR->CSR1 |= PWR_CSR1_PVDE; 00898A C6 50 B2 [ 1] 94 ld a, 0x50b2 95 ; ../inc/stm8l151x/src/stm8l15x_pwr.c: 126: if (NewState != DISABLE) 00898D 0D 01 [ 1] 96 tnz (0x01, sp) 00898F 27 07 [ 1] 97 jreq 00102$ 98 ; ../inc/stm8l151x/src/stm8l15x_pwr.c: 129: PWR->CSR1 |= PWR_CSR1_PVDE; 008991 AA 01 [ 1] 99 or a, #0x01 008993 C7 50 B2 [ 1] 100 ld 0x50b2, a 008996 20 05 [ 2] 101 jra 00104$ 008998 102 00102$: 103 ; ../inc/stm8l151x/src/stm8l15x_pwr.c: 134: PWR->CSR1 &= (uint8_t)(~PWR_CSR1_PVDE); 008998 A4 FE [ 1] 104 and a, #0xfe 00899A C7 50 B2 [ 1] 105 ld 0x50b2, a 00899D 106 00104$: 107 ; ../inc/stm8l151x/src/stm8l15x_pwr.c: 136: } 00899D 84 [ 1] 108 pop a 00899E 81 [ 4] 109 ret 110 ; ../inc/stm8l151x/src/stm8l15x_pwr.c: 171: void PWR_FastWakeUpCmd(FunctionalState NewState) 111 ; ----------------------------------------- 112 ; function PWR_FastWakeUpCmd 113 ; ----------------------------------------- 00899F 114 _PWR_FastWakeUpCmd: 00899F 88 [ 1] 115 push a 0089A0 6B 01 [ 1] 116 ld (0x01, sp), a 117 ; ../inc/stm8l151x/src/stm8l15x_pwr.c: 179: PWR->CSR2 |= PWR_CSR2_FWU; 0089A2 C6 50 B3 [ 1] 118 ld a, 0x50b3 119 ; ../inc/stm8l151x/src/stm8l15x_pwr.c: 176: if (NewState != DISABLE) 0089A5 0D 01 [ 1] 120 tnz (0x01, sp) 0089A7 27 07 [ 1] 121 jreq 00102$ 122 ; ../inc/stm8l151x/src/stm8l15x_pwr.c: 179: PWR->CSR2 |= PWR_CSR2_FWU; 0089A9 AA 04 [ 1] 123 or a, #0x04 0089AB C7 50 B3 [ 1] 124 ld 0x50b3, a 0089AE 20 05 [ 2] 125 jra 00104$ 0089B0 126 00102$: 127 ; ../inc/stm8l151x/src/stm8l15x_pwr.c: 184: PWR->CSR2 &= (uint8_t)(~PWR_CSR2_FWU); 0089B0 A4 FB [ 1] 128 and a, #0xfb 0089B2 C7 50 B3 [ 1] 129 ld 0x50b3, a 0089B5 130 00104$: 131 ; ../inc/stm8l151x/src/stm8l15x_pwr.c: 186: } 0089B5 84 [ 1] 132 pop a 0089B6 81 [ 4] 133 ret 134 ; ../inc/stm8l151x/src/stm8l15x_pwr.c: 194: void PWR_UltraLowPowerCmd(FunctionalState NewState) 135 ; ----------------------------------------- 136 ; function PWR_UltraLowPowerCmd 137 ; ----------------------------------------- 0089B7 138 _PWR_UltraLowPowerCmd: 0089B7 88 [ 1] 139 push a 0089B8 6B 01 [ 1] 140 ld (0x01, sp), a 141 ; ../inc/stm8l151x/src/stm8l15x_pwr.c: 202: PWR->CSR2 |= PWR_CSR2_ULP; 0089BA C6 50 B3 [ 1] 142 ld a, 0x50b3 143 ; ../inc/stm8l151x/src/stm8l15x_pwr.c: 199: if (NewState != DISABLE) 0089BD 0D 01 [ 1] 144 tnz (0x01, sp) 0089BF 27 07 [ 1] 145 jreq 00102$ 146 ; ../inc/stm8l151x/src/stm8l15x_pwr.c: 202: PWR->CSR2 |= PWR_CSR2_ULP; 0089C1 AA 02 [ 1] 147 or a, #0x02 0089C3 C7 50 B3 [ 1] 148 ld 0x50b3, a 0089C6 20 05 [ 2] 149 jra 00104$ 0089C8 150 00102$: 151 ; ../inc/stm8l151x/src/stm8l15x_pwr.c: 207: PWR->CSR2 &= (uint8_t)(~PWR_CSR2_ULP); 0089C8 A4 FD [ 1] 152 and a, #0xfd 0089CA C7 50 B3 [ 1] 153 ld 0x50b3, a 0089CD 154 00104$: 155 ; ../inc/stm8l151x/src/stm8l15x_pwr.c: 209: } 0089CD 84 [ 1] 156 pop a 0089CE 81 [ 4] 157 ret 158 ; ../inc/stm8l151x/src/stm8l15x_pwr.c: 232: void PWR_PVDITConfig(FunctionalState NewState) 159 ; ----------------------------------------- 160 ; function PWR_PVDITConfig 161 ; ----------------------------------------- 0089CF 162 _PWR_PVDITConfig: 0089CF 88 [ 1] 163 push a 0089D0 6B 01 [ 1] 164 ld (0x01, sp), a 165 ; ../inc/stm8l151x/src/stm8l15x_pwr.c: 240: PWR->CSR1 |= PWR_CSR1_PVDIEN; 0089D2 C6 50 B2 [ 1] 166 ld a, 0x50b2 167 ; ../inc/stm8l151x/src/stm8l15x_pwr.c: 237: if (NewState != DISABLE) 0089D5 0D 01 [ 1] 168 tnz (0x01, sp) 0089D7 27 07 [ 1] 169 jreq 00102$ 170 ; ../inc/stm8l151x/src/stm8l15x_pwr.c: 240: PWR->CSR1 |= PWR_CSR1_PVDIEN; 0089D9 AA 10 [ 1] 171 or a, #0x10 0089DB C7 50 B2 [ 1] 172 ld 0x50b2, a 0089DE 20 05 [ 2] 173 jra 00104$ 0089E0 174 00102$: 175 ; ../inc/stm8l151x/src/stm8l15x_pwr.c: 245: PWR->CSR1 &= (uint8_t)(~PWR_CSR1_PVDIEN); 0089E0 A4 EF [ 1] 176 and a, #0xef 0089E2 C7 50 B2 [ 1] 177 ld 0x50b2, a 0089E5 178 00104$: 179 ; ../inc/stm8l151x/src/stm8l15x_pwr.c: 247: } 0089E5 84 [ 1] 180 pop a 0089E6 81 [ 4] 181 ret 182 ; ../inc/stm8l151x/src/stm8l15x_pwr.c: 261: FlagStatus PWR_GetFlagStatus(PWR_FLAG_TypeDef PWR_FLAG) 183 ; ----------------------------------------- 184 ; function PWR_GetFlagStatus 185 ; ----------------------------------------- 0089E7 186 _PWR_GetFlagStatus: 0089E7 88 [ 1] 187 push a 188 ; ../inc/stm8l151x/src/stm8l15x_pwr.c: 268: if ((PWR_FLAG & PWR_FLAG_VREFINTF) != 0) 0089E8 6B 01 [ 1] 189 ld (0x01, sp), a 0089EA 44 [ 1] 190 srl a 0089EB 24 0C [ 1] 191 jrnc 00108$ 192 ; ../inc/stm8l151x/src/stm8l15x_pwr.c: 270: if ((PWR->CSR2 & PWR_CR2_VREFINTF) != (uint8_t)RESET ) 0089ED 72 01 50 B3 04 [ 2] 193 btjf 0x50b3, #0, 00102$ 194 ; ../inc/stm8l151x/src/stm8l15x_pwr.c: 272: bitstatus = SET; 0089F2 A6 01 [ 1] 195 ld a, #0x01 0089F4 20 0E [ 2] 196 jra 00109$ 0089F6 197 00102$: 198 ; ../inc/stm8l151x/src/stm8l15x_pwr.c: 276: bitstatus = RESET; 0089F6 4F [ 1] 199 clr a 0089F7 20 0B [ 2] 200 jra 00109$ 0089F9 201 00108$: 202 ; ../inc/stm8l151x/src/stm8l15x_pwr.c: 281: if ((PWR->CSR1 & PWR_FLAG) != (uint8_t)RESET ) 0089F9 C6 50 B2 [ 1] 203 ld a, 0x50b2 0089FC 14 01 [ 1] 204 and a, (0x01, sp) 0089FE 27 03 [ 1] 205 jreq 00105$ 206 ; ../inc/stm8l151x/src/stm8l15x_pwr.c: 283: bitstatus = SET; 008A00 A6 01 [ 1] 207 ld a, #0x01 208 ; ../inc/stm8l151x/src/stm8l15x_pwr.c: 287: bitstatus = RESET; 008A02 21 209 .byte 0x21 008A03 210 00105$: 008A03 4F [ 1] 211 clr a 008A04 212 00109$: 213 ; ../inc/stm8l151x/src/stm8l15x_pwr.c: 292: return((FlagStatus)bitstatus); 214 ; ../inc/stm8l151x/src/stm8l15x_pwr.c: 293: } 008A04 5B 01 [ 2] 215 addw sp, #1 008A06 81 [ 4] 216 ret 217 ; ../inc/stm8l151x/src/stm8l15x_pwr.c: 300: void PWR_PVDClearFlag(void) 218 ; ----------------------------------------- 219 ; function PWR_PVDClearFlag 220 ; ----------------------------------------- 008A07 221 _PWR_PVDClearFlag: 222 ; ../inc/stm8l151x/src/stm8l15x_pwr.c: 303: PWR->CSR1 |= PWR_CSR1_PVDIF; 008A07 72 1A 50 B2 [ 1] 223 bset 0x50b2, #5 224 ; ../inc/stm8l151x/src/stm8l15x_pwr.c: 304: } 008A0B 81 [ 4] 225 ret 226 ; ../inc/stm8l151x/src/stm8l15x_pwr.c: 311: ITStatus PWR_PVDGetITStatus(void) 227 ; ----------------------------------------- 228 ; function PWR_PVDGetITStatus 229 ; ----------------------------------------- 008A0C 230 _PWR_PVDGetITStatus: 008A0C 88 [ 1] 231 push a 232 ; ../inc/stm8l151x/src/stm8l15x_pwr.c: 317: PVD_itStatus = (uint8_t)(PWR->CSR1 & (uint8_t)PWR_CSR1_PVDIF); 008A0D C6 50 B2 [ 1] 233 ld a, 0x50b2 008A10 A4 20 [ 1] 234 and a, #0x20 008A12 6B 01 [ 1] 235 ld (0x01, sp), a 236 ; ../inc/stm8l151x/src/stm8l15x_pwr.c: 318: PVD_itEnable = (uint8_t)(PWR->CSR1 & (uint8_t)PWR_CSR1_PVDIEN); 008A14 C6 50 B2 [ 1] 237 ld a, 0x50b2 008A17 A4 10 [ 1] 238 and a, #0x10 239 ; ../inc/stm8l151x/src/stm8l15x_pwr.c: 320: if ((PVD_itStatus != (uint8_t)RESET ) && (PVD_itEnable != (uint8_t)RESET)) 008A19 0D 01 [ 1] 240 tnz (0x01, sp) 008A1B 27 06 [ 1] 241 jreq 00102$ 008A1D 4D [ 1] 242 tnz a 008A1E 27 03 [ 1] 243 jreq 00102$ 244 ; ../inc/stm8l151x/src/stm8l15x_pwr.c: 322: bitstatus = (ITStatus)SET; 008A20 A6 01 [ 1] 245 ld a, #0x01 246 ; ../inc/stm8l151x/src/stm8l15x_pwr.c: 326: bitstatus = (ITStatus)RESET; 008A22 21 247 .byte 0x21 008A23 248 00102$: 008A23 4F [ 1] 249 clr a 008A24 250 00103$: 251 ; ../inc/stm8l151x/src/stm8l15x_pwr.c: 328: return ((ITStatus)bitstatus); 252 ; ../inc/stm8l151x/src/stm8l15x_pwr.c: 329: } 008A24 5B 01 [ 2] 253 addw sp, #1 008A26 81 [ 4] 254 ret 255 ; ../inc/stm8l151x/src/stm8l15x_pwr.c: 336: void PWR_PVDClearITPendingBit(void) 256 ; ----------------------------------------- 257 ; function PWR_PVDClearITPendingBit 258 ; ----------------------------------------- 008A27 259 _PWR_PVDClearITPendingBit: 260 ; ../inc/stm8l151x/src/stm8l15x_pwr.c: 339: PWR->CSR1 |= PWR_CSR1_PVDIF; 008A27 72 1A 50 B2 [ 1] 261 bset 0x50b2, #5 262 ; ../inc/stm8l151x/src/stm8l15x_pwr.c: 340: } 008A2B 81 [ 4] 263 ret 264 .area CODE 265 .area CONST 266 .area INITIALIZER 267 .area CABS (ABS)