本文共 985 字,大约阅读时间需要 3 分钟。
Uart_SeriaInit(); //串口接收初始化 SeriaReciveIRQ(&Uart3_Seriadef); //在串口中断中接收数据/*************************************************** 功能:串口的DMA接收函数***************************************************/void recWIFI(void){ if(Uart3_Seriadef.ReciveSta ) //DMA接收完成标志位 { Uart3_Seriadef.ReciveSta = 0 ; //清空接收标志位 } }/*********************************** 功能:发送一个字节的数据*************************************/void sendByte(uint8_t s){ uint8_t send[1] = { 0} ; send[0] = s; HAL_UART_Transmit(&huart3,send,1,1000) ;}/**********************************功能:发送字符串*************************************/void sendDtring(char * c){ while(*c) { sendByte(*c++) ; }}/*********************************** 功能:发送数字,固定位数*************************************/void sendFigre(uint16_t F , uint8_t B){ if(B>=5) sendByte('0'+F/10000%10) ; if(B>=4) sendByte('0'+F/1000%10) ; if(B>=3) sendByte('0'+F/100%10) ; if(B>=2) sendByte('0'+F/10%10) ; sendByte('0'+F/1%10) ;}
转载地址:http://cbrq.baihongyu.com/