L4Re Operating System Framework
Interface and Usage Documentation
Loading...
Searching...
No Matches
uart_dummy.h
1/*
2 * Copyright 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
12namespace L4 {
13
14class Uart_dummy : public Uart
15{
16public:
17 explicit Uart_dummy() {}
18 explicit Uart_dummy(unsigned /*base_rate*/) {}
19 bool startup(Io_register_block const *) override { return true; }
20 void shutdown() override {}
21 bool change_mode(Transfer_mode, Baud_rate) override { return true; }
22 inline void out_char(char /*ch*/) const {}
23 int write(char const * /*str*/, unsigned long /*count*/,
24 bool /*blocking*/ = true) const override
25 { return 0; }
26
27 int char_avail() const override { return false; }
28 int get_char(bool /*blocking*/ = true) const override { return 0; }
29};
30
31} // namespace L4
Uart driver abstraction.
Definition uart_base.h:21
virtual void shutdown()=0
Terminate the UART driver.
virtual int char_avail() const =0
Check if there is at least one character available for reading from the UART.
L4 low-level kernel interface.