..
This commit is contained in:
267
firmware/STM8L15X_LD/stm8l15x_pwr.asm
Normal file
267
firmware/STM8L15X_LD/stm8l15x_pwr.asm
Normal file
@@ -0,0 +1,267 @@
|
||||
;--------------------------------------------------------
|
||||
; File Created by SDCC : free open source ISO C Compiler
|
||||
; Version 4.5.0 #15242 (Linux)
|
||||
;--------------------------------------------------------
|
||||
.module stm8l15x_pwr
|
||||
|
||||
;--------------------------------------------------------
|
||||
; Public variables in this module
|
||||
;--------------------------------------------------------
|
||||
.globl _PWR_DeInit
|
||||
.globl _PWR_PVDLevelConfig
|
||||
.globl _PWR_PVDCmd
|
||||
.globl _PWR_FastWakeUpCmd
|
||||
.globl _PWR_UltraLowPowerCmd
|
||||
.globl _PWR_PVDITConfig
|
||||
.globl _PWR_GetFlagStatus
|
||||
.globl _PWR_PVDClearFlag
|
||||
.globl _PWR_PVDGetITStatus
|
||||
.globl _PWR_PVDClearITPendingBit
|
||||
;--------------------------------------------------------
|
||||
; ram data
|
||||
;--------------------------------------------------------
|
||||
.area DATA
|
||||
;--------------------------------------------------------
|
||||
; ram data
|
||||
;--------------------------------------------------------
|
||||
.area INITIALIZED
|
||||
;--------------------------------------------------------
|
||||
; absolute external ram data
|
||||
;--------------------------------------------------------
|
||||
.area DABS (ABS)
|
||||
|
||||
; default segment ordering for linker
|
||||
.area HOME
|
||||
.area GSINIT
|
||||
.area GSFINAL
|
||||
.area CONST
|
||||
.area INITIALIZER
|
||||
.area CODE
|
||||
|
||||
;--------------------------------------------------------
|
||||
; global & static initialisations
|
||||
;--------------------------------------------------------
|
||||
.area HOME
|
||||
.area GSINIT
|
||||
.area GSFINAL
|
||||
.area GSINIT
|
||||
;--------------------------------------------------------
|
||||
; Home
|
||||
;--------------------------------------------------------
|
||||
.area HOME
|
||||
.area HOME
|
||||
;--------------------------------------------------------
|
||||
; code
|
||||
;--------------------------------------------------------
|
||||
.area CODE
|
||||
; ../inc/stm8l151x/src/stm8l15x_pwr.c: 82: void PWR_DeInit(void)
|
||||
; -----------------------------------------
|
||||
; function PWR_DeInit
|
||||
; -----------------------------------------
|
||||
_PWR_DeInit:
|
||||
; ../inc/stm8l151x/src/stm8l15x_pwr.c: 84: PWR->CSR1 = PWR_CSR1_PVDIF;
|
||||
mov 0x50b2+0, #0x20
|
||||
; ../inc/stm8l151x/src/stm8l15x_pwr.c: 85: PWR->CSR2 = PWR_CSR2_RESET_VALUE;
|
||||
mov 0x50b3+0, #0x00
|
||||
; ../inc/stm8l151x/src/stm8l15x_pwr.c: 86: }
|
||||
ret
|
||||
; ../inc/stm8l151x/src/stm8l15x_pwr.c: 102: void PWR_PVDLevelConfig(PWR_PVDLevel_TypeDef PWR_PVDLevel)
|
||||
; -----------------------------------------
|
||||
; function PWR_PVDLevelConfig
|
||||
; -----------------------------------------
|
||||
_PWR_PVDLevelConfig:
|
||||
push a
|
||||
ld (0x01, sp), a
|
||||
; ../inc/stm8l151x/src/stm8l15x_pwr.c: 108: PWR->CSR1 &= (uint8_t)(~PWR_CSR1_PLS);
|
||||
ld a, 0x50b2
|
||||
and a, #0xf1
|
||||
ld 0x50b2, a
|
||||
; ../inc/stm8l151x/src/stm8l15x_pwr.c: 111: PWR->CSR1 |= PWR_PVDLevel;
|
||||
ld a, 0x50b2
|
||||
or a, (0x01, sp)
|
||||
ld 0x50b2, a
|
||||
; ../inc/stm8l151x/src/stm8l15x_pwr.c: 113: }
|
||||
pop a
|
||||
ret
|
||||
; ../inc/stm8l151x/src/stm8l15x_pwr.c: 121: void PWR_PVDCmd(FunctionalState NewState)
|
||||
; -----------------------------------------
|
||||
; function PWR_PVDCmd
|
||||
; -----------------------------------------
|
||||
_PWR_PVDCmd:
|
||||
push a
|
||||
ld (0x01, sp), a
|
||||
; ../inc/stm8l151x/src/stm8l15x_pwr.c: 129: PWR->CSR1 |= PWR_CSR1_PVDE;
|
||||
ld a, 0x50b2
|
||||
; ../inc/stm8l151x/src/stm8l15x_pwr.c: 126: if (NewState != DISABLE)
|
||||
tnz (0x01, sp)
|
||||
jreq 00102$
|
||||
; ../inc/stm8l151x/src/stm8l15x_pwr.c: 129: PWR->CSR1 |= PWR_CSR1_PVDE;
|
||||
or a, #0x01
|
||||
ld 0x50b2, a
|
||||
jra 00104$
|
||||
00102$:
|
||||
; ../inc/stm8l151x/src/stm8l15x_pwr.c: 134: PWR->CSR1 &= (uint8_t)(~PWR_CSR1_PVDE);
|
||||
and a, #0xfe
|
||||
ld 0x50b2, a
|
||||
00104$:
|
||||
; ../inc/stm8l151x/src/stm8l15x_pwr.c: 136: }
|
||||
pop a
|
||||
ret
|
||||
; ../inc/stm8l151x/src/stm8l15x_pwr.c: 171: void PWR_FastWakeUpCmd(FunctionalState NewState)
|
||||
; -----------------------------------------
|
||||
; function PWR_FastWakeUpCmd
|
||||
; -----------------------------------------
|
||||
_PWR_FastWakeUpCmd:
|
||||
push a
|
||||
ld (0x01, sp), a
|
||||
; ../inc/stm8l151x/src/stm8l15x_pwr.c: 179: PWR->CSR2 |= PWR_CSR2_FWU;
|
||||
ld a, 0x50b3
|
||||
; ../inc/stm8l151x/src/stm8l15x_pwr.c: 176: if (NewState != DISABLE)
|
||||
tnz (0x01, sp)
|
||||
jreq 00102$
|
||||
; ../inc/stm8l151x/src/stm8l15x_pwr.c: 179: PWR->CSR2 |= PWR_CSR2_FWU;
|
||||
or a, #0x04
|
||||
ld 0x50b3, a
|
||||
jra 00104$
|
||||
00102$:
|
||||
; ../inc/stm8l151x/src/stm8l15x_pwr.c: 184: PWR->CSR2 &= (uint8_t)(~PWR_CSR2_FWU);
|
||||
and a, #0xfb
|
||||
ld 0x50b3, a
|
||||
00104$:
|
||||
; ../inc/stm8l151x/src/stm8l15x_pwr.c: 186: }
|
||||
pop a
|
||||
ret
|
||||
; ../inc/stm8l151x/src/stm8l15x_pwr.c: 194: void PWR_UltraLowPowerCmd(FunctionalState NewState)
|
||||
; -----------------------------------------
|
||||
; function PWR_UltraLowPowerCmd
|
||||
; -----------------------------------------
|
||||
_PWR_UltraLowPowerCmd:
|
||||
push a
|
||||
ld (0x01, sp), a
|
||||
; ../inc/stm8l151x/src/stm8l15x_pwr.c: 202: PWR->CSR2 |= PWR_CSR2_ULP;
|
||||
ld a, 0x50b3
|
||||
; ../inc/stm8l151x/src/stm8l15x_pwr.c: 199: if (NewState != DISABLE)
|
||||
tnz (0x01, sp)
|
||||
jreq 00102$
|
||||
; ../inc/stm8l151x/src/stm8l15x_pwr.c: 202: PWR->CSR2 |= PWR_CSR2_ULP;
|
||||
or a, #0x02
|
||||
ld 0x50b3, a
|
||||
jra 00104$
|
||||
00102$:
|
||||
; ../inc/stm8l151x/src/stm8l15x_pwr.c: 207: PWR->CSR2 &= (uint8_t)(~PWR_CSR2_ULP);
|
||||
and a, #0xfd
|
||||
ld 0x50b3, a
|
||||
00104$:
|
||||
; ../inc/stm8l151x/src/stm8l15x_pwr.c: 209: }
|
||||
pop a
|
||||
ret
|
||||
; ../inc/stm8l151x/src/stm8l15x_pwr.c: 232: void PWR_PVDITConfig(FunctionalState NewState)
|
||||
; -----------------------------------------
|
||||
; function PWR_PVDITConfig
|
||||
; -----------------------------------------
|
||||
_PWR_PVDITConfig:
|
||||
push a
|
||||
ld (0x01, sp), a
|
||||
; ../inc/stm8l151x/src/stm8l15x_pwr.c: 240: PWR->CSR1 |= PWR_CSR1_PVDIEN;
|
||||
ld a, 0x50b2
|
||||
; ../inc/stm8l151x/src/stm8l15x_pwr.c: 237: if (NewState != DISABLE)
|
||||
tnz (0x01, sp)
|
||||
jreq 00102$
|
||||
; ../inc/stm8l151x/src/stm8l15x_pwr.c: 240: PWR->CSR1 |= PWR_CSR1_PVDIEN;
|
||||
or a, #0x10
|
||||
ld 0x50b2, a
|
||||
jra 00104$
|
||||
00102$:
|
||||
; ../inc/stm8l151x/src/stm8l15x_pwr.c: 245: PWR->CSR1 &= (uint8_t)(~PWR_CSR1_PVDIEN);
|
||||
and a, #0xef
|
||||
ld 0x50b2, a
|
||||
00104$:
|
||||
; ../inc/stm8l151x/src/stm8l15x_pwr.c: 247: }
|
||||
pop a
|
||||
ret
|
||||
; ../inc/stm8l151x/src/stm8l15x_pwr.c: 261: FlagStatus PWR_GetFlagStatus(PWR_FLAG_TypeDef PWR_FLAG)
|
||||
; -----------------------------------------
|
||||
; function PWR_GetFlagStatus
|
||||
; -----------------------------------------
|
||||
_PWR_GetFlagStatus:
|
||||
push a
|
||||
; ../inc/stm8l151x/src/stm8l15x_pwr.c: 268: if ((PWR_FLAG & PWR_FLAG_VREFINTF) != 0)
|
||||
ld (0x01, sp), a
|
||||
srl a
|
||||
jrnc 00108$
|
||||
; ../inc/stm8l151x/src/stm8l15x_pwr.c: 270: if ((PWR->CSR2 & PWR_CR2_VREFINTF) != (uint8_t)RESET )
|
||||
btjf 0x50b3, #0, 00102$
|
||||
; ../inc/stm8l151x/src/stm8l15x_pwr.c: 272: bitstatus = SET;
|
||||
ld a, #0x01
|
||||
jra 00109$
|
||||
00102$:
|
||||
; ../inc/stm8l151x/src/stm8l15x_pwr.c: 276: bitstatus = RESET;
|
||||
clr a
|
||||
jra 00109$
|
||||
00108$:
|
||||
; ../inc/stm8l151x/src/stm8l15x_pwr.c: 281: if ((PWR->CSR1 & PWR_FLAG) != (uint8_t)RESET )
|
||||
ld a, 0x50b2
|
||||
and a, (0x01, sp)
|
||||
jreq 00105$
|
||||
; ../inc/stm8l151x/src/stm8l15x_pwr.c: 283: bitstatus = SET;
|
||||
ld a, #0x01
|
||||
; ../inc/stm8l151x/src/stm8l15x_pwr.c: 287: bitstatus = RESET;
|
||||
.byte 0x21
|
||||
00105$:
|
||||
clr a
|
||||
00109$:
|
||||
; ../inc/stm8l151x/src/stm8l15x_pwr.c: 292: return((FlagStatus)bitstatus);
|
||||
; ../inc/stm8l151x/src/stm8l15x_pwr.c: 293: }
|
||||
addw sp, #1
|
||||
ret
|
||||
; ../inc/stm8l151x/src/stm8l15x_pwr.c: 300: void PWR_PVDClearFlag(void)
|
||||
; -----------------------------------------
|
||||
; function PWR_PVDClearFlag
|
||||
; -----------------------------------------
|
||||
_PWR_PVDClearFlag:
|
||||
; ../inc/stm8l151x/src/stm8l15x_pwr.c: 303: PWR->CSR1 |= PWR_CSR1_PVDIF;
|
||||
bset 0x50b2, #5
|
||||
; ../inc/stm8l151x/src/stm8l15x_pwr.c: 304: }
|
||||
ret
|
||||
; ../inc/stm8l151x/src/stm8l15x_pwr.c: 311: ITStatus PWR_PVDGetITStatus(void)
|
||||
; -----------------------------------------
|
||||
; function PWR_PVDGetITStatus
|
||||
; -----------------------------------------
|
||||
_PWR_PVDGetITStatus:
|
||||
push a
|
||||
; ../inc/stm8l151x/src/stm8l15x_pwr.c: 317: PVD_itStatus = (uint8_t)(PWR->CSR1 & (uint8_t)PWR_CSR1_PVDIF);
|
||||
ld a, 0x50b2
|
||||
and a, #0x20
|
||||
ld (0x01, sp), a
|
||||
; ../inc/stm8l151x/src/stm8l15x_pwr.c: 318: PVD_itEnable = (uint8_t)(PWR->CSR1 & (uint8_t)PWR_CSR1_PVDIEN);
|
||||
ld a, 0x50b2
|
||||
and a, #0x10
|
||||
; ../inc/stm8l151x/src/stm8l15x_pwr.c: 320: if ((PVD_itStatus != (uint8_t)RESET ) && (PVD_itEnable != (uint8_t)RESET))
|
||||
tnz (0x01, sp)
|
||||
jreq 00102$
|
||||
tnz a
|
||||
jreq 00102$
|
||||
; ../inc/stm8l151x/src/stm8l15x_pwr.c: 322: bitstatus = (ITStatus)SET;
|
||||
ld a, #0x01
|
||||
; ../inc/stm8l151x/src/stm8l15x_pwr.c: 326: bitstatus = (ITStatus)RESET;
|
||||
.byte 0x21
|
||||
00102$:
|
||||
clr a
|
||||
00103$:
|
||||
; ../inc/stm8l151x/src/stm8l15x_pwr.c: 328: return ((ITStatus)bitstatus);
|
||||
; ../inc/stm8l151x/src/stm8l15x_pwr.c: 329: }
|
||||
addw sp, #1
|
||||
ret
|
||||
; ../inc/stm8l151x/src/stm8l15x_pwr.c: 336: void PWR_PVDClearITPendingBit(void)
|
||||
; -----------------------------------------
|
||||
; function PWR_PVDClearITPendingBit
|
||||
; -----------------------------------------
|
||||
_PWR_PVDClearITPendingBit:
|
||||
; ../inc/stm8l151x/src/stm8l15x_pwr.c: 339: PWR->CSR1 |= PWR_CSR1_PVDIF;
|
||||
bset 0x50b2, #5
|
||||
; ../inc/stm8l151x/src/stm8l15x_pwr.c: 340: }
|
||||
ret
|
||||
.area CODE
|
||||
.area CONST
|
||||
.area INITIALIZER
|
||||
.area CABS (ABS)
|
||||
Reference in New Issue
Block a user