Input Output System. More...
#include "ios.h"#include "system/system.h"#include "system/ipc.h"#include "ios_settings.h"#include "FreeRTOS.h"#include "semphr.h"#include <stdalign.h>#include <stddef.h>Classes | |
| struct | ios_waiter_alert_args |
Functions | |
| void | ios_initialize () |
| TODO: Explore and properly document what needs alignment and what does not. | |
| int | ios_open (const char *path, int mode) |
| Opens a file on IOS. | |
| int | ios_close (int file_handle) |
| Closes a file on IOS. | |
| int | ios_read (int file_handle, void *buffer, int size) |
| Read from a file. | |
| int | ios_write (int file_handle, void *buffer, int size) |
| Write to a file. | |
| int | ios_seek (int file_handle, int where, int whence) |
| Seek to a position in a file. | |
| int | ios_ioctl (int file_handle, int ioctl, void *buffer_in, int in_size, void *buffer_io, int io_size) |
| Send control commands to a device. | |
| int | ios_ioctlv (int file_handle, int ioctl, int in_size, int io_size, ios_ioctlv_t *argv) |
| Send multiple IO ctrl buffers. | |
| int | ios_open_async (const char *path, int mode, ipc_message *message, ipc_async_handler_t handler, void *params) |
| Opens a file on IOS with callback with async. | |
| int | ios_close_async (int file_handle, ipc_message *message, ipc_async_handler_t handler, void *params) |
| Closes a file on IOS with async. | |
| int | ios_read_async (int file_handle, void *buffer, int size, ipc_message *message, ipc_async_handler_t handler, void *params) |
| Read from a file with async. | |
| int | ios_write_async (int file_handle, void *buffer, int size, ipc_message *message, ipc_async_handler_t handler, void *params) |
| Write to a file with async. | |
| int | ios_seek_async (int file_handle, int where, int whence, ipc_message *message, ipc_async_handler_t handler, void *params) |
| Seek to a position in a file with async. | |
| int | ios_ioctl_async (int file_handle, int ioctl, void *buffer_in, int in_size, void *buffer_io, int io_size, ipc_message *message, ipc_async_handler_t handler, void *params) |
| Send control commands to a device with async. | |
| int | ios_ioctlv_async (int file_handle, int ioctl, int in_size, int io_size, ios_ioctlv_t *argv, ipc_message *message, ios_ioctlv_t *args_buffer, ipc_async_handler_t handler, void *params) |
| Send multiple IO ctrl buffers with async. | |
Input Output System.
IOS uses the IPC between broadway and starlet to command starlet to interact with some IO.
This includes things like the SD card and wiimotes. All through starlet's unix like file system for device modules.
| int ios_close | ( | int | file_handle | ) |
Closes a file on IOS.
Closes a file descriptor made with ios_open.
| file_handle | File handle to close |
| int ios_close_async | ( | int | file_handle, |
| ipc_message * | message, | ||
| ipc_async_handler_t | handler, | ||
| void * | params ) |
Closes a file on IOS with async.
Closes a file descriptor made with ios_open. The callback is called upon compilation from the ISR. Do not take too long from the ISR!
| file_handle | File handle to close |
| message | Buffer to store the ipc message in. |
| handler | Handler called from interrupt service upon compilation. |
| params | Pointer passed to the handler. |
| void ios_initialize | ( | ) |
TODO: Explore and properly document what needs alignment and what does not.
Initializes IOS.
Initializes IOS including the IPC.
| int ios_ioctl | ( | int | file_handle, |
| int | ioctl, | ||
| void * | buffer_in, | ||
| int | in_size, | ||
| void * | buffer_io, | ||
| int | io_size ) |
Send control commands to a device.
Send control commands to a device.
| ioctl | I/O Command Enum |
| buffer_in | Input data to command |
| in_size | Size of data coming in |
| buffer_io | Output data of command |
| io_size | Size of output data |
| int ios_ioctl_async | ( | int | file_handle, |
| int | ioctl, | ||
| void * | buffer_in, | ||
| int | in_size, | ||
| void * | buffer_io, | ||
| int | io_size, | ||
| ipc_message * | message, | ||
| ipc_async_handler_t | handler, | ||
| void * | params ) |
Send control commands to a device with async.
Send control commands to a device. The callback is called upon compilation from the ISR. Do not take too long from the ISR!
| ioctl | I/O Command Enum |
| buffer_in | Input data to command |
| in_size | Size of data coming in |
| buffer_io | Output data of command |
| io_size | Size of output data |
| message | Buffer to store the ipc message in. |
| handler | Handler called from interrupt service upon compilation. |
| params | Pointer passed to the handler. |
| int ios_ioctlv | ( | int | file_handle, |
| int | ioctl, | ||
| int | in_size, | ||
| int | io_size, | ||
| ios_ioctlv_t * | argv ) |
Send multiple IO ctrl buffers.
Send multiple IO ctrl buffers.
The vector array itself does not need alignment since this function makes its own copy of the vector table when converting the addresses to physical.
| ioctl | I/O Command Enum |
| buffer_in | Input data to command |
| in_size | Size of data coming in |
| buffer_io | Output data of command |
| io_size | Size of output data |
| int ios_ioctlv_async | ( | int | file_handle, |
| int | ioctl, | ||
| int | in_size, | ||
| int | io_size, | ||
| ios_ioctlv_t * | args, | ||
| ipc_message * | message, | ||
| ios_ioctlv_t * | args_buffer, | ||
| ipc_async_handler_t | handler, | ||
| void * | params ) |
Send multiple IO ctrl buffers with async.
Send multiple IO ctrl buffers.
The vector array itself does not need alignment since this function makes its own copy of the vector table when converting the addresses to physical.
The callback is called upon compilation from the ISR. Do not take too long from the ISR!
| ioctl | I/O Command Enum |
| buffer_in | Input data to command |
| in_size | Size of data coming in |
| buffer_io | Output data of command |
| io_size | Size of output data |
| argv | Vector of arguments. |
| message | Buffer to store the ipc message in. |
| argv_buffer | Buffer to store the hardware argv list in. |
| handler | Handler called from interrupt service upon compilation. |
| params | Pointer passed to the handler. |
| int ios_open | ( | const char * | path, |
| int | mode ) |
Opens a file on IOS.
Opens a file from IOS's unix-like file system.
| path | File path to the file to open |
| mode | File mode to open with. IOS_MODE_READ or IOS_MODE_WRITE. |
| int ios_open_async | ( | const char * | path, |
| int | mode, | ||
| ipc_message * | message, | ||
| ipc_async_handler_t | handler, | ||
| void * | params ) |
Opens a file on IOS with callback with async.
Opens a file from IOS's unix-like file system. The callback is called upon compilation from the ISR. Do not take too long from the ISR!
| path | File path to the file to open |
| mode | File mode to open with. IOS_MODE_READ or IOS_MODE_WRITE. |
| message | Buffer to store the ipc message in. |
| handler | Handler called from interrupt service upon compilation. |
| params | Pointer passed to the handler. |
| int ios_read | ( | int | file_handle, |
| void * | buffer, | ||
| int | size ) |
Read from a file.
Read from a file made with ios_open.
| file_handle | File Handle |
| buffer | Buffer to read into |
| size | Number of bytes to read |
| int ios_read_async | ( | int | file_handle, |
| void * | buffer, | ||
| int | size, | ||
| ipc_message * | message, | ||
| ipc_async_handler_t | handler, | ||
| void * | params ) |
Read from a file with async.
Read from a file made with ios_open. The callback is called upon compilation from the ISR. Do not take too long from the ISR!
| file_handle | File Handle |
| buffer | Buffer to read into |
| size | Number of bytes to read |
| message | Buffer to store the ipc message in. |
| handler | Handler called from interrupt service upon compilation. |
| params | Pointer passed to the handler. |
| int ios_seek | ( | int | file_handle, |
| int | where, | ||
| int | whence ) |
Seek to a position in a file.
Seek to a position in a file.
| file_handle | File Handle |
| where | How much to offset from a position |
| whence | Reference point enum for where in the file. |
| int ios_seek_async | ( | int | file_handle, |
| int | where, | ||
| int | whence, | ||
| ipc_message * | message, | ||
| ipc_async_handler_t | handler, | ||
| void * | params ) |
Seek to a position in a file with async.
Seek to a position in a file. The callback is called upon compilation from the ISR. Do not take too long from the ISR!
| file_handle | File Handle |
| where | How much to offset from a position |
| whence | Reference point enum for where in the file. |
| message | Buffer to store the ipc message in. |
| handler | Handler called from interrupt service upon compilation. |
| params | Pointer passed to the handler. |
| int ios_write | ( | int | file_handle, |
| void * | buffer, | ||
| int | size ) |
Write to a file.
Write to a file made with ios_open.
| file_handle | File Handle |
| buffer | Buffer with data to write |
| size | Number of bytes to write |
| int ios_write_async | ( | int | file_handle, |
| void * | buffer, | ||
| int | size, | ||
| ipc_message * | message, | ||
| ipc_async_handler_t | handler, | ||
| void * | params ) |
Write to a file with async.
Write to a file made with ios_open. The callback is called upon compilation from the ISR. Do not take too long from the ISR!
| file_handle | File Handle |
| buffer | Buffer with data to write |
| size | Number of bytes to write |
| message | Buffer to store the ipc message in. |
| handler | Handler called from interrupt service upon compilation. |
| params | Pointer passed to the handler. |