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

## osEepromRead
osEepromWrite

Syntax

    #include <ultra64.h>        /* os.h */
    s32 osEepromRead(OSMesgQueue *mq, u8 address, u8 *buffer);
    s32 osEepromWrite(OSMesgQueue *mq, u8 address, u8 *buffer);

Explanation
The function osEepromRead issues a read command to EEPRom and reads 8 bytes of data from an address specified by address. The function osEepromWrite issues a write command to EEPRom and writes 8 bytes of data to an address specified by address

The size of "buffer," which is used for storing the data, must be large enough to hold "nbytes" of data.Note that address is an EEPROM block address. Because blocks are in units of 8 bytes, you must specify a value that is divisible by 8 for the actual address.

The returned value is 0 if the command is properly sent to the interface circuit. The returned value is -1 if the value of address is not within the proper range. If no EEPROM exists or if the interface circuit does not respond, then the returned value is 8 (CONT_NO_RESPONSE_ERROR).

"mq" is the initialized message queue associated with OS_EVENT_SI events. For details, see osSetEventMesg. Since "mq" is used inside the function to wait for messages, the application does not need to use "mq" to wait for an end-of-function message.

The osEepromRead and osEepromWrite functions can only read and write data of 8 bytes (1 block). To read and write more than 8 bytes, use the osEepromLongRead() and osEepromLongWrite functions.

The EEPROM command takes about 15 milliseconds to finish. To avoid a reduction in overall system performance, you need to set up a timer between calls to osEepromRead and osEepromWrite.

See Also
osContInit
osEepromProbe
osEepromLongRead
osEepromLongWrite
osSetEventMesg

Revision History
2/1/1999 Revised entirely

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