KallistiOS
##version##
|
Debug I/O. More...
Go to the source code of this file.
Data Structures | |
struct | dbgio_handler |
Debug I/O Interface. More... | |
Macros | |
#define | DBGIO_MODE_POLLED 0 |
Polled I/O mode. More... | |
#define | DBGIO_MODE_IRQ 1 |
IRQ-based I/O mode. More... | |
Typedefs | |
typedef struct dbgio_handler | dbgio_handler_t |
Debug I/O Interface. More... | |
Functions | |
int | dbgio_dev_select (const char *name) |
Select a new dbgio interface by name. More... | |
const char * | dbgio_dev_get () |
Fetch the name of the currently selected dbgio interface. More... | |
int | dbgio_init () |
Initialize the dbgio console. More... | |
int | dbgio_set_irq_usage (int mode) |
Set IRQ usage. More... | |
int | dbgio_read () |
Read one character from the console. More... | |
int | dbgio_write (int c) |
Write one character to the console. More... | |
int | dbgio_flush () |
Flush any queued output. More... | |
int | dbgio_write_buffer (const uint8 *data, int len) |
Write an entire buffer of data to the console. More... | |
int | dbgio_read_buffer (uint8 *data, int len) |
Read an entire buffer of data from the console. More... | |
int | dbgio_write_buffer_xlat (const uint8 *data, int len) |
Write an entire buffer of data to the console (potentially with newline transformations). More... | |
int | dbgio_write_str (const char *str) |
Write a NUL-terminated string to the console. More... | |
void | dbgio_disable () |
Disable debug I/O globally. More... | |
void | dbgio_enable () |
Enable debug I/O globally. More... | |
int | dbgio_printf (const char *fmt,...) __printflike(1 |
Built-in debug I/O printf function. More... | |
Debug I/O.
This file contains the Debug I/O system, which abstracts things so that various types of debugging tools can be used by programs in KOS. Included among these tools is the dcload console (dcload-serial, dcload-ip, and fs_dclsocket), a raw serial console, and a framebuffer based console.
#define DBGIO_MODE_IRQ 1 |
IRQ-based I/O mode.
#define DBGIO_MODE_POLLED 0 |
Polled I/O mode.
typedef struct dbgio_handler dbgio_handler_t |
Debug I/O Interface.
This struct represents a single dbgio interface. This should represent a generic pollable console interface. We will store an ordered list of these statically linked into the program and fall back from one to the next until one returns true for detected(). Note that the last device in this chain is the null console, which will always return true.
const char* dbgio_dev_get | ( | ) |
Fetch the name of the currently selected dbgio interface.
int dbgio_dev_select | ( | const char * | name | ) |
Select a new dbgio interface by name.
This function manually selects a new dbgio interface by name. This function will allow you to select a device, even if it is not detected.
name | The dbgio interface to select |
0 | On success |
-1 | On error |
void dbgio_disable | ( | ) |
Disable debug I/O globally.
void dbgio_enable | ( | ) |
Enable debug I/O globally.
int dbgio_flush | ( | ) |
Flush any queued output.
0 | On success |
-1 | On error (errno should be set as appropriate) |
int dbgio_init | ( | ) |
Initialize the dbgio console.
This function is called internally, and shouldn't need to be called by any user programs.
0 | On success |
-1 | On error |
int dbgio_printf | ( | const char * | fmt, |
... | |||
) |
Built-in debug I/O printf function.
fmt | A printf() style format string |
... | Format arguments |
int dbgio_read | ( | ) |
Read one character from the console.
0 | On success |
-1 | On error (errno should be set as appropriate) |
int dbgio_read_buffer | ( | uint8 * | data, |
int | len | ||
) |
Read an entire buffer of data from the console.
data | The buffer to read into |
len | The length of the buffer |
int dbgio_set_irq_usage | ( | int | mode | ) |
Set IRQ usage.
The dbgio system defaults to polled usage. Some devices may not support IRQ mode at all.
mode | The mode to use |
0 | On success |
-1 | On error (errno should be set as appropriate) |
int dbgio_write | ( | int | c | ) |
Write one character to the console.
c | The character to write |
1 | On success (number of characters written) |
-1 | On error (errno should be set as appropriate) |
int dbgio_write_buffer | ( | const uint8 * | data, |
int | len | ||
) |
Write an entire buffer of data to the console.
data | The buffer to write |
len | The length of the buffer |
int dbgio_write_buffer_xlat | ( | const uint8 * | data, |
int | len | ||
) |
Write an entire buffer of data to the console (potentially with newline transformations).
data | The buffer to write |
len | The length of the buffer |
int dbgio_write_str | ( | const char * | str | ) |
Write a NUL-terminated string to the console.
str | The string to write |