1 #ifndef L4_DRIVERS_UART_S3C2410_H__
2 #define L4_DRIVERS_UART_S3C2410_H__
8 class Uart_s3c : public Uart
13 Type_24xx, Type_64xx, Type_s5pv210,
16 Uart_type type() const { return _type; }
19 explicit Uart_s3c(Uart_type type) : _type(type) {}
20 bool startup(Io_register_block const *);
22 bool change_mode(Transfer_mode m, Baud_rate r);
23 int get_char(bool blocking = true) const;
24 int char_avail() const;
25 inline void out_char(char c) const;
26 int write(char const *s, unsigned long count) const;
30 virtual void ack_rx_irq() const = 0;
31 virtual void wait_for_empty_tx_fifo() const = 0;
32 virtual void wait_for_non_full_tx_fifo() const = 0;
33 virtual unsigned is_rx_fifo_non_empty() const = 0;
39 class Uart_s3c2410 : public Uart_s3c
42 Uart_s3c2410() : Uart_s3c(Type_24xx) {}
45 void ack_rx_irq() const {}
46 void wait_for_empty_tx_fifo() const;
47 void wait_for_non_full_tx_fifo() const;
48 unsigned is_rx_fifo_non_empty() const;
50 void auto_flow_control(bool on);
53 class Uart_s3c64xx : public Uart_s3c
56 Uart_s3c64xx() : Uart_s3c(Type_64xx) {}
59 void ack_rx_irq() const;
60 void wait_for_empty_tx_fifo() const;
61 void wait_for_non_full_tx_fifo() const;
62 unsigned is_rx_fifo_non_empty() const;
65 class Uart_s5pv210 : public Uart_s3c
68 Uart_s5pv210() : Uart_s3c(Type_s5pv210) {}
83 void save(Save_block *) const;
84 void restore(Save_block const *) const;
87 void ack_rx_irq() const;
88 void wait_for_empty_tx_fifo() const;
89 void wait_for_non_full_tx_fifo() const;
90 unsigned is_rx_fifo_non_empty() const;