1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980 |
- /************************************************************************
- Project: Welling Motor Control Paltform
- Filename: QUEUE.h
- Partner Filename: QUEUE.c
- Description: The header file of QUEUE.c
- Complier: IAR Embedded Workbench for ARM 7.80, IAR Systems.
- CPU TYPE : GD32F3x0
- *************************************************************************
- Copyright (c) 2018 Welling Motor Technology(Shanghai) Co. Ltd.
- All rights reserved.
- *************************************************************************
- *************************************************************************
- Revising History (ECL of this file):
- ************************************************************************/
- /************************************************************************
- Beginning of File, do not put anything above here except notes
- Compiler Directives:
- *************************************************************************/
- #ifndef QUEUE_H
- #define QUEUE_H
- #include "typedefine.h"
- #include "canAppl.h"
- /************************************************************************
- Typedefs & Structure Defines (N/A)
- ************************************************************************/
- #define QUEUE_SIZE 16u
- /************************************************************************
- Typedefs & Structures Defines
- ************************************************************************/
- typedef struct
- {
- UWORD ErrorIndex; // 故障序列号,地址偏移 0
- UWORD NotesInfo1; //备注信息1,地址偏移 2
- UWORD NotesInfo2; //备注信息2,地址偏移 4
- UWORD NotesInfo3; //备注信息3,地址偏移 6
- ULONG ErrorCode; //故障码 4 bytes, 地址偏移 8
- ULONG RunTime; //运行时间 4bytes, 地址偏移 12
- MC_RunInfo_Struct_t RunInfo; //运行信息 32bytes, 地址偏移 16
- SWORD IqCurrentPu; // Iq电流,地址偏移 48
- SWORD IqVoltagePu; // Iq电压,地址偏移 50
- SWORD IdCurrentPu; // Id电流,地址偏移 52
- SWORD IdVoltagePu; // Id电压,地址偏移 54
- UBYTE ubHead;
- UBYTE ubRear;
- UWORD RS1; // 预留信息 1,2bytes,地址偏移 56
- UWORD RS2; // 预留信息 1,2bytes,地址偏移 58
- UWORD RS3; // 预留信息 1,2bytes,地址偏移 60
- } ERROR_LOG; //共64字节
- typedef struct
- {
- UBYTE ubHead;
- UBYTE ubRear;
- ERROR_LOG stLog[QUEUE_SIZE];
- } FLASH_ERROR_QUEUE;
- extern ERROR_LOG que_stErrorLog;
- extern FLASH_ERROR_QUEUE que_stFlashErrorLog;
- /************************************************************************
- Exported Function Call Prototypes (N/A)
- ************************************************************************/
- extern UBYTE que_ubPushIn(FLASH_ERROR_QUEUE *Q, const ERROR_LOG *rxdata, UBYTE length);
- extern UBYTE que_ubPopOut(FLASH_ERROR_QUEUE *Q, ERROR_LOG buf[], UBYTE length);
- extern void que_voInit(FLASH_ERROR_QUEUE *Q);
- extern void que_ubIndexIncrease(FLASH_ERROR_QUEUE *Q, UWORD* ErrorIndex);
- #endif
- /*************************************************************************
- Copyright (c) 2011 Welling Motor Technology(Shanghai) Co. Ltd.
- All rights reserved.
- *************************************************************************
- End of this File (EOF):
- Do not put anything after this part!
- *************************************************************************/
|