/*
 * fml_flash.h
 *
 *  Created on: 2025年4月9日
 *      Author: 22332
 */

#ifndef FML_FLASH_H_
#define FML_FLASH_H_
typedef struct VENDOR_DATA//新增结构体内容时，时刻关注字节对齐问题以及写flash大小必须为8的倍数
{
	uint32_t crc32;
    uint8_t mcu_upgrade_flag;		///< MCU的升级标志
    uint8_t screen_brightness;		///< 屏幕亮度

    uint8_t PN_VERSION0;
    uint8_t PN_VERSION1;
    uint8_t PN_VERSION2;
    uint8_t PN_VERSION3;
    uint8_t PN_VERSION4;
    uint8_t PN_VERSION5;
    uint8_t HARDWARE_VERSION0;
    uint8_t HARDWARE_VERSION1;
    uint8_t HARDWARE_VERSION2;
    uint8_t HARDWARE_VERSION3;
    uint8_t HARDWARE_VERSION4;
    uint8_t HARDWARE_VERSION5;
    uint8_t SOFTWARE_VERSION0;
    uint8_t SOFTWARE_VERSION1;
    uint8_t SOFTWARE_VERSION2;
    uint8_t SOFTWARE_VERSION3;
    uint8_t SOFTWARE_VERSION4;
    uint8_t SOFTWARE_VERSION5;
}ST_VENDOR_DATA;
extern void vendor_data_save(void);
extern void vendor_data_load(void);
extern void vendor_factory_set(void);

extern void fml_flash_init(void);
extern void fml_flash_write(uint32_t address, uint8_t *buf);
extern void fml_flash_read(uint32_t address, uint8_t *buf,uint8_t length);


#endif /* FML_FLASH_H_ */
