第一次提交
This commit is contained in:
85
user.H
Normal file
85
user.H
Normal file
@@ -0,0 +1,85 @@
|
||||
#ifndef _user_H_
|
||||
#define _user_H_
|
||||
|
||||
#define DF_SwTx 6
|
||||
#define DF_SwRx 7
|
||||
#define DF_SwRxPwm 8
|
||||
#define DF_SwTxInit 10
|
||||
|
||||
|
||||
#define dfCmd_01 UnInfCan_1.BitData.D21 //KGF1
|
||||
#define dfCmd_02 UnInfCan_1.BitData.D22 //KGF2
|
||||
#define dfCmd_03 UnInfCan_1.BitData.D23 //KGF3
|
||||
#define dfCmd_04 UnInfCan_1.BitData.D24 //KGF4
|
||||
#define dfCmd_05 UnInfCan_1.BitData.D25 //KGF5
|
||||
#define dfCmd_06 UnInfCan_1.BitData.D26 //KGF6
|
||||
#define dfCmd_07 UnInfCan_1.BitData.D27 //KGF7
|
||||
#define dfCmd_08 UnInfCan_1.BitData.D28 //KGF8
|
||||
#define dfCmd_09 UnInfCan_1.BitData.D29 //KGF9
|
||||
#define dfCmd_10 UnInfCan_1.BitData.D30 //KGF10
|
||||
#define dfCmd_11 UnInfCan_1.BitData.D31 //KGF11
|
||||
#define dfCmd_12 UnInfCan_1.BitData.D32 //KGF12
|
||||
#define dfCmd_13 UnInfCan_1.BitData.D33 //KGF13
|
||||
#define dfCmd_14 UnInfCan_1.BitData.D34 //KGF14
|
||||
#define dfCmd_15 UnInfCan_1.BitData.D35 //KGF15
|
||||
#define dfCmd_16 UnInfCan_1.BitData.D36 //KGF16
|
||||
|
||||
#define dfOut_01 SwOut09 //KGF1
|
||||
#define dfOut_02 SwOut10 //KGF2
|
||||
#define dfOut_03 SwOut04 //KGF3
|
||||
#define dfOut_04 SwOut03 //KGF4
|
||||
#define dfOut_05 SwOut06 //KGF5
|
||||
#define dfOut_06 SwOut05 //KGF6
|
||||
#define dfOut_07 SwOut15 //KGF7
|
||||
#define dfOut_08 SwOut16 //KGF8
|
||||
#define dfOut_09 SwOut13 //KGF9
|
||||
#define dfOut_10 SwOut14 //KGF10
|
||||
#define dfOut_11 SwOut08 //KGF11
|
||||
#define dfOut_12 SwOut07 //KGF12
|
||||
#define dfOut_13 SwOut02 //KGF13
|
||||
#define dfOut_14 SwOut01 //KGF14
|
||||
#define dfOut_15 SwOut11 //KGF15
|
||||
#define dfOut_16 SwOut12 //KGF16
|
||||
|
||||
#define dfPwmH 10 //PWM<57>ĸߵ<C4B8>ƽʱ<C6BD>䣬10<31><30>10ms<6D><73><EFBFBD>ң<EFBFBD><D2A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><D2AA><EFBFBD><EFBFBD>20181227
|
||||
|
||||
|
||||
#define OVRE_CURRENT_MAX 520//
|
||||
|
||||
// <20><><EFBFBD>巽<EFBFBD><E5B7BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ö<EFBFBD><C3B6>
|
||||
typedef enum {
|
||||
DIR_STOP = 0, // ֹͣ
|
||||
DIR_FORWARD = 1, // <20><>ת
|
||||
DIR_REVERSE = 2 // <20><>ת
|
||||
} MotorDirection;
|
||||
|
||||
// <20><><EFBFBD><EFBFBD>״̬ö<CCAC><C3B6>
|
||||
typedef enum {
|
||||
MOTOR_STOPPED = 0, // ֹͣ״̬
|
||||
MOTOR_FORWARD = 1, // <20><>ת״̬
|
||||
MOTOR_REVERSE = 2, // <20><>ת״̬
|
||||
MOTOR_FAULT = 3 // <20><><EFBFBD><EFBFBD>״̬<D7B4><CCAC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
} MotorState;
|
||||
|
||||
|
||||
//---<2D>ⲿҪʹ<D2AA>ñ<EFBFBD><C3B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>---------------------------------------------------------------------
|
||||
extern UnSwOut UnSwOut_1;
|
||||
extern UnInfCan UnInfCan_1;
|
||||
extern uword CntCan_1;
|
||||
extern bit FlgCan_1;
|
||||
extern ubyte RestartDataFlg1;
|
||||
extern ubyte RestartDataFlg2;
|
||||
extern uword RestartDataKGF;
|
||||
extern ubyte can_error_cnt;
|
||||
|
||||
|
||||
void CanRXTX(void);
|
||||
void SwSample(void);
|
||||
void LedDr(void);
|
||||
void RTCProcess(void);
|
||||
void CanErrorProcess(void);
|
||||
void CanTransmit(void);
|
||||
void InitCanTransmit(ubyte InitCanTransmit1,ubyte InitCanTransmit2);
|
||||
void CAN_sendAck(ubyte Ack0,ubyte Ack1);
|
||||
void CanTX(void);
|
||||
#endif
|
||||
Reference in New Issue
Block a user