Loading...
Searching...
No Matches
uart_lpuart.h
/*
* Copyright (C) 2019, 2023-2024 Kernkonzept GmbH.
* Author(s): Adam Lackorzynski <adam@l4re.org>
*
* License: see LICENSE.spdx (in this directory or the directories above)
*/
#pragma once
#include "uart_base.h"
namespace L4 {
class Uart_lpuart : public Uart
{
public:
Uart_lpuart(unsigned freq = 0) : _freq(freq) {}
bool startup(Io_register_block const *) override;
void shutdown() override;
bool change_mode(Transfer_mode m, Baud_rate r) override;
int tx_avail() const;
void wait_tx_done() const {}
inline void out_char(char c) const;
int write(char const *s, unsigned long count,
bool blocking = true) const override;
bool enable_rx_irq(bool enable = true) override;
int char_avail() const override;
int get_char(bool blocking = true) const override;
private:
unsigned _freq;
};
} // namespace L4
L4::Uart
Uart driver abstraction.
Definition uart_base.h:21
L4::Uart::shutdown
virtual void shutdown()=0
Terminate the UART driver.
L4::Uart::char_avail
virtual int char_avail() const =0
Check if there is at least one character available for reading from the UART.
L4
L4 low-level kernel interface.
Definition l4sys-l4f-groups.dox:50