Blame | Last modification | View Log | Download | RSS feed
ifndef __stm8lclkinc ; avoid multiple inclusion__stm8lclkinc equ 1savelisting off ; no listing over this file;****************************************************************************;* *;* AS 1.42 - File CLK.INC *;* *;* contains SFR and Bit Definitions for STM8L CLK Controller *;* *;****************************************************************************__defclk macro BaseCLK_CKDIVR label Base+$00 ; Clock master divider registerCKM bfield CLK_CKDIVR,0,3 ; System clock prescalerCLK_CRTCR label Base+$01 ; Clock RTC registerRTCDIV bfield CLK_CRTCR,5,3 ; Clock RTC prescalerRTCSEL bfield CLK_CRTCR,1,4 ; Configurable RTC clock source selectionRTCSWBSY bit CLK_CRTCR,0 ; The system is busy during a RTC clock changeCLK_ICKR label Base+$02 ; Internal clock control registerBEEPAHALT bit CLK_ICKR,6 ; BEEP clock Halt/Active-halt modeFHWU bit CLK_ICKR,5 ; Fast wakeup from Halt/Active-halt modesSAHALT bit CLK_ICKR,4 ; Slow HALT/Active-halt modeLSIRDY bit CLK_ICKR,3 ; Low speed internal oscillator readyLSION bit CLK_ICKR,2 ; Low speed internal RC oscillator enableHSIRDY bit CLK_ICKR,1 ; High speed internal oscillator readyHSION bit CLK_ICKR,0 ; High speed internal RC oscillator enableCLK_PCKENR1 label Base+$03 ; Peripheral clock gating register 1PCKEN bfield CLK_PCKENR1,0,8 ; Peripheral clock enableCLK_PCKENR2 label Base+$04 ; Peripheral clock gating register 2PCKEN2 bfield CLK_PCKENR2,0,6 ; Peripheral clock enablePCKEN27 bit CLK_PCKENR2,7 ; Peripheral clock enableCLK_CCOR label Base+$05 ; Configurable clock control registerCCODIV bfield CLK_CCOR,5,3 ; Configurable clock output prescalerCCOSEL bfield CLK_CCOR,1,4 ; Configurable clock output selectionCCOSWBSY bit CLK_CCOR,0 ; Configurable clock output switch busyCLK_ECKCR label Base+$06 ; External clock registerLSEBYP bit CLK_ECKR,5 ; Low speed external clock bypassHSEBYP bit CLK_ECKR,4 ; High-speed external clock bypassLSERDY bit CLK_ECKR,3 ; Low speed external crystal oscillator readyLSEON bit CLK_ECKR,2 ; Low speed external crystal oscillator enableHSERDY bit CLK_ECKR,1 ; High speed external crystal oscillator readyHSEON bit CLK_ECKR,0 ; High speed external crystal oscillator enableCLK_SCSR labrl Base+$07 ; System clock status registerCKM bfield CLK_SCSR,0,8 ; System clock status bitsCLK_SWR label Base+$08 ; Clock master switch registerSWI bfield CLK_SWR,0,8 ; Clock master selection bitsCLK_SWCR label Base+$09 ; Clock switch control registerSWIF bit CLK_SWCR,3 ; Clock switch interrupt flagSWIEN bit CLK_SWCR,2 ; Clock switch interrupt enableSWEN bit CLK_SWCR,1 ; Switch start/stopSWBSY bit CLK_SWCR,0 ; Switch busyCLK_CSSR label Base+$0a ; Clock security system registerCSSDGON bit CLK_CSSR,4 ; CSS deglitcher systemCSSD bit CLK_CSSR,3 ; Clock security system detectionCSSDIE bit CLK_CSSR,2 ; Clock security system detection interrupt enableAUX bit CLK_CSSR,1 ; Auxiliary oscillator connected to master clockCSSEN bit CLK_CSSR,0 ; Clock security system enableCLK_CBEEPR label Base+$0b ; Clock BEEP registerCLKBEEPSEL bfield CLK_CBEEPR,1,2 ; Configurable BEEP clock source selectionBEEPSWBSY bit CLK_CBEEPR,0 ; System busy during BEEP clock changeCLK_HSICALR label Base+$0c ; HSI calibration registerHSICAL bfield CLK_HSICALR,0,8 ; HSI calibrationCLK_HSITRIMR label Base+$0d ; HSI clock calibration trimming registerHSITRIM bfield CLK_HSITRIMR,0,8; HSI trimming valueCLK_HSIUNLCKR label Base+$0e ; HSI unlock registerHSIUNLCK bfield CLK_HSIUNLCKR,0,8; HSI unlock mechanismCLK_REGCSR label Base+$0f ; Main regulator control status registerEEREADY bit CLK_REGCSR,7 ; Flash program memory and Data EEPROM readyEEBUSY bit CLK_REGCSR,6 ; Flash program memory and Data EEPROM busyLSEPD bit CLK_REGCSR,5 ; LSE power-downHSEPD bit CLK_REGCSR,4 ; HSE power-downLSIPD bit CLK_REGCSR,3 ; LSI power-downHSIPD bit CLK_REGCSR,2 ; HSI power-downREGOFF bit CLK_REGCSR,1 ; Main regulator OFFREGREADY bit CLK_REGCSR,0 ; Main regulator readyCLK_PCKENR3 label Base+$10 ; Peripheral clock gating register 3PCKEN3 bfield CLK_PCKENR3,0,6 ; Peripheral clock enableendmrestoreendif ; __stm8lclkinc