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>

Public Member Functions

 SLIST_ENTRY (dbgio_handler) entry
 dbgio handler list handle.
 

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_t *data, int len, int xlat)
 Write an entire buffer of data to the console.
 
int(* read_buffer )(uint8_t *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 store an ordered, singly-linked list of these and fall back from one to the next until one returns true for detected(). Users may create and add their own dbgio interfaces using the dbgio_add_handler() function. Note that the last device in this chain is the null console, which will always return true.

Member Function Documentation

◆ SLIST_ENTRY()

dbgio_handler_t::SLIST_ENTRY ( dbgio_handler )

dbgio handler list handle.

Contrary to what doxygen might think, this is not a function.

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_t *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_t *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: