[En-Nut-Discussion] Checking Empty UART Buffer

MarPac marpac at centrum.cz
Thu Mar 10 10:04:44 CET 2005


Hi folks,

I'm still working with UART channels and the application works fine now, but I have to implement a part of code, which checks the input serial buffer to be empty. I have tried the ioctl function with the parameter getstatus, but it didn't work. How it's going with the Buffer? I found, that there is a possibility to set the buffer mode and buffer size. I haven't done it, but there is still some buffer, so maybe, it's set by default.

Some more detail> 

I'm initialising the UART by:

    NutRegisterDevice(&devUart0, 0, 0);

Than setting up the speed:

    _ioctl(_fileno(COM_1), UART_SETSPEED, &BaudMarksmann);

and finaly setting up the cooked mode because of the 0x0a and 0x0d problem:

  _ioctl(_fileno(COM_0), UART_SETCOOKEDMODE, &CookedModeOff);

Excessinng the UART is done by the fgets(), fgetc() and fputc() or fputs() functions.


Thanks a lot for your help, Martin Paces. 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.egnite.de/pipermail/en-nut-discussion/attachments/20050310/be92e978/attachment.html>


More information about the En-Nut-Discussion mailing list