HomeCore 0.1.3 (07b5544)
Bare-metal personal computer firmware for Cortex-M
Loading...
Searching...
No Matches
console.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: MIT */
6#ifndef HOMECORE_DRIVERS_CONSOLE_H
7#define HOMECORE_DRIVERS_CONSOLE_H
8
9#include <stdbool.h>
10
26typedef struct {
28 void (*putc)(void *device, char c);
31 int (*getc)(void *device);
33 int (*has_data)(void *device);
35 void (*flush)(void *device);
37 bool (*ready)(void *device);
39
41typedef struct {
45 void *device;
46} console_t;
47
49extern const console_t dt_console;
50
56bool console_ready(void);
57
59void console_flush(void);
60
63#endif /* HOMECORE_DRIVERS_CONSOLE_H */
bool console_ready(void)
Report whether the console device has been initialized.
void console_flush(void)
Wait until all written console output has been transmitted.
const console_t dt_console
Console chosen by the device description; generated in devicetree.c.
Console operations a serial driver provides.
Definition console.h:26
A console: driver operations bound to one device instance.
Definition console.h:41
const console_ops_t * ops
Operations of the device's driver.
Definition console.h:43
void * device
Driver instance passed to every operation.
Definition console.h:45