sdk-world v2026.11.05
PS2 SDK - world tier (copyleft-allowed, non-essential packages)
Loading...
Searching...
No Matches
SIOCookie.h File Reference
#include <stdio.h>
#include <kernel.h>

Go to the source code of this file.

Enumerations

enum  EE_SIO_START_RETCODES { EESIO_SUCESS = 0 , EESIO_COOKIE_OPEN_IS_NULL , EESIO_BUFFER_ALLOC_IS_NULL }
 Return values for ee_sio_start. More...

Functions

int ee_sio_start (u32 baudrate, u8 lcr_ueps, u8 lcr_upen, u8 lcr_usbl, u8 lcr_umode, int hook_stdout)
 initializes both the serial port comunication and the EE_SIO custom stream to print data trough it

Variables

FILE * EE_SIO
 custom stream to print data to the EE serial port. must call ee_sio_start() first to make it work

Enumeration Type Documentation

◆ EE_SIO_START_RETCODES

Return values for ee_sio_start.

See also
ee_sio_start
Enumerator
EESIO_COOKIE_OPEN_IS_NULL 

everything is OK!

EESIO_BUFFER_ALLOC_IS_NULL 

fopencookie() failed to hook the custom stream the allocation of memfile_cookie.buf failed

Definition at line 32 of file SIOCookie.h.

Function Documentation

◆ ee_sio_start()

int ee_sio_start ( u32 baudrate,
u8 lcr_ueps,
u8 lcr_upen,
u8 lcr_usbl,
u8 lcr_umode,
int hook_stdout )

initializes both the serial port comunication and the EE_SIO custom stream to print data trough it

Parameters
baudratebaudrate of the EE SIO. Unlike the BIOS sio_init() routine, we always base the baud rate on the CPU clock. 38400 is the recommended value
lcr_uepspassed as is, so you'll need to use the SIO_LCR_* register values. You can pass 0 for all of the lcr_* params to get the standard 8N1 setting (8 data bits, no parity checking, 1 stop bit).
lcr_upenpassed as is, so you'll need to use the SIO_LCR_* register values. You can pass 0 for all of the lcr_* params to get the standard 8N1 setting (8 data bits, no parity checking, 1 stop bit).
lcr_usblpassed as is, so you'll need to use the SIO_LCR_* register values. You can pass 0 for all of the lcr_* params to get the standard 8N1 setting (8 data bits, no parity checking, 1 stop bit).
lcr_umodepassed as is, so you'll need to use the SIO_LCR_* register values. You can pass 0 for all of the lcr_* params to get the standard 8N1 setting (8 data bits, no parity checking, 1 stop bit).
hook_stdoutwether to also hook EE SIO into stdout
Returns
0 on success, nonzero on error. see EE_SIO_START_RETCODES enum for further details
See also
EE_SIO_START_RETCODES, https://en.cppreference.com/w/c/io/setvbuf

Definition at line 23 of file SIOCookie.c.

Variable Documentation

◆ EE_SIO

FILE* EE_SIO
extern

custom stream to print data to the EE serial port. must call ee_sio_start() first to make it work

Note
it's recommended to use it with fprintf()

Definition at line 15 of file SIOCookie.c.