1 #include "uart_omap35x.h"
17 LCD_REG_CHAR_LENGTH_5BIT = 0 << 0,
18 LCD_REG_CHAR_LENGTH_6BIT = 1 << 0,
19 LCD_REG_CHAR_LENGTH_7BIT = 2 << 0,
20 LCD_REG_CHAR_LENGTH_8BIT = 3 << 0,
21 LCD_REG_CHAR_NB_STOP_2 = 1 << 2,
22 LCD_REG_CHAR_PARITY_EN = 1 << 3,
23 LCD_REG_CHAR_PARITY_TYPE1_EVEN = 1 << 4,
25 LSR_REG_RX_FIFO_E_AVAIL = 1 << 0,
26 LSR_REG_TX_FIFO_E_EMPTY = 1 << 5,
28 SSR_REG_TX_FIFO_FULL = 1 << 0,
30 SYSC_REG_SOFTRESET = 1 << 1,
32 SYSC_REG_RESETDONE = 1 << 0,
36 unsigned long Uart_omap35x::rd(unsigned long reg) const
38 volatile unsigned long *r = (unsigned long*)(_base + reg);
42 void Uart_omap35x::wr(unsigned long reg, unsigned long val) const
44 volatile unsigned long *r = (unsigned long*)(_base + reg);
48 bool Uart_omap35x::startup(unsigned long base)
53 //wr(SYSC_REG, rd(SYSC_REG) | SYSC_REG_SOFTRESET);
54 //while (!(rd(SYSS_REG) & SYSC_REG_RESETDONE))
60 void Uart_omap35x::shutdown()
64 bool Uart_omap35x::enable_rx_irq(bool enable)
66 wr(IER_REG, enable ? 1 : 0);
69 bool Uart_omap35x::enable_tx_irq(bool /*enable*/) { return false; }
70 bool Uart_omap35x::change_mode(Transfer_mode, Baud_rate r)
78 int Uart_omap35x::get_char(bool blocking) const
87 int Uart_omap35x::char_avail() const
89 return rd(LSR_REG) & LSR_REG_RX_FIFO_E_AVAIL;
92 void Uart_omap35x::out_char(char c) const
95 while (!(rd(LSR_REG) & LSR_REG_TX_FIFO_E_EMPTY))
99 int Uart_omap35x::write(char const *s, unsigned long count) const
101 unsigned long c = count;