| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485 |
- #ifndef _ACCESS_MODULE_H_
- #define _ACCESS_MODULE_H_
- #define MCU_ACCESS_MODULE_ID (0)
- #define CPU_ACCESS_MODULE_ID (1)
- #define MCU_ACCESS_MODULE_SUPPORT
- #define CPU_ACCESS_MODULE_SUPPORT
- #ifdef MCU_ACCESS_MODULE_SUPPORT
- #if MCU_DEVICE_TYPE_SELECT == DEVICE_TYPE_SELECT
- #define ACCESS_FLASH_SUPPORT
- #endif
- #define ACCESS_CRC_SUPPORT
- #endif
- #ifdef CPU_ACCESS_MODULE_SUPPORT
- #define ACCESS_RTC_SUPPORT
- #endif
- #ifdef ACCESS_FLASH_SUPPORT
- typedef enum {
- AFT_READ,
- AFT_WRITE,
- AFT_ERASE,
- } AccessFlashType;
- typedef struct {
- u32 mem_addr;
- u32 mem_size;
- u32 flash_addr;
- u32 access_type;
- } AccessFlashMsg;
- #endif
- #ifdef ACCESS_CRC_SUPPORT
- typedef struct {
- u32 mem_addr;
- u32 mem_size;
- u32 init;
- u32 widthopt;
- } AccessCrcMsg;
- #endif
- #ifdef ACCESS_RTC_SUPPORT
- typedef enum {
- ART_SET_TIME,
- ART_GET_TIME,
- } AccessRtcType;
- typedef struct {
- u32 rtc_cnt_h;
- u32 reserved;
- u32 access_type;
- } AccessRtcMsg;
- #endif
- typedef enum {
- AMT_STATUS,
- AMT_FLASH,
- AMT_CRC,
- AMT_RTC = 16,
- } AccessModuleType;
- typedef enum {
- AMRMS_NO_ERROR,
- AMRMS_LEN_ERROR, // header msg length error
- AMRMS_TYPE_ERROR, // header msg module type error
- AMRMS_PARA_ERROR, // function msg parameter error
- } AccessModuleRespondMsgStatus;
- typedef struct {
- u8 dest_core_id;
- u8 type;
- u8 len;
- u8 msg_status;
- u32 result;
- } AccessModuleHeader;
- #ifdef MCU_ACCESS_MODULE_SUPPORT
- void McuAccessModule(void);
- #endif
- #ifdef ACCESS_RTC_SUPPORT
- int AccessRTC(AccessRtcType type, uint32_t *time);
- #endif
- #endif
|