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