提交 | 用户 | age
|
bfc108
|
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);
|
|
34 |
|
|
35 |
int InitUartstat(stUartStat * pUartstat,void * pBufRx, int nSizeRx, void * pBufTx, int nSizeTx);
|
|
36 |
int Uart1SendDMA(void * pData, int nSize);
|
|
37 |
int Uart1TriggerSendDMA(void );
|
|
38 |
int Uart2SendDMA(void * pData, int nSize);
|
|
39 |
int Uart2RecvDMA(void * pBuf, int nSize);
|
|
40 |
int Uart2TriggerRecvDMA(void );
|
|
41 |
int Uart2TriggerSendDMA(void );
|
|
42 |
int Uart3SendDMA(void * pData, int nSize);
|
|
43 |
int Uart3RecvDMA(void * pBuf, int nSize);
|
|
44 |
int Uart3TriggerRecvDMA(void );
|
|
45 |
int Uart3TriggerSendDMA(void );
|
a7db3c
|
46 |
void TriggerPendSV(void);
|
Q |
47 |
void PendSvCallBack(void);
|
|
48 |
void SPI1_IRQ_CallBack(void);
|
|
49 |
|
bfc108
|
50 |
void Uart1SendDone(void);
|
Q |
51 |
void Uart1RecvDone(void);
|
|
52 |
void Uart2SendDone(void);
|
|
53 |
void Uart2RecvDone(void);
|
|
54 |
int PutStr(char * str1, int len1);
|
a7db3c
|
55 |
int SendPacket(int nChn, void * pBuf,int len1);
|
Q |
56 |
//int SendPacket1(void * pBuf,int len1);
|
|
57 |
//int SendPacket2(pPacket p1,int len1);
|
bfc108
|
58 |
void ToggleRunLed(void );
|
Q |
59 |
void ToggleErrLed(void );
|
|
60 |
void ToggleOutStat(void );
|
|
61 |
int ReadJumperSW(void );
|
|
62 |
void SetRunLed(uchar bOn);
|
|
63 |
void SetErrLed(uchar bOn);
|
|
64 |
void SetOutStat(uchar bOn);
|
|
65 |
void Enable595(uchar bEnable);
|
|
66 |
unsigned int GetInput(void );
|
|
67 |
void PutOutput(unsigned int nOutValue);
|
|
68 |
inline unsigned int GetTick(void);
|
|
69 |
unsigned short crc_check(const unsigned char * data, unsigned int length);
|
|
70 |
unsigned short crc16bitbybit(const unsigned char *ptr, unsigned int len);
|
|
71 |
uint16_t crc16table(const uint8_t *ptr, uint16_t len);
|
a7db3c
|
72 |
//uint16_t crc16tablefast(const uint8_t *ptr, uint16_t len) ;
|
bfc108
|
73 |
|
Q |
74 |
void EnableDisIn(uchar bEnable);
|
|
75 |
void displayInput(unsigned int cc);
|
a7db3c
|
76 |
void PutOutputSPI1(unsigned int Y);
|
bfc108
|
77 |
|
Q |
78 |
#endif /* __MYFUNCTIONS_H__ */
|