L4Re Operating System Framework – Interface and Usage Documentation
Loading...
Searching...
No Matches
uart_cadence.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) 2013 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
17namespace L4
18{
19 class Uart_cadence : public Uart
20 {
21 public:
22 explicit Uart_cadence(unsigned base_rate) : _base_rate(base_rate) {}
23 bool startup(Io_register_block const *) override;
24 void shutdown() override;
25 bool change_mode(Transfer_mode m, Baud_rate r) override;
26 bool enable_rx_irq(bool) override;
27 int get_char(bool blocking = true) const override;
28 int char_avail() const override;
29 int tx_avail() const;
30 void wait_tx_done() const {}
31 inline void out_char(char c) const;
32 int write(char const *s, unsigned long count,
33 bool blocking = true) const override;
34 void irq_ack() override;
35
36 private:
37 unsigned _base_rate;
38 };
39};
L4 low-level kernel interface.