flash_master.h 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. /************************************************************************
  2. Project: Welling Motor Control Paltform
  3. Filename: flash_master.h
  4. Partner Filename: flash_master.c
  5. Description: The header file of flash_master.c
  6. Complier: IAR Embedded Workbench for ARM 6.50, IAR Systems.
  7. CPU TYPE : STM32F30x
  8. *************************************************************************
  9. Copyright (c) 2014 Welling Motor Technology(Shanghai) Co. Ltd.
  10. All rights reserved.
  11. *************************************************************************
  12. *************************************************************************
  13. Revising History (ECL of this file):
  14. liyue create this file;
  15. ************************************************************************/
  16. /************************************************************************
  17. Beginning of File, do not put anything above here except notes
  18. Compiler Directives
  19. ************************************************************************/
  20. #ifndef FLASH_MASTER_H
  21. #define FLASH_MASTER_H
  22. #include "typedefine.h"
  23. #include "queue.h"
  24. #include "canAppl.h"
  25. #include "AssistCurve.h"
  26. #include "bikeinformation.h"
  27. /************************************************************************
  28. Compiler Directives (N/A)
  29. *************************************************************************/
  30. #ifdef _FLASH_MASTER_C_
  31. #define _FLASH_MASTER_EXT
  32. #else
  33. #define _FLASH_MASTER_EXT extern
  34. #endif
  35. #define FLASH_CRC_TEST
  36. /************************************************************************
  37. Definitions & Macros
  38. *************************************************************************/
  39. #define StartServerManageProtuct_Address ((_ULONG)0x00006000) //生产信息
  40. #define EndServerManageProtuct_Address ((_ULONG)0x000063FF) //生产信息
  41. #define StartServerManageSysPara_Address ((_ULONG)0x00006400) //读写起始地址(系统参数/版本信息/MOS参数,的主存储块地址)
  42. #define EndServerManageSysPara_Address ((_ULONG)0x000067FF)
  43. #define StartServerManageHistory_Address ((_ULONG)0x00006800) //读写起始地址(历史信息的主存储块地址)
  44. #define EndServerManageHistory_Address ((_ULONG)0x00006BFF)
  45. #define StartServerManageError_Address ((_ULONG)0x00006c00) //读写起始地址(故障日志的主存储块地址)
  46. #define EndServerManageError_Address ((_ULONG)0x00006FFF) //读写起始地址(故障日志的主存储块地址)
  47. #define APP_START_Address ((_ULONG)0x00007000) //读写起始地址(故障日志的主存储块地址)
  48. #define FLASH_END ((_ULONG)0x00006FFF)
  49. /************************************************************************
  50. TypeDefs & Structure defines (N/A)
  51. *************************************************************************/
  52. //typedef struct
  53. //{
  54. // UBYTE ubMotorVersion[16];
  55. // UBYTE ubSN[16];
  56. // MC_MacInfo_Struct_t ubProdInfo;
  57. // SLONG slTorqAssGain[15][4];
  58. // SLONG slCadAssGain[5][4];
  59. // MC_RS_ASCII_Struct_t ubRsASSCII;
  60. // UPC_TestParaInfo_Struct_t stTestParaInfo;
  61. //} FLASH_PARA_TYPE;
  62. //extern FLASH_PARA_TYPE flash_stPara;
  63. extern History_PARAMETER stHistoryPara;
  64. extern UWORD uwFlash_IRQ_Enble;
  65. /************************************************************************
  66. Exported Function Call Prototypes
  67. *************************************************************************/
  68. //extern void flash_voVerRead(void);
  69. extern void flash_voSysParaWrite(void);
  70. extern void flash_voSysParaRead(void);
  71. extern void flash_voSysParaInit(void);
  72. void FLASH_voWriteMoreData(ULONG startAddress, UWORD *writeData, UWORD countToWrite, UBYTE Era_enble);
  73. void FLASH_voReadMoreData(ULONG startAddress, UWORD *readData, UWORD countToRead);
  74. void flash_voErrorRead(void);
  75. void flash_voErrorWrite(void);
  76. void flash_voErrorClear(void);
  77. void flash_voProductParaRead(void);
  78. void flash_voProductParaWrite(void);
  79. void flash_HistoryRead(void);
  80. void flash_HistoryWrite(void);
  81. void flash_voMosResParaInit(void);
  82. //void flash_voMosResParaRead(void);
  83. void flash_voMosResParaWrite(void);
  84. /************************************************************************
  85. Flag Define (N/A)
  86. *************************************************************************/
  87. #endif
  88. /************************************************************************
  89. Copyright (c) 2018 Welling Motor Technology(Shanghai) Co. Ltd.
  90. All rights reserved.
  91. *************************************************************************
  92. End of this File (EOF)!
  93. Do not put anything after this part!
  94. *************************************************************************/