標(biāo)題:
stm32F4芯片eeprom驅(qū)動(dòng)程序
[打印本頁(yè)]
作者:
JAVADSALAR
時(shí)間:
2019-5-15 19:19
標(biāo)題:
stm32F4芯片eeprom驅(qū)動(dòng)程序
單片機(jī)源程序如下:
#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)
{
}
}
復(fù)制代碼
所有資料51hei提供下載:
ub_stm32f4_ee_flash_v100.zip
(5.77 KB, 下載次數(shù): 16)
2019-5-15 19:19 上傳
點(diǎn)擊文件名下載附件
下載積分: 黑幣 -5
歡迎光臨 (http://www.torrancerestoration.com/bbs/)
Powered by Discuz! X3.1