N64® Functions Menu

al - Audio Library Functions
gDP - DP GBI Macros
gdSP - General GBI Macros
gSP - SP GBI Macros
gt - Turbo Microcode RDP
gu - Graphics Utilities
Math - Math Functions
nuSys - NuSystem
os - N64 Operating System
sp - Sprite Library Functions
uh - Host to Target IO
64DD - N64 Disk Drive

Nintendo® Confidential

## osPiRawWriteIo
osPiRawReadIo

Cannot be used beginning from os2.0I/patch5.

Functions
osPiRawStartDma, osPiRawWriteIo, osPiRawReadIo, osPiGetStatus

-->Accesses the parallel interface (PI) without PI management.

Syntax

    #include <ultra64.h>
    s32 osPiRawStartDma(s32 direction, u32 devAddr, void *vAddr, u32 nbytes);
    s32 osPiRawWriteIo(u32 devAddr, u32 data);
    s32 osPiRawReadIo(u32 devAddr, u32 *data);
    u32 osPiGetStatus(void);

Explanation
The parallel interface (PI) serves to transfer data between RDRAM and devices such as ROM, RAM, and magnetic disks. The functions shown above provide low-level PI access. These functions should be used only when it can be guaranteed that operations that access the PI will not be performed. These operations include debugging, printing, logging, and profiling. The reason for this is that the access routine that includes PI management can be used most efficiently is such cases. (For more information on this function, see osPiStartDma(3P)).

Although the Raw routines are easy to use, the procedures stop soon after the application boots and before the operating system is initialized. osPiRawStartDma sets up a DMA transfer between the RDRAM virtual address vaddr and the PI device address devAddr as the basic input designation (OS_READ or OS_WRITE). The total size, nbytes, should be set within the range of the number of transfer bytes, to a maximum of 16 MB, and should be a multiple of 2 bytes. The PI device address vAddr should be at least 8 contiguous bytes, but a higher minimum is recommended for OS_READ_DMA operations.

For a detailed description of the types of problems that may occur when the transfer is not a multiple of the cache line, see OS_DCACHE_ROUNDUP_ADDR(3P). The osPiRawStartDma routine also polls the interface again before programming the DMA register.

The osPiRawWriteIO routine performs a 32-bit programmed IO write to the PI device address specified by the devAddr argument. It polls the interface for idleness before performing the operation. The osPiRawReadIo routine performs a 32-bit programmed IO read from the PI device address specified by devAddr and returns the value in data. It also polls the interface for idleness before performing the operation. Note that the device address devAddr must be two-byte aligned.

osPiGetStatus simply returns the PI hardware status. The 32-bit values returned include the fllowing bit patterns.

PI_STATUS_TO_IO_BUSY
A previously issued program IO request has not been completed.

PI_STATUS_DMA_BUSY
A previously issued DMGA request has not been completed.

PI_STATUS_ERROR
An IO request was issued while DMA was busy.

The osPiGetStatus return is most often used to confirm that the last of the latest series of IO requests has been completed.

See also
osPiStartDma(3P)

Nintendo® Confidential Warning: all information in this document is confidential and covered by a non-disclosure agreement. You are responsible for keeping this information confidential and protected. Nintendo will vigorously enforce this responsibility.
Copyright © 1998
Nintendo of America Inc. All rights reserved
Nintendo and N64 are registered trademarks of Nintendo
Last updated March 1998