/* Transmit a byte array through the UART peripheral (non-blocking) */ int Chip_UART_Send(LPC_USART_T *pUART, const void *data, int numBytes) { int sent = 0; uint8_t *p8 = (uint8_t *) data; /* Send until the transmit FIFO is full or out of bytes */ while ((sent < numBytes) && ((Chip_UART_ReadLineStatus(pUART) & UART_LSR_THRE) != 0)) { Chip_UART_SendByte(pUART, *p8); p8++; sent++; } return sent; } |
Post was moved from LPCWare forum to here: https://community.nxp.com/message/873683