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 ; ----------------------------------------- 000000 61 _PWR_DeInit: 62 ; ../inc/stm8l151x/src/stm8l15x_pwr.c: 84: PWR->CSR1 = PWR_CSR1_PVDIF; 000000 35 20 50 B2 [ 1] 63 mov 0x50b2+0, #0x20 64 ; ../inc/stm8l151x/src/stm8l15x_pwr.c: 85: PWR->CSR2 = PWR_CSR2_RESET_VALUE; 000004 35 00 50 B3 [ 1] 65 mov 0x50b3+0, #0x00 66 ; ../inc/stm8l151x/src/stm8l15x_pwr.c: 86: } 000008 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 ; ----------------------------------------- 000009 72 _PWR_PVDLevelConfig: 000009 88 [ 1] 73 push a 00000A 6B 01 [ 1] 74 ld (0x01, sp), a 75 ; ../inc/stm8l151x/src/stm8l15x_pwr.c: 108: PWR->CSR1 &= (uint8_t)(~PWR_CSR1_PLS); 00000C C6 50 B2 [ 1] 76 ld a, 0x50b2 00000F A4 F1 [ 1] 77 and a, #0xf1 000011 C7 50 B2 [ 1] 78 ld 0x50b2, a 79 ; ../inc/stm8l151x/src/stm8l15x_pwr.c: 111: PWR->CSR1 |= PWR_PVDLevel; 000014 C6 50 B2 [ 1] 80 ld a, 0x50b2 000017 1A 01 [ 1] 81 or a, (0x01, sp) 000019 C7 50 B2 [ 1] 82 ld 0x50b2, a 83 ; ../inc/stm8l151x/src/stm8l15x_pwr.c: 113: } 00001C 84 [ 1] 84 pop a 00001D 81 [ 4] 85 ret 86 ; ../inc/stm8l151x/src/stm8l15x_pwr.c: 121: void PWR_PVDCmd(FunctionalState NewState) 87 ; ----------------------------------------- 88 ; function PWR_PVDCmd 89 ; ----------------------------------------- 00001E 90 _PWR_PVDCmd: 00001E 88 [ 1] 91 push a 00001F 6B 01 [ 1] 92 ld (0x01, sp), a 93 ; ../inc/stm8l151x/src/stm8l15x_pwr.c: 129: PWR->CSR1 |= PWR_CSR1_PVDE; 000021 C6 50 B2 [ 1] 94 ld a, 0x50b2 95 ; ../inc/stm8l151x/src/stm8l15x_pwr.c: 126: if (NewState != DISABLE) 000024 0D 01 [ 1] 96 tnz (0x01, sp) 000026 27 07 [ 1] 97 jreq 00102$ 98 ; ../inc/stm8l151x/src/stm8l15x_pwr.c: 129: PWR->CSR1 |= PWR_CSR1_PVDE; 000028 AA 01 [ 1] 99 or a, #0x01 00002A C7 50 B2 [ 1] 100 ld 0x50b2, a 00002D 20 05 [ 2] 101 jra 00104$ 00002F 102 00102$: 103 ; ../inc/stm8l151x/src/stm8l15x_pwr.c: 134: PWR->CSR1 &= (uint8_t)(~PWR_CSR1_PVDE); 00002F A4 FE [ 1] 104 and a, #0xfe 000031 C7 50 B2 [ 1] 105 ld 0x50b2, a 000034 106 00104$: 107 ; ../inc/stm8l151x/src/stm8l15x_pwr.c: 136: } 000034 84 [ 1] 108 pop a 000035 81 [ 4] 109 ret 110 ; ../inc/stm8l151x/src/stm8l15x_pwr.c: 171: void PWR_FastWakeUpCmd(FunctionalState NewState) 111 ; ----------------------------------------- 112 ; function PWR_FastWakeUpCmd 113 ; ----------------------------------------- 000036 114 _PWR_FastWakeUpCmd: 000036 88 [ 1] 115 push a 000037 6B 01 [ 1] 116 ld (0x01, sp), a 117 ; ../inc/stm8l151x/src/stm8l15x_pwr.c: 179: PWR->CSR2 |= PWR_CSR2_FWU; 000039 C6 50 B3 [ 1] 118 ld a, 0x50b3 119 ; ../inc/stm8l151x/src/stm8l15x_pwr.c: 176: if (NewState != DISABLE) 00003C 0D 01 [ 1] 120 tnz (0x01, sp) 00003E 27 07 [ 1] 121 jreq 00102$ 122 ; ../inc/stm8l151x/src/stm8l15x_pwr.c: 179: PWR->CSR2 |= PWR_CSR2_FWU; 000040 AA 04 [ 1] 123 or a, #0x04 000042 C7 50 B3 [ 1] 124 ld 0x50b3, a 000045 20 05 [ 2] 125 jra 00104$ 000047 126 00102$: 127 ; ../inc/stm8l151x/src/stm8l15x_pwr.c: 184: PWR->CSR2 &= (uint8_t)(~PWR_CSR2_FWU); 000047 A4 FB [ 1] 128 and a, #0xfb 000049 C7 50 B3 [ 1] 129 ld 0x50b3, a 00004C 130 00104$: 131 ; ../inc/stm8l151x/src/stm8l15x_pwr.c: 186: } 00004C 84 [ 1] 132 pop a 00004D 81 [ 4] 133 ret 134 ; ../inc/stm8l151x/src/stm8l15x_pwr.c: 194: void PWR_UltraLowPowerCmd(FunctionalState NewState) 135 ; ----------------------------------------- 136 ; function PWR_UltraLowPowerCmd 137 ; ----------------------------------------- 00004E 138 _PWR_UltraLowPowerCmd: 00004E 88 [ 1] 139 push a 00004F 6B 01 [ 1] 140 ld (0x01, sp), a 141 ; ../inc/stm8l151x/src/stm8l15x_pwr.c: 202: PWR->CSR2 |= PWR_CSR2_ULP; 000051 C6 50 B3 [ 1] 142 ld a, 0x50b3 143 ; ../inc/stm8l151x/src/stm8l15x_pwr.c: 199: if (NewState != DISABLE) 000054 0D 01 [ 1] 144 tnz (0x01, sp) 000056 27 07 [ 1] 145 jreq 00102$ 146 ; ../inc/stm8l151x/src/stm8l15x_pwr.c: 202: PWR->CSR2 |= PWR_CSR2_ULP; 000058 AA 02 [ 1] 147 or a, #0x02 00005A C7 50 B3 [ 1] 148 ld 0x50b3, a 00005D 20 05 [ 2] 149 jra 00104$ 00005F 150 00102$: 151 ; ../inc/stm8l151x/src/stm8l15x_pwr.c: 207: PWR->CSR2 &= (uint8_t)(~PWR_CSR2_ULP); 00005F A4 FD [ 1] 152 and a, #0xfd 000061 C7 50 B3 [ 1] 153 ld 0x50b3, a 000064 154 00104$: 155 ; ../inc/stm8l151x/src/stm8l15x_pwr.c: 209: } 000064 84 [ 1] 156 pop a 000065 81 [ 4] 157 ret 158 ; ../inc/stm8l151x/src/stm8l15x_pwr.c: 232: void PWR_PVDITConfig(FunctionalState NewState) 159 ; ----------------------------------------- 160 ; function PWR_PVDITConfig 161 ; ----------------------------------------- 000066 162 _PWR_PVDITConfig: 000066 88 [ 1] 163 push a 000067 6B 01 [ 1] 164 ld (0x01, sp), a 165 ; ../inc/stm8l151x/src/stm8l15x_pwr.c: 240: PWR->CSR1 |= PWR_CSR1_PVDIEN; 000069 C6 50 B2 [ 1] 166 ld a, 0x50b2 167 ; ../inc/stm8l151x/src/stm8l15x_pwr.c: 237: if (NewState != DISABLE) 00006C 0D 01 [ 1] 168 tnz (0x01, sp) 00006E 27 07 [ 1] 169 jreq 00102$ 170 ; ../inc/stm8l151x/src/stm8l15x_pwr.c: 240: PWR->CSR1 |= PWR_CSR1_PVDIEN; 000070 AA 10 [ 1] 171 or a, #0x10 000072 C7 50 B2 [ 1] 172 ld 0x50b2, a 000075 20 05 [ 2] 173 jra 00104$ 000077 174 00102$: 175 ; ../inc/stm8l151x/src/stm8l15x_pwr.c: 245: PWR->CSR1 &= (uint8_t)(~PWR_CSR1_PVDIEN); 000077 A4 EF [ 1] 176 and a, #0xef 000079 C7 50 B2 [ 1] 177 ld 0x50b2, a 00007C 178 00104$: 179 ; ../inc/stm8l151x/src/stm8l15x_pwr.c: 247: } 00007C 84 [ 1] 180 pop a 00007D 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 ; ----------------------------------------- 00007E 186 _PWR_GetFlagStatus: 00007E 88 [ 1] 187 push a 188 ; ../inc/stm8l151x/src/stm8l15x_pwr.c: 268: if ((PWR_FLAG & PWR_FLAG_VREFINTF) != 0) 00007F 6B 01 [ 1] 189 ld (0x01, sp), a 000081 44 [ 1] 190 srl a 000082 24 0C [ 1] 191 jrnc 00108$ 192 ; ../inc/stm8l151x/src/stm8l15x_pwr.c: 270: if ((PWR->CSR2 & PWR_CR2_VREFINTF) != (uint8_t)RESET ) 000084 72 01 50 B3 04 [ 2] 193 btjf 0x50b3, #0, 00102$ 194 ; ../inc/stm8l151x/src/stm8l15x_pwr.c: 272: bitstatus = SET; 000089 A6 01 [ 1] 195 ld a, #0x01 00008B 20 0E [ 2] 196 jra 00109$ 00008D 197 00102$: 198 ; ../inc/stm8l151x/src/stm8l15x_pwr.c: 276: bitstatus = RESET; 00008D 4F [ 1] 199 clr a 00008E 20 0B [ 2] 200 jra 00109$ 000090 201 00108$: 202 ; ../inc/stm8l151x/src/stm8l15x_pwr.c: 281: if ((PWR->CSR1 & PWR_FLAG) != (uint8_t)RESET ) 000090 C6 50 B2 [ 1] 203 ld a, 0x50b2 000093 14 01 [ 1] 204 and a, (0x01, sp) 000095 27 03 [ 1] 205 jreq 00105$ 206 ; ../inc/stm8l151x/src/stm8l15x_pwr.c: 283: bitstatus = SET; 000097 A6 01 [ 1] 207 ld a, #0x01 208 ; ../inc/stm8l151x/src/stm8l15x_pwr.c: 287: bitstatus = RESET; 000099 21 209 .byte 0x21 00009A 210 00105$: 00009A 4F [ 1] 211 clr a 00009B 212 00109$: 213 ; ../inc/stm8l151x/src/stm8l15x_pwr.c: 292: return((FlagStatus)bitstatus); 214 ; ../inc/stm8l151x/src/stm8l15x_pwr.c: 293: } 00009B 5B 01 [ 2] 215 addw sp, #1 00009D 81 [ 4] 216 ret 217 ; ../inc/stm8l151x/src/stm8l15x_pwr.c: 300: void PWR_PVDClearFlag(void) 218 ; ----------------------------------------- 219 ; function PWR_PVDClearFlag 220 ; ----------------------------------------- 00009E 221 _PWR_PVDClearFlag: 222 ; ../inc/stm8l151x/src/stm8l15x_pwr.c: 303: PWR->CSR1 |= PWR_CSR1_PVDIF; 00009E 72 1A 50 B2 [ 1] 223 bset 0x50b2, #5 224 ; ../inc/stm8l151x/src/stm8l15x_pwr.c: 304: } 0000A2 81 [ 4] 225 ret 226 ; ../inc/stm8l151x/src/stm8l15x_pwr.c: 311: ITStatus PWR_PVDGetITStatus(void) 227 ; ----------------------------------------- 228 ; function PWR_PVDGetITStatus 229 ; ----------------------------------------- 0000A3 230 _PWR_PVDGetITStatus: 0000A3 88 [ 1] 231 push a 232 ; ../inc/stm8l151x/src/stm8l15x_pwr.c: 317: PVD_itStatus = (uint8_t)(PWR->CSR1 & (uint8_t)PWR_CSR1_PVDIF); 0000A4 C6 50 B2 [ 1] 233 ld a, 0x50b2 0000A7 A4 20 [ 1] 234 and a, #0x20 0000A9 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); 0000AB C6 50 B2 [ 1] 237 ld a, 0x50b2 0000AE 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)) 0000B0 0D 01 [ 1] 240 tnz (0x01, sp) 0000B2 27 06 [ 1] 241 jreq 00102$ 0000B4 4D [ 1] 242 tnz a 0000B5 27 03 [ 1] 243 jreq 00102$ 244 ; ../inc/stm8l151x/src/stm8l15x_pwr.c: 322: bitstatus = (ITStatus)SET; 0000B7 A6 01 [ 1] 245 ld a, #0x01 246 ; ../inc/stm8l151x/src/stm8l15x_pwr.c: 326: bitstatus = (ITStatus)RESET; 0000B9 21 247 .byte 0x21 0000BA 248 00102$: 0000BA 4F [ 1] 249 clr a 0000BB 250 00103$: 251 ; ../inc/stm8l151x/src/stm8l15x_pwr.c: 328: return ((ITStatus)bitstatus); 252 ; ../inc/stm8l151x/src/stm8l15x_pwr.c: 329: } 0000BB 5B 01 [ 2] 253 addw sp, #1 0000BD 81 [ 4] 254 ret 255 ; ../inc/stm8l151x/src/stm8l15x_pwr.c: 336: void PWR_PVDClearITPendingBit(void) 256 ; ----------------------------------------- 257 ; function PWR_PVDClearITPendingBit 258 ; ----------------------------------------- 0000BE 259 _PWR_PVDClearITPendingBit: 260 ; ../inc/stm8l151x/src/stm8l15x_pwr.c: 339: PWR->CSR1 |= PWR_CSR1_PVDIF; 0000BE 72 1A 50 B2 [ 1] 261 bset 0x50b2, #5 262 ; ../inc/stm8l151x/src/stm8l15x_pwr.c: 340: } 0000C2 81 [ 4] 263 ret 264 .area CODE 265 .area CONST 266 .area INITIALIZER 267 .area CABS (ABS)