Forum Discussion
Altera_Forum
Honored Contributor
14 years agoFor a specific board/product (etc) you don't need the generalisations assumed by the POSIX file access functions. It is almost certainly enough to have a 'write buffer (or string) to UART' function.
You then need to decide where to buffer data (software or fifo buffer). This rather depends on how much data you might need to buffer - eventually the code will have to spin/sleep or discard anyway. A hardware fifo might be easiest - if you can afford a full memory block. I'd also consider whether you need to use interrupts. It may well be possible to add a check of the uart registers to the main schedule/process loop. Not using interrupts will probably generate smaller and faster code.