12 void apbuart_outbyte_polled(
20 while ( (regs->status & APBUART_STATUS_TE) == 0 ) {
22 __asm__
volatile (
"nop"::); __asm__
volatile (
"nop"::);
23 __asm__
volatile (
"nop"::); __asm__
volatile (
"nop"::);
24 __asm__
volatile (
"nop"::); __asm__
volatile (
"nop"::);
25 __asm__
volatile (
"nop"::); __asm__
volatile (
"nop"::);
28 if ((ch ==
'\n') && do_cr_on_newline) {
29 regs->data = (
unsigned int)
'\r';
33 regs->data = (
unsigned int) ch;
37 while ((regs->status & APBUART_STATUS_TE) == 0)
42 int apbuart_inbyte_nonblocking(
struct apbuart_regs *regs)
45 if (regs->status & APBUART_STATUS_ERR)
46 regs->status = ~APBUART_STATUS_ERR;
48 if ((regs->status & APBUART_STATUS_DR) == 0)
51 return (
int) regs->data;