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

## osEepromLongRead
osEepromLongWrite

Syntax

#include <ultra64.h> /* os.h */ s32 osEepromLongRead(OSMesgQueue *mq, u8 address, u8 *buffer, int nbytes); s32 osEepromLongWrite(OSMesgQueue *mq, u8 address, u8 *buffer, int nbytes);
Explanation
The osEepromLongRead function issues a read command to EEProm and reads "nbytes" of data from the address specified by address. The osEepromLongWrite function issues a write command to EEPRom and writes "nbytes" of data to the address specified by address .

The size of "buffer," which is used for storing the data, must be large enough to hold "nbytes" of data. Also, due to a hardware restrictions, the transfer byte size (nbytes) must be a multiple of 8. 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.

"mq" is the initialized message queue associated with OS_EVENT_SI events. For details, please 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.

It can take as long as 15 milliseconds for the EEPROM write command to complete a data transfer. The osEepromWrite() function is called numerous times inside the osEepromLongWrite() function, and the CPU timer is used to wait 15 milliseconds every time data is written with osEepromWrite(). The returned values are the same as for osEepromWrite(). That is to say, the returned value is 0 if all write commands (the amount for "length" (=nbytes/8) number of times) have been properly sent to the interface circuit. The returned value is -1 if the value of "address" is not within the proper range. The returned value is 8 (CONT_NO_RESPONSE_ERROR) if no EEPROM exists or if the interface circuit does not respond.

The osEepromLongRead() function internally calls osEepromRead() the "length" number of times. The returned values are the same as for the osEepromRead() function. A 0 is returned if all data (the amount for "length" number of times) is properly read. A -1 is returned if the value of "address" is not within the proper range. An 8 is returned (CONT_NO_RESPONSE_ERROR) if no EEPROM exists or if the interface circuit does not respond.

See Also
osContInit
osEepromProbe
osEepromRead
osEepromWrite
osSetEventMesg

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