static void putLineUART(const char *send_data)
{
UART_PARAM_T param;
param.buffer = (uint8_t *) send_data;
param.size = strlen(send_data);
/* Interrupt mode, do not append CR/LF to sent data */
param.transfer_mode = TX_MODE_SZERO;
param.driver_mode = DRIVER_MODE_INTERRUPT;
/* Setup the transmit callback, this will get called when the
transfer is complete */
param.callback_func_pt = (UART_CALLBK_T) waitCallback;
/* Transmit the data using interrupt mode, the function will
return */
gotCallback = false;
TxEnable();/* Enable Tx on RS-485 transceiver */
if (LPC_UARTD_API->uart_put_line(uartHandle, ¶m)) {
errorUART();
}
/* Wait until the transmit callback occurs. When it hits, the
transfer is complete. */
sleepUntilCB();
TxDisable();/* Disable Tx on RS-485 transceiver */
} |