]> rtime.felk.cvut.cz Git - l4.git/blob - l4/pkg/drivers-frst/uart/include/uart_of.h
update
[l4.git] / l4 / pkg / drivers-frst / uart / include / uart_of.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_CXX_UART_OF_H__
10 #define L4_CXX_UART_OF_H__
11
12 #include "uart_base.h"
13 #include <stdarg.h>
14 #include <string.h>
15 #include <l4/drivers/of.h>
16
17 namespace L4
18 {
19   class Uart_of : public Uart, public L4_drivers::Of
20   {
21   private:
22     ihandle_t  _serial;
23
24   public:
25     Uart_of()
26       : Uart(0, 0), Of(), _serial(0) {}
27     bool startup(unsigned long base);
28
29     void shutdown();
30     bool enable_rx_irq(bool enable = true);
31     bool enable_tx_irq(bool enable = true);
32     bool change_mode(Transfer_mode m, Baud_rate r);
33     int get_char(bool blocking = true) const;
34     int char_avail() const;
35     void out_char(char c) const;
36     int write(char const *s, unsigned long count) const;
37   };
38 };
39
40 #endif