You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
575 B
18 lines
575 B
|
3 days ago
|
#ifndef FLASH_OPERATION_H
|
||
|
|
#define FLASH_OPERATION_H
|
||
|
|
|
||
|
|
#include "stm32g4xx_hal.h"
|
||
|
|
|
||
|
|
/* 定义Flash存储地址 - 使用最后一页 */
|
||
|
|
#define FLASH_BASE_ADDRESS 0x08000000
|
||
|
|
//#define FLASH_SIZE (128 * 1024) // 128KB
|
||
|
|
//#define FLASH_PAGE_SIZE 0x800 // 2KB per page
|
||
|
|
#define DATA_FLASH_ADDRESS (FLASH_BASE_ADDRESS + FLASH_SIZE - FLASH_PAGE_SIZE) // 最后一页
|
||
|
|
#define PARAM_COUNT 12
|
||
|
|
|
||
|
|
/* 函数声明 */
|
||
|
|
HAL_StatusTypeDef WriteParametersToFlash(int16_t* parameters);
|
||
|
|
void ReadParametersFromFlash(int16_t* parameters);
|
||
|
|
|
||
|
|
#endif
|