标题:
stm32F4芯片eeprom驱动程序
[打印本页]
作者:
JAVADSALAR
时间:
2019-5-15 19:19
标题:
stm32F4芯片eeprom驱动程序
单片机源程序如下:
#include "main.h"
#include "stm32_ub_led.h"
#include "stm32_ub_ee_flash.h"
int main(void)
{
ErrorStatus check;
int32_t ee_wert;
SystemInit(); // Quarz Einstellungen aktivieren
// init der LEDs
UB_Led_Init();
// init vom virtuellen EEProm
check=UB_EE_FLASH_Init();
if(check==SUCCESS) {
// gr黱e LED einschalten
UB_Led_On(LED_GREEN);
// EEprom Adresse 0x00 auslesen
ee_wert=UB_EE_FLASH_Read(0x00);
// test ob Inhalt stimmt
if(ee_wert==0x3AC4) {
// Inhalt ist richtig
UB_Led_On(LED_BLUE);
}
else {
// wenn Inhalt nicht stimmt
UB_Led_On(LED_ORANGE);
// Adresse 0x00 mit Wert 0x3AC4 beschreiben
UB_EE_FLASH_Write(0x00,0x3AC4);
}
}
else {
// Fehler
UB_Led_On(LED_RED);
}
while(1)
{
}
}
复制代码
所有资料51hei提供下载:
ub_stm32f4_ee_flash_v100.zip
(5.77 KB, 下载次数: 16)
2019-5-15 19:19 上传
点击文件名下载附件
下载积分: 黑币 -5
欢迎光临 (http://www.51hei.com/bbs/)
Powered by Discuz! X3.1