From 9aed5d7e7b3c7bf09da712e9c272ece401a7acc9 Mon Sep 17 00:00:00 2001 From: QuakeGod <QuakeGod@sina.com> Date: 星期一, 25 十一月 2024 14:51:23 +0800 Subject: [PATCH] add UltraSonic and MultiWireLess --- ComLib/Inc/functions.h | 28 +++++++++++++++++++++++++++- 1 files changed, 27 insertions(+), 1 deletions(-) diff --git a/ComLib/Inc/functions.h b/ComLib/Inc/functions.h index 88a23a8..be64e43 100644 --- a/ComLib/Inc/functions.h +++ b/ComLib/Inc/functions.h @@ -23,6 +23,21 @@ //extern volatile unsigned int TotalRunTime; //extern volatile unsigned int PwrCount; //寮�鏈烘鏁� +extern unsigned char SPI1RecvBuf[64]; +extern unsigned char SPI1SendBuf[64]; + +extern volatile unsigned char bSPI1Recving; +extern volatile unsigned char bSPI1RecvDone; + +extern volatile unsigned char nSPI1RecvPos; +extern volatile unsigned char nSPI1RecvLenInBuf; + +extern volatile unsigned char nSPI1ToSendLen; +extern volatile unsigned char nSPI1SentLen; + +extern volatile unsigned char bSPI1Sending; +extern volatile unsigned char bSPI1SendDone; + typedef unsigned char uint8_t; typedef unsigned char uchar; typedef unsigned short uint16_t; @@ -31,6 +46,7 @@ int InituS(int TickFreq1); unsigned int GetuS(void); +unsigned int GetTick(void); void logData(unsigned char d); int InitUartstat(stUartStat * pUartstat,void * pBufRx, int nSizeRx, void * pBufTx, int nSizeTx); int Uart1SendDMA(void * pData, int nSize); @@ -46,12 +62,15 @@ void TriggerPendSV(void); void PendSvCallBack(void); void SPI1_IRQ_CallBack(void); - +void DelayUs(int nUs); +void Delay100nS(int n100nS); void Uart1SendDone(void); void Uart1RecvDone(void); void Uart2SendDone(void); void Uart2RecvDone(void); int PutStr(char * str1, int len1); +int PutStr1(char * str1, int len1); +int PutStr2(char * str1, int len1); int SendPacket(int nChn, void * pBuf,int len1); //int SendPacket1(void * pBuf,int len1); //int SendPacket2(pKBPacket p1,int len1); @@ -77,4 +96,11 @@ void displayInput(unsigned int cc); void PutOutputSPI1(unsigned int Y); +uint16_t SPI_Flash_ReadID(void); +uint8_t SPI1_Flash_ReadSR(void) ; +void W25QXX_Read(uint8_t* pBuffer,uint32_t ReadAddr,uint16_t NumByteToRead); +void SPI_FLASH_Write_Enable(void) ; +void W25QXX_Erase_Sector(uint32_t Dst_Addr) ; +void W25QXX_Write_Page(uint8_t* pBuffer,uint32_t WriteAddr,uint16_t NumByteToWrite); + #endif /* __MYFUNCTIONS_H__ */ -- Gitblit v1.9.1