CH57x_flash.h 796 B

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