KallistiOS git master
Independent SDK for the Sega Dreamcast
Loading...
Searching...
No Matches
dbgio_handler_t Struct Reference

Debug I/O Interface. More...

#include <kos/dbgio.h>

Data Fields

const char * name
 Name of the dbgio handler.
 
int(* detected )(void)
 Detect this debug interface.
 
int(* init )(void)
 Initialize this debug interface with default parameters.
 
int(* shutdown )(void)
 Shutdown this debug interface.
 
int(* set_irq_usage )(int mode)
 Set either polled or IRQ usage for this interface.
 
int(* read )(void)
 Read one character from the console.
 
int(* write )(int c)
 Write one character to the console.
 
int(* flush )(void)
 Flush any queued output.
 
int(* write_buffer )(const uint8 *data, int len, int xlat)
 Write an entire buffer of data to the console.
 
int(* read_buffer )(uint8 *data, int len)
 Read an entire buffer of data from the console.
 

Detailed Description

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.

Field Documentation

◆ detected

int(* dbgio_handler_t::detected) (void)

Detect this debug interface.

Return values
1If the device is available and usable
0If the device is unavailable

◆ flush

int(* dbgio_handler_t::flush) (void)

Flush any queued output.

Return values
0On success
-1On error (set errno as appropriate)

◆ init

int(* dbgio_handler_t::init) (void)

Initialize this debug interface with default parameters.

Return values
0On success
-1On failure

◆ name

const char* dbgio_handler_t::name

Name of the dbgio handler.

◆ read

int(* dbgio_handler_t::read) (void)

Read one character from the console.

Return values
0On success
-1On failure (set errno as appropriate)

◆ read_buffer

int(* dbgio_handler_t::read_buffer) (uint8 *data, int len)

Read an entire buffer of data from the console.

Parameters
dataThe buffer to read into
lenThe length of the buffer
Returns
Number of characters read on success, or -1 on failure (set errno as appropriate)

◆ set_irq_usage

int(* dbgio_handler_t::set_irq_usage) (int mode)

Set either polled or IRQ usage for this interface.

Parameters
mode1 for IRQ-based usage, 0 for polled I/O
Return values
0On success
-1On failure

◆ shutdown

int(* dbgio_handler_t::shutdown) (void)

Shutdown this debug interface.

Return values
0On success
-1On failure

◆ write

int(* dbgio_handler_t::write) (int c)

Write one character to the console.

Parameters
cThe character to write
Return values
1On success
-1On error (set errno as appropriate)
Note
Interfaces may require a call to flush() before the output is actually flushed to the console.

◆ write_buffer

int(* dbgio_handler_t::write_buffer) (const uint8 *data, int len, int xlat)

Write an entire buffer of data to the console.

Parameters
dataThe buffer to write
lenThe length of the buffer
xlatIf non-zero, newline transformations may occur
Returns
Number of characters written on success, or -1 on failure (set errno as appropriate)

The documentation for this struct was generated from the following file: