LeoSpdlMotor LeoSpdlMotor (function)

Controls the N64 Disk Drive's motor and the position of the head

Syntax

#include <PR/leo.h>     /* leo.h */

s32 LeoSpdlMotor(LEOCmd *cmdBlock, LEOSpdlMode mode, OSMesgQueue *mq);

typedef u8 LEOSpdlMode;

Description

Note: None of the N64 Disk Drive-related instructions involve ROM DMA (including DMA to ROM in the drive). In fact, the instructions are designed on the assumption that ROM DMA will not be carried out. To learn more about this, please see "Chapter 12: Programming Cautions" in the N64 Disk Drive Programming Manual.

LeoSpdlMotor controls the drive's motor and the position of the head.

User can specify any of the four following states for the mode argument:

LEO_MOTOR_ACTIVE

The motor is running, the drive is in active mode.

LEO_MOTOR_STANDBY

The drive in is standby mode (the motor is spinning and the head is parked (retracted)).

LEO_MOTOR_SLEEP

It waits for the disk to stop, and then the drive is in sleep mode (the motor is stopped and the head is parked (retracted)).

LEO_MOTOR_BRAKE

It breaks off spinning disk, and then the drive is in sleep mode (the motor is stopped and the head is parked (retracted)).

Nothing needs to be set for the command block cmdBlock argument. When processing of this function ends, an error code is returned to the message queue mq. An error could arise, so the programmer needs to check this error code.

For more information about the errors that may be returned, their causes, and ways to deal with them, please see "Chapter 10: Error-Handling" in the N64 Disk Drive Programming Manual.

The return value is -1 if Leo Manager has not been created, and 0 if it has. Usually no check is necessary.

Example

LEOCmd cmdBlock;
u32 error;
.....
LeoSpdlMotor(&cmdBlock, LEO_MOTOR_ACTIVE, &diskQ);
osRecvMesg(&diskQ, (OSMesg *)&error, OS_MESG_BLOCK);

See Also

Leo*CreateLeoManager, and LeoModeSelectAsync

Revision History

04/30/1999 Changed Format