L4Re Operating System Framework
Interface and Usage Documentation
Loading...
Searching...
No Matches
uart_of.h
1/*
2 * Copyright (C) 2009 Technische Universität Dresden.
3 * Copyright (C) 2023-2024 Kernkonzept GmbH.
4 * Author(s): Adam Lackorzynski <adam@os.inf.tu-dresden.de>
5 *
6 * License: see LICENSE.spdx (in this directory or the directories above)
7 */
8#pragma once
9
10#include "uart_base.h"
11#include <stdarg.h>
12#include <string.h>
13#include <l4/drivers/of.h>
14
15namespace L4
16{
17 class Uart_of : public Uart, public L4_drivers::Of
18 {
19 private:
20 ihandle_t _serial;
21
22 public:
23 Uart_of() : Of(), _serial(0) {}
24 explicit Uart_of(unsigned /*base_rate*/) : Of(), _serial(0) {}
25 bool startup(Io_register_block const *) override;
26 void shutdown() override;
27 bool change_mode(Transfer_mode m, Baud_rate r) override;
28 int get_char(bool blocking = true) const override;
29 int char_avail() const override;
30 int tx_avail() const;
31 void out_char(char c) const;
32 int write(char const *s, unsigned long count,
33 bool blocking = true) const override;
34 };
35};
L4 low-level kernel interface.
String.