How do I close an eTPU UART once it has been opened?
I need to open it at 9600 bps, reconfigure the device to talk at 115200, close the port and reopen at 115200.
I use the following to open the port.
eTPUFDUartOpen(RXD4, TXD4, 9600, 8, FS_ETPU_UART_NO_PARITY, FS_ETPU_PRIORITY_MIDDLE);
RXD4 and TXD4 being the eTPU ports I am using.
I tried calling eTPUCloseChannel(RXD4); to close the port but it fails then when I try to re-open the port with the following:
eTPUFDUartOpen(RXD4, TXD4, 115200, 8, FS_ETPU_UART_NO_PARITY, FS_ETPU_PRIORITY_MIDDLE);
Calling eTPUCloseChannel(TXD4); hangs the software also.
Dave...
Closing an eTPU UART port
Re: Closing an eTPU UART port
In answer to my own post and for others, it seems the closing order is important.
eTPUCloseChannel(TXD4);
eTPUCloseChannel(RXD4);
//
// Open the port with the new baud rate
//
USBfd = eTPUFDUartOpen(RXD4, TXD4, 115200, 8, FS_ETPU_UART_NO_PARITY, FS_ETPU_PRIORITY_MIDDLE);
Trying to close the RXD port first then TXD crashes the software. The above now works.
Dave...
eTPUCloseChannel(TXD4);
eTPUCloseChannel(RXD4);
//
// Open the port with the new baud rate
//
USBfd = eTPUFDUartOpen(RXD4, TXD4, 115200, 8, FS_ETPU_UART_NO_PARITY, FS_ETPU_PRIORITY_MIDDLE);
Trying to close the RXD port first then TXD crashes the software. The above now works.
Dave...