Files
GarbageCanCenter_Woer_stm/STM32_4路称重_Git提交精简工程/src/HARDWARE/STMFLASH/stmflash.h
T

33 lines
1.4 KiB
C
Executable File
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/*************************** (C) COPYRIGHT 2017 CXHY ****************************
* 文件名 stmflash.c
* 描 述 STM32-FLASH操作函数
* 版 本 V1.0
* 作 者 XuZhongPing
* 日 期 2017/07/23
*********************************************************************************/
#ifndef __STMFLASH_H__
#define __STMFLASH_H__
#include "stm32f10x.h"
#define STM32_FLASH_SIZE 512 //所选STM32的FLASH容量大小(单位为K)
#define STM32_FLASH_WREN 1 //使能FLASH写入(0,不是能;1,使能)
//FLASH地址
#define STM32_FLASH_BASE 0x08000000 //STM32 FLASH的起始地址
#define FLASH_SAVE_ADDR 0X0807F800 //设置FLASH 保存地址(必须为偶数)
uint16_t STMFLASH_ReadHalfWord(uint32_t faddr); //读出半字
uint32_t STMFLASH_ReadLenByte(uint32_t ReadAddr, uint16_t Len); //指定地址开始读取指定长度数据
void STMFLASH_Write(uint32_t WriteAddr, uint16_t *pBuffer, uint16_t NumToWrite); //从指定地址开始写入指定长度的数据
void STMFLASH_Read(uint32_t ReadAddr, uint16_t *pBuffer, uint16_t NumToRead); //从指定地址开始读出指定长度的数据
void STMFLASH_WriteHalfWord(uint32_t WriteAddr, uint16_t WriteData); //从指定地址开写入一个半字(16位)
void SaveDeviceConfig(void);
uint8_t GetDeviceConfig(void);
void ResetDeviceConfig(void);
#endif
/******************** (C) COPYRIGHT 2017 CXHY *****END OF FILE*******************/