iportio(3)

Section: Interp SDK (3)
Updated: 2007-02-20

NAME

iportio - encapsulates all target-specific port I/O used by interp

SYNOPSIS

#include itypes.h
#include iportio.h

int port_read( iword portaddr, iword count, iword buffaddr, int size );
int port_write( iword portaddr, iword count, iword buffaddr, int size);

DESCRIPTION

These functions are the port I/O portability layer between interp and the hardware, or host operating system (if there is one.) In general terms, port I/O is communication between software and a device with a buffer that appears as one memory location (of a fixed size, such as byte or 32-bit word.) Writing data to this device is done by transfering each byte of data to the port memory location. Reading data from this device is done by transferring data from the port memory location into the next receiving buffer location.

LIST OF FUNCTIONS

Function
Description
port_read
Reads count characters from portaddr into the buffer represented by buffaddr. Each transfer is size bytes long, limited to 1, 2, or 4 bytes. If some other value for size is given, byte transfers are used. The status returned is 0 for success or anything else for failure.
port_write
Writes count characters to portaddr from the buffer represented by buffaddr. Each transfer is size bytes long, limited to 1, 2, or 4 bytes. If some other value for size is given, byte transfers are used. The status returned is 0 for success or anything else for failure.