]> rtime.felk.cvut.cz Git - l4.git/blob - l4/pkg/drivers/uart/include/uart_s3c2410.h
bb17fbbb9309cf7222eceaca98211f395785503f
[l4.git] / l4 / pkg / drivers / uart / include / uart_s3c2410.h
1 /*
2  * (c) 2009 Adam Lackorzynski <adam@os.inf.tu-dresden.de>
3  *     economic rights: Technische Universität Dresden (Germany)
4  *
5  * This file is part of TUD:OS and distributed under the terms of the
6  * GNU General Public License 2.
7  * Please see the COPYING-GPL-2 file for details.
8  */
9 #ifndef L4_DRIVERS_UART_S3C2410_H__
10 #define L4_DRIVERS_UART_S3C2410_H__
11
12 #include "uart_base.h"
13
14 namespace L4
15 {
16   class Uart_s3c2410 : public Uart
17   {
18   private:
19     unsigned long _base;
20
21     inline unsigned long rd(unsigned long reg) const;
22     inline void wr(unsigned long reg, unsigned long val) const;
23
24   public:
25     Uart_s3c2410(int rx_irq, int tx_irq)
26       : Uart(rx_irq, tx_irq), _base(~0UL) {}
27     bool startup(unsigned long base);
28     void shutdown();
29     bool enable_rx_irq(bool enable = true);
30     bool enable_tx_irq(bool enable = true);
31     bool change_mode(Transfer_mode m, Baud_rate r);
32     int get_char(bool blocking = true) const;
33     int char_avail() const;
34     inline void out_char(char c) const;
35     int write(char const *s, unsigned long count) const;
36
37     void auto_flow_control(bool on);
38     void fifo_reset();
39   };
40 };
41
42 #endif