queue.h 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. /************************************************************************
  2. Project: Welling Motor Control Paltform
  3. Filename: QUEUE.h
  4. Partner Filename: QUEUE.c
  5. Description: The header file of QUEUE.c
  6. Complier: IAR Embedded Workbench for ARM 7.80, IAR Systems.
  7. CPU TYPE : GD32F3x0
  8. *************************************************************************
  9. Copyright (c) 2018 Welling Motor Technology(Shanghai) Co. Ltd.
  10. All rights reserved.
  11. *************************************************************************
  12. *************************************************************************
  13. Revising History (ECL of this file):
  14. ************************************************************************/
  15. /************************************************************************
  16. Beginning of File, do not put anything above here except notes
  17. Compiler Directives:
  18. *************************************************************************/
  19. #ifndef QUEUE_H
  20. #define QUEUE_H
  21. #include "typedefine.h"
  22. #include "canAppl.h"
  23. /************************************************************************
  24. Typedefs & Structure Defines (N/A)
  25. ************************************************************************/
  26. #define QUEUE_SIZE 16u
  27. /************************************************************************
  28. Typedefs & Structures Defines
  29. ************************************************************************/
  30. typedef struct
  31. {
  32. UWORD NotesInfo1; //备注信息1,地址偏移 0
  33. UWORD NotesInfo2; //备注信息2,地址偏移 2
  34. UWORD NotesInfo3; //备注信息3,地址偏移 4
  35. ULONG ErrorCode; //故障码 4 bytes, 地址偏移 6
  36. ULONG RunTime; //运行时间 4bytes, 地址偏移 10
  37. MC_RunInfo_Struct_t RunInfo; //运行信息 32bytes, 地址偏移 14
  38. SWORD IqCurrentPu; // Iq电流,地址偏移 46
  39. SWORD IqVoltagePu; // Iq电压,地址偏移 48
  40. SWORD IdCurrentPu; // Id电流,地址偏移 50
  41. SWORD IdVoltagePu; // Id电压,地址偏移 52
  42. } ERROR_LOG; //共54字节
  43. typedef struct
  44. {
  45. UBYTE ubHead;
  46. UBYTE ubRear;
  47. ERROR_LOG stLog[QUEUE_SIZE];
  48. } FLASH_ERROR_QUEUE;
  49. extern ERROR_LOG stErrorLog;
  50. extern FLASH_ERROR_QUEUE stFlashErrorLog;
  51. /************************************************************************
  52. Exported Function Call Prototypes (N/A)
  53. ************************************************************************/
  54. extern UBYTE que_ubPushIn(FLASH_ERROR_QUEUE *Q, ERROR_LOG *rxdata, UBYTE length);
  55. extern UBYTE que_ubPopOut(FLASH_ERROR_QUEUE *Q, ERROR_LOG *buf, UBYTE length);
  56. extern void que_voInit(FLASH_ERROR_QUEUE *Q);
  57. #endif
  58. /*************************************************************************
  59. Copyright (c) 2011 Welling Motor Technology(Shanghai) Co. Ltd.
  60. All rights reserved.
  61. *************************************************************************
  62. End of this File (EOF):
  63. Do not put anything after this part!
  64. *************************************************************************/