MIDIRead

Syntax

#include <cafe/midi.h>

#define MIDI_JSTAT_MASK           0x3a
#define MIDI_JSTAT_FLAGS_SHIFT       4
#define MIDI_JSTAT_FLAGS_MASK     0x30
#define MIDI_JSTAT_SEND           0x08
#define MIDI_JSTAT_RECV           0x02

#define MIDI_READY      0
#define MIDI_NOT_READY  1
#define MIDI_BUSY       2

s32 MIDIRead(s32 chan, u8* dst, u8* status);

Parameters

chan 0
dst Pointer to a u8 variable that stores read data.
status Pointer to a u8 variable that stores the status value returned by the MIDI adapter. The value is masked using MIDI_JSTAT_MASK and is valid only when execution terminates normally.

Return Values

Returns one of the following codes. If MIDI_READY is returned, it indicates that API execution has terminated normally.

Description

Gets 4 bytes of data from the MIDI adapter. The function call fails if a MIDI adapter is not connected.

Do Not Call From

Background Do not call this function from the background.
Multiple threads This function is not thread-safe.
Callbacks Do not call this function from any callback function.
Interrupt handler Do not call this function from any interrupt handler.
Exception handler Do not call this function from any exception handler.
Production code Do not call this function in production code. It is available only for debugging purposes.

See Also

MIDIReadAsync

Revision History

2013/06/21 Clarify that chan should always be 0.
2013/05/08 Automated cleanup pass.
2013/05/01 Add missing values.
2012/08/06 Cleanup pass.
2012/04/11 Port to Cafe.
2007/05/09 Initial version.


CONFIDENTIAL