STM8S EEPROM 编程好简单

/ 0评 / 0

从来没想过,竟然如此简单!简直是超快的开发啊.

#include "stm8s.h"
uint8_t val = 0;
void main(void)
{
  FLASH_Unlock(FLASH_MEMTYPE_DATA);
  FLASH_ProgramByte(FLASH_DATA_START_PHYSICAL_ADDRESS,0xAA);
  val = FLASH_ReadByte(FLASH_DATA_START_PHYSICAL_ADDRESS);
  FLASH_ProgramByte(FLASH_DATA_START_PHYSICAL_ADDRESS,0x55);
  val = FLASH_ReadByte(FLASH_DATA_START_PHYSICAL_ADDRESS);
  while (1);
}

 

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注