Blame | Last modification | View Log | Download | RSS feed
ifndef __stm8sflashinc ; avoid multiple inclusion__stm8sflashinc equ 1savelisting off ; no listing over this file;****************************************************************************;* *;* AS 1.42 - File FLASH.INC *;* *;* contains SFR and Bit Definitions for STM8S Flash Controller *;* *;****************************************************************************__defflash macro BaseFLASH_CR1 label Base+$00 ; Flash control register 1HALT bit FLASH_CR1,3 ; Power-down in Halt modeAHALT bit FLASH_CR1,2 ; Power-down in Active-halt modeIE bit FLASH_CR1,1 ; Flash Interrupt enableFIX bit FLASH_CR1,0 ; Fixed Byte programming timeFLASH_CR2 label Base+$01 ; Flash control register 2OPT bit FLASH_CR2,7 ; Write option bytesWPRG bit FLASH_CR2,6 ; Word programmingERASE bit FLASH_CR2,5 ; Block erasingFPRG bit FLASH_CR2,4 ; Fast block programmingPRG bit FLASH_CR2,0 ; Standard block programmingFLASH_NCR2 label Base+$02 ; Flash complementary control register 2NOPT bit FLASH_NCR2,7 ; Write option bytesNWPRG bit FLASH_NCR2,6 ; Word programmingNERASE bit FLASH_NCR2,5 ; Block eraseNFPRG bit FLASH_NCR2,4 ; Fast block programmingNPRG bit FLASH_NCR2,0 ; Block programmingFLASH_FPR label Base+$03 ; Flash protection registerWPB5 bit FLASH_FPR,5 ; User boot code area protection bitsWPB4 bit FLASH_FPR,4WPB3 bit FLASH_FPR,3WPB2 bit FLASH_FPR,2WPB1 bit FLASH_FPR,1WPB0 bit FLASH_FPR,0FLASH_NFPR label Base+$04 ; Flash complementary protection registerNWPB5 bit FLASH_NFPR,5 ; User boot code area protection bitsNWPB4 bit FLASH_NFPR,4NWPB3 bit FLASH_NFPR,3NWPB2 bit FLASH_NFPR,2NWPB1 bit FLASH_NFPR,1NWPB0 bit FLASH_NFPR,0FLASH_IAPSR label Base+$05 ; Flash in-application programming status registerHVOFF bit FLASH_IAPSR,6 ; End of high voltage flagDUL bit FLASH_IAPSR,3 ; Data EEPROM area unlocked flagEOP bit FLASH_IAPSR,2 ; End of programming (write or erase operation) flagPUL bit FLASH_IAPSR,1 ; Flash Program memory unlocked flagWR_PG_DIS bit FLASH_IAPSR,0 ; Write attempted to protected page flagFLASH_PUKR label Base+$08 ; Flash Program memory unprotection registerPUK bfield FLASH_IAPSR,0,8 ; Main program memory unlock keysFLASH_DUKR label Base+$0a ; Data EEPROM unprotection registerDUK bfield FLASH_DUKR,0,8 ; Data EEPROM write unlock keysendmrestoreendif ; __stm8sflashinc