Part Number: LAUNCHXL-F280025C
Hi,
I would like to send a string as blocking mode which is make sure all characters are sent, what I did :
1. make sure no Tx interrupt //SCI_setFIFOInterruptLevel(SCIA_BASE, SCI_FIFO_TX2, SCI_FIFO_RX16);
2. after SCI_writeCharArray, add SCI_isSpaceAvailableNonFIFO to check is all characters are sent.
without TIMEOUT option, I am afraid it may trapped forever, is any other good method to achieve it ?
memset(name, 0x00, 20);
sprintf((char *)name, "TI-SCI-A");
TxCount = sprintf((char *)TxBuffer, "AT+NAME%s\r\n", charDeviceName);
SCI_writeCharArray(SCIA_BASE, (uint16_t*)TxBuffer,TxCount);
while(!SCI_isSpaceAvailableNonFIFO(SCIA_BASE)) {;}
void initSCIAFIFO()
{
// 8 char bits, 1 stop bit, no parity. Baud rate is 9600.
SCI_setConfig(SCIA_BASE, DEVICE_LSPCLK_FREQ, 9600, (SCI_CONFIG_WLEN_8 | SCI_CONFIG_STOP_ONE | SCI_CONFIG_PAR_NONE));
SCI_enableModule(SCIA_BASE);
SCI_resetChannels(SCIA_BASE);
SCI_enableFIFO(SCIA_BASE);
// Interrupts Enabled only RX
SCI_enableInterrupt(SCIA_BASE, SCI_INT_RXFF);
SCI_disableInterrupt(SCIA_BASE, SCI_INT_RXERR);
// disable tx interrupt ?
//SCI_setFIFOInterruptLevel(SCIA_BASE, SCI_FIFO_TX2, SCI_FIFO_RX16);
SCI_setFIFOInterruptLevel(SCIA_BASE, SCI_FIFO_TX16, SCI_FIFO_RX1);
SCI_performSoftwareReset(SCIA_BASE);
SCI_resetTxFIFO(SCIA_BASE);
SCI_resetRxFIFO(SCIA_BASE);
}