/*====================================================================================================*/ int8_t UART_RecvDataWTO( USART_TypeDef *USARTx, uint8_t *recvData, uint16_t lens, uint32_t timeoutMs ) { int8_t state = ERROR; do { state = UART_RecvByteWTO(USARTx, recvData++, timeoutMs); } while((--lens) && (state != ERROR)); return state; }
/*====================================================================================================*/ uint8_t UART_RecvDataWTO( NRF_UART_Type *UARTx, uint8_t *RecvData, uint16_t DataLen, int32_t Timeout_ms ) { uint8_t State = ERROR; do { State = UART_RecvByteWTO(UARTx, RecvData++, Timeout_ms); } while((--DataLen) && (State != ERROR)); return State; }
/*====================================================================================================*/ int8_t UART_RecvDataWTO( UART_HandleTypeDef *huart, uint8_t *recvData, uint16_t dataLen, uint32_t timeout ) { int8_t state = ERROR; do { state = UART_RecvByteWTO(huart, recvData++, timeout); if(state == ERROR) return ERROR; } while(--dataLen); return state; }
/*====================================================================================================*/ int8_t UART_RecvDataWTO( USART_TypeDef *USARTx, int8_t *RecvData, uint16_t DataLen, int32_t TimeoutMs ) { int8_t State = ERROR; do { State = UART_RecvByteWTO(USARTx, RecvData++, TimeoutMs); if(State == ERROR) return ERROR; } while(--DataLen); return State; }
/*====================================================================================================*/ u8 UART_RecvDataWTO( u8 *RecvData, u16 DataLen, s32 Timeout_ms ) { u8 State = ERROR; do { State = UART_RecvByteWTO(RecvData, Timeout_ms); RecvData++; DataLen--; } while(DataLen && (State != ERROR)); return State; }
/*====================================================================================================*/ int8_t RS232_RecvStrWTO( int8_t *pWord, int32_t TimeoutMs ) { int8_t State = ERROR; do { State = UART_RecvByteWTO(USARTx, pWord++, TimeoutMs); if(State == ERROR) return ERROR; } while(*(pWord-1) != '\0'); *pWord = '\0'; return SUCCESS; }
/*====================================================================================================*/ int8_t Serial_RecvStrWTO( char *pWord, int32_t timeoutMs ) { int8_t state = ERROR; do { state = UART_RecvByteWTO(UARTx, (uint8_t*)pWord++, timeoutMs); if(state == ERROR) return ERROR; } while(*(pWord-1) != '\0'); *pWord = '\0'; return SUCCESS; }
/*====================================================================================================*/ int8_t Serial_RecvStrWTO( char *pString, int32_t timeout ) { int8_t state = ERROR; do { state = UART_RecvByteWTO(USARTx, (uint8_t*)pString++, timeout); if(state == ERROR) return ERROR; } while(*(pString - 1) != '\0'); *pString = '\0'; return SUCCESS; }
/*====================================================================================================*/ uint8_t RS232_RecvByteWTO( uint8_t *RecvData, int32_t Timeout_ms ) { return UART_RecvByteWTO(RecvData, Timeout_ms); }