提交 | 用户 | age
|
483170
|
1 |
/** |
Q |
2 |
****************************************************************************** |
|
3 |
* @file : functions.h |
|
4 |
* @brief : Header for functions.c file. |
|
5 |
* This file contains the user functions defines of the application. |
|
6 |
****************************************************************************** |
|
7 |
*/ |
|
8 |
#ifndef __MYFUNCTIONS_H__ |
|
9 |
#define __MYFUNCTIONS_H__ |
|
10 |
|
|
11 |
|
|
12 |
#include "KBus.h" |
|
13 |
//#include "KLProtocol.h" |
|
14 |
#include "myqueue.h" |
|
15 |
#include "GlobalDef.h" |
|
16 |
extern int TickFreq;//=10000; |
|
17 |
extern int CoreClkMHz; //=SystemCoreClock/1000000; |
|
18 |
extern int TickPriodClk; //=SystemCoreClock/TickFreq; |
|
19 |
extern unsigned int TickPrioduS; // |
|
20 |
extern volatile unsigned int nCurTick; |
|
21 |
extern volatile unsigned int CurTickuS; |
|
22 |
//extern volatile unsigned int ThisRunTime; |
|
23 |
//extern volatile unsigned int TotalRunTime; |
|
24 |
//extern volatile unsigned int PwrCount; //开机次数 |
|
25 |
|
|
26 |
typedef unsigned char uint8_t; |
|
27 |
typedef unsigned char uchar; |
|
28 |
typedef unsigned short uint16_t; |
|
29 |
//typedef unsigned long uint32_t; |
|
30 |
typedef int int32_t; |
|
31 |
|
|
32 |
int InituS(int TickFreq1); |
|
33 |
unsigned int GetuS(void); |
eaf5d5
|
34 |
unsigned int GetTick(void); |
483170
|
35 |
void logData(unsigned char d); |
Q |
36 |
int InitUartstat(stUartStat * pUartstat,void * pBufRx, int nSizeRx, void * pBufTx, int nSizeTx); |
|
37 |
int Uart1SendDMA(void * pData, int nSize); |
|
38 |
int Uart1TriggerSendDMA(void ); |
|
39 |
int Uart2SendDMA(void * pData, int nSize); |
|
40 |
int Uart2RecvDMA(void * pBuf, int nSize); |
|
41 |
int Uart2TriggerRecvDMA(void ); |
|
42 |
int Uart2TriggerSendDMA(void ); |
|
43 |
int Uart3SendDMA(void * pData, int nSize); |
|
44 |
int Uart3RecvDMA(void * pBuf, int nSize); |
|
45 |
int Uart3TriggerRecvDMA(void ); |
|
46 |
int Uart3TriggerSendDMA(void ); |
|
47 |
void TriggerPendSV(void); |
|
48 |
void PendSvCallBack(void); |
|
49 |
void SPI1_IRQ_CallBack(void); |
|
50 |
|
|
51 |
void Uart1SendDone(void); |
|
52 |
void Uart1RecvDone(void); |
|
53 |
void Uart2SendDone(void); |
|
54 |
void Uart2RecvDone(void); |
|
55 |
int PutStr(char * str1, int len1); |
|
56 |
int SendPacket(int nChn, void * pBuf,int len1); |
|
57 |
//int SendPacket1(void * pBuf,int len1); |
|
58 |
//int SendPacket2(pKBPacket p1,int len1); |
|
59 |
void ToggleRunLed(void ); |
|
60 |
void ToggleErrLed(void ); |
|
61 |
void ToggleErr2Led(void ); |
|
62 |
void ToggleOutStat(void ); |
|
63 |
int ReadJumperSW(void ); |
|
64 |
void SetRunLed(uchar bOn); |
|
65 |
void SetErrLed(uchar bOn); |
|
66 |
void SetErr2Led(uchar bOn); |
|
67 |
void SetOutStat(uchar bOn); |
|
68 |
void Enable595(uchar bEnable); |
|
69 |
unsigned int GetInput(void ); |
|
70 |
void PutOutput(unsigned int nOutValue); |
|
71 |
inline unsigned int GetTick(void); |
|
72 |
unsigned short crc_check(const unsigned char * data, unsigned int length); |
|
73 |
unsigned short crc16bitbybit(const unsigned char *ptr, unsigned int len); |
|
74 |
uint16_t crc16table(const uint8_t *ptr, uint16_t len); |
|
75 |
//uint16_t crc16tablefast(const uint8_t *ptr, uint16_t len) ; |
|
76 |
|
|
77 |
void EnableDisIn(uchar bEnable); |
|
78 |
void displayInput(unsigned int cc); |
|
79 |
void PutOutputSPI1(unsigned int Y); |
|
80 |
|
|
81 |
#endif /* __MYFUNCTIONS_H__ */ |