1 
2 
3 
4 #ifndef __CH57x_FLASH_H__
5 #define __CH57x_FLASH_H__
6 
7 #ifdef __cplusplus
8  extern "C" {
9 #endif
10 
11 #include "CH579SFR.h"
12 #include "core_cm0.h"
13 
14 #define ROM_UUID_ADDR        0x40608         // chip UID address ( ID-48bit + CKS-16bit )
15 #define ROM_MAC_ADDR         0x40608         // NET MAC address 48bit
16 
17 // 获取唯一ID
18 void GetUniqueID(PUINT8 buf);                                           /* 获取芯片唯一ID,小端模式,6B-ID, 2B-CKS */
19 
20 // 获取网络MAC
21 void GetMACAddress(PUINT8 buf);                                         /* 获取网络MAC,小端模式,6B-MAC */
22 
23 
24 UINT8 FlashBlockErase(UINT32 addr);
25 UINT8 FlashWriteDW(UINT32 addr, UINT32 dat);
26 UINT8 FlashWriteBuf(UINT32 addr, PUINT32 pdat, UINT16 len);
27 
28 
29 
30 #ifdef __cplusplus
31 }
32 #endif
33 
34 #endif  // __CH57x_FLASH_H__
35 
36