feat: add STM32 four-channel weighing firmware
This commit is contained in:
+32
@@ -0,0 +1,32 @@
|
||||
/*************************** (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*******************/
|
||||
Reference in New Issue
Block a user