L4Re Operating System Framework
Interface and Usage Documentation
Loading...
Searching...
No Matches
uart_lpuart.h
1/*
2 * Copyright (C) 2019, 2023-2024 Kernkonzept GmbH.
3 * Author(s): Adam Lackorzynski <adam@l4re.org>
4 *
5 * License: see LICENSE.spdx (in this directory or the directories above)
6 */
7#pragma once
8
9#include "uart_base.h"
10
11namespace L4 {
12
13class Uart_lpuart : public Uart
14{
15public:
17 Uart_lpuart(unsigned freq = 0) : _freq(freq) {}
18 bool startup(Io_register_block const *) override;
19 void shutdown() override;
20 bool change_mode(Transfer_mode m, Baud_rate r) override;
21 int tx_avail() const;
22 void wait_tx_done() const {}
23 inline void out_char(char c) const;
24 int write(char const *s, unsigned long count,
25 bool blocking = true) const override;
26
27 bool enable_rx_irq(bool enable = true) override;
28 int char_avail() const override;
29 int get_char(bool blocking = true) const override;
30
31private:
32 unsigned _freq;
33};
34
35} // 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.