summaryrefslogtreecommitdiff
path: root/riscv/riscv-probe/libfemto/include/device.h
blob: 822ab8c3f25147bfe0bb704f32b26f1931c85957 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
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