开始123 发表于 2014-2-26 13:44:24

stm8f103 flash怎么进行读写呢 求助啊

stm8f103 flash怎么进行读写呢 求助啊

fengye5340 发表于 2014-2-26 14:54:22

RE:stm8f103 flash怎么进行读写呢 求助啊

void Flash_Init(void)
{
        FLASH_CR1 = 0x00;
        FLASH_CR2 = 0x00;
        FLASH_NCR2 = 0xFF;
        FLASH_IAPSR &= ~0x08;
        FLASH_IAPSR &= ~0x01;
          
}
void Flash_Unlock(void)
{
        FLASH_PUKR = 0x56;
        FLASH_PUKR = 0xAE;
}
void Flash_Writebyte(u32 Address,u8 data)
{
    *(char __far *)Address = data;
}
void Flash_Lock(void)
{
        FLASH_IAPSR |= 0x01;
}
u8 Flash_Readbyte(u32 Address)
{
return (*(char__far *)Address);
       
几个函数,参考一下

}
页: [1]
查看完整版本: stm8f103 flash怎么进行读写呢 求助啊