L4Re Operating System Framework – Interface and Usage Documentation
Loading...
Searching...
No Matches
uart_of.h
1/* SPDX-License-Identifier: GPL-2.0-only OR License-Ref-kk-custom */
2/*
3 * Copyright (C) 2023 Kernkonzept GmbH.
4 */
5/*
6 * (c) 2009 Adam Lackorzynski <adam@os.inf.tu-dresden.de>
7 * economic rights: Technische Universität Dresden (Germany)
8 *
9 * This file is part of TUD:OS and distributed under the terms of the
10 * GNU General Public License 2.
11 * Please see the COPYING-GPL-2 file for details.
12 */
13#pragma once
14
15#include "uart_base.h"
16#include <stdarg.h>
17#include <string.h>
18#include <l4/drivers/of.h>
19
20namespace L4
21{
22 class Uart_of : public Uart, public L4_drivers::Of
23 {
24 private:
25 ihandle_t _serial;
26
27 public:
28 Uart_of() : Of(), _serial(0) {}
29 explicit Uart_of(unsigned /*base_rate*/) : Of(), _serial(0) {}
30 bool startup(Io_register_block const *) override;
31 void shutdown() override;
32 bool change_mode(Transfer_mode m, Baud_rate r) override;
33 int get_char(bool blocking = true) const override;
34 int char_avail() const override;
35 int tx_avail() const;
36 void out_char(char c) const;
37 int write(char const *s, unsigned long count,
38 bool blocking = true) const override;
39 };
40};
L4 low-level kernel interface.
String.