queue.h 3.3 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 que_stErrorLog;
  50. extern FLASH_ERROR_QUEUE que_stFlashErrorLog;
  51. /************************************************************************
  52. Exported Function Call Prototypes (N/A)
  53. ************************************************************************/
  54. extern UBYTE que_ubPushIn(FLASH_ERROR_QUEUE *Q, const 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. *************************************************************************/