diff options
Diffstat (limited to 'riscv/riscv-probe/libfemto/include/device.h')
| -rw-r--r-- | riscv/riscv-probe/libfemto/include/device.h | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/riscv/riscv-probe/libfemto/include/device.h b/riscv/riscv-probe/libfemto/include/device.h new file mode 100644 index 0000000..822ab8c --- /dev/null +++ b/riscv/riscv-probe/libfemto/include/device.h @@ -0,0 +1,39 @@ +// See LICENSE for license details. + +#pragma once + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct console_device { + void (*init)(); + int (*getchar)(); + int (*putchar)(int); +} console_device_t; + +typedef struct poweroff_device { + void (*init)(); + void (*poweroff)(int); +} poweroff_device_t; + +void register_console(console_device_t *dev); +void register_poweroff(poweroff_device_t *dev); + +extern console_device_t *console_dev; +extern poweroff_device_t *poweroff_dev; + +extern console_device_t console_none; +extern console_device_t console_htif; +extern console_device_t console_ns16550a; +extern console_device_t console_sifive_uart; +extern console_device_t console_semihost; + +extern poweroff_device_t poweroff_none; +extern poweroff_device_t poweroff_htif; +extern poweroff_device_t poweroff_sifive_test; +extern poweroff_device_t poweroff_semihost; + +#ifdef __cplusplus +} +#endif |
