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

Format
#include <ultra64.h>

s32 osEepromRead(OSMesgQueue *mq, u8 address, u8 *buffer);

s32 osEepromWrite(OSMesgQueue *mq, u8 address, u8 *buffer);


What These Functions Do
The osEepromRead and osEepromWrite functions read 8K of data from and write 8K of data to an address in the EEPROM (0-63 for a 4K-EEPROM or 0-255 for a 16K-EEPROM).

The osEepromRead function issues a read EEPROM command to obtain 8 bytes of data from the address specified by the address argument. The osEepromWrite function issues a write EEPROM command to write 8 bytes of data to the address specified by the address argument. Note that the address specified by the address argument is an EEPROM block address. Because the block is an 8-byte unit, you must specify a value that is the actual address divided by 8.

Supply a buffer (a block of memory pointed to by the buffer argument) that is large enough to hold 8 bytes.

The message queue pointed to by the mq argument must be an initialized message queue associated with the OS_EVENT_SI event. See osSetEventMesg for details on how to create this association.

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 osSetTimer for details on how to start a countdown timer.

Note that you must always call osContInit to initialize low-level synchronization before you call osEepromRead or osEepromWrite.

See Also
osContInit
osEepromProbe
osEepromLongRead
osEepromLongWrite



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 January 1998