Forum Discussion
Altera_Forum
Honored Contributor
20 years agoUART IO
Hi: How could I open/set flags to an Altera UART device for being used in a non-blocking manner, e.g. a call to fgetc() or fread() returns inmediately if no characters are available? Thank...
Altera_Forum
Honored Contributor
20 years agoHi VLorenzo,
> For opening the device I use fopen(). I rarely, if ever, use streams ... so I've never have the need for fdopen() ... but you might give it a try:int fd;
FILE *fs;
fd = open("/dev/uart1", O_RDWR | O_NONBLOCK | O_NOCTTY);
if (fd != -1) fs = dopen(fd, "rw"); And please let us know how/if it works. Regards, --Scott