CHERIoT RTOS
A compartmentalised RTOS for CHERIoT hardware
Loading...
Searching...
No Matches
uart.hh
1// Copyright Microsoft and CHERIoT Contributors.
2// SPDX-License-Identifier: MIT
3
4#pragma once
5
6#include <concepts>
7#include <stdint.h>
8
9/**
10 * Concept for checking that a UART driver exposes the right interface.
11 */
12template<typename T>
13concept IsUart = requires(volatile T *v, uint8_t byte) {
14 { v->init() };
15 { v->can_write() } -> std::same_as<bool>;
16 { v->can_read() } -> std::same_as<bool>;
17 { v->blocking_read() } -> std::same_as<uint8_t>;
18 { v->blocking_write(byte) };
19};
Concept for checking that a UART driver exposes the right interface.
Definition uart.hh:13