#include "CeylanARM7Codes.h"
Go to the source code of this file.
Typedefs | |
typedef uint32 | FIFOElement |
One of the 16 entries of the FIFO. | |
typedef uint8 | FIFOCommandCount |
Describes a number of FIFO commands. | |
typedef char | Byte |
For buffers. | |
typedef uint32 | BufferSize |
For buffers. | |
typedef int | InterruptMask |
Masks describing which interrupts are enabled. | |
Functions | |
void | atomicSleep () |
Waits a short time slice. | |
void | setStatusWord (ARM7StatusWord newStatus) |
Sets the ARM7 status word, for the ARM9. | |
void | setError (ARM7ErrorCode newError) |
Sets the ARM7 error code, for the ARM9. | |
void | unsetErrorStatus () |
Unset any previous error status, for example when the error code has been taken into account already. | |
FIFOElement | prepareFIFOCommand (FIFOCommandID id) |
Creates a FIFO element appropriate to begin a command for the ARM9. | |
InterruptMask | setEnabledInterrupts (InterruptMask newMask) |
Sets the current set of interrupts enabled. | |
void | notifyCommandToARM9 () |
Warns the ARM9 that a new command has been sent by the ARM7 on the FIFO. | |
FIFOElement | read () |
Reads an element from the ARM7 FIFO, supposing there is at least one. | |
FIFOElement | readBlocking () |
Reads an element from the ARM7 FIFO, waiting if needed until there is one. | |
void | write (FIFOElement toSend) |
Writes an element to the ARM7 FIFO, supposing there is room for it. | |
void | writeBlocking (FIFOElement toSend) |
Writes an element to the ARM7 FIFO, waiting if needed until there is room for it. | |
void | handleReceivedSystemSpecificCommand (FIFOCommandID commandID, FIFOElement firstElement) |
Manages a Ceylan-specific command. | |
void | handleReceivedIntegratingLibrarySpecificCommand (FIFOCommandID commandID, FIFOElement firstElement) |
Integrating library-specific (ex: OSDL) command handler, declared here but to be defined by user code, typically the OSDL library, if used. | |
void | handleReceivedApplicationCommand (FIFOCommandID commandID, FIFOElement element) |
Application-specific command handler, declared here but to be defined by user code. | |
void | initCeylan () |
Sets-up Ceylan and its prerequesites. | |
Variables | |
const InterruptMask | AllInterruptsDisabled |
To specify that all interrupts are to disabled (null value). |
typedef uint32 BufferSize |
typedef char Byte |
typedef uint8 FIFOCommandCount |
typedef uint32 FIFOElement |
typedef int InterruptMask |
void atomicSleep | ( | ) |
Waits a short time slice.
Needs the VBlank IRQ to be enabled.
Definition at line 199 of file CeylanARM7Base.c.
void handleReceivedApplicationCommand | ( | FIFOCommandID | commandID, | |
FIFOElement | element | |||
) |
Application-specific command handler, declared here but to be defined by user code.
Referenced by handleReceivedCommand().
void handleReceivedIntegratingLibrarySpecificCommand | ( | FIFOCommandID | commandID, | |
FIFOElement | firstElement | |||
) |
Integrating library-specific (ex: OSDL) command handler, declared here but to be defined by user code, typically the OSDL library, if used.
Referenced by handleReceivedCommand().
void handleReceivedSystemSpecificCommand | ( | FIFOCommandID | commandID, | |
FIFOElement | firstElement | |||
) |
Manages a Ceylan-specific command.
Definition at line 809 of file CeylanARM7Base.c.
References BatteryStatusRequest, DSTypeRequest, handleBatteryStatusRequest(), handleDSTypeRequest(), handleShutdownIPCRequest(), handleStatusInitRequest(), HelloToTheARM7, setError(), ShutdownIPCRequest, StatusInitRequest, UnexpectedBehaviour, and UnexpectedSystemCommand.
Referenced by handleReceivedCommand().
void initCeylan | ( | ) |
Sets-up Ceylan and its prerequesites.
Definition at line 1123 of file CeylanARM7Base.c.
References initCeylanIPC(), initCeylanSound(), and VcountHandler().
void notifyCommandToARM9 | ( | ) |
Warns the ARM9 that a new command has been sent by the ARM7 on the FIFO.
Definition at line 430 of file CeylanARM7Base.c.
References sendSynchronizeInterruptToARM9(), and sentCount.
Referenced by handleBatteryStatusRequest(), and handleDSTypeRequest().
FIFOElement prepareFIFOCommand | ( | FIFOCommandID | id | ) |
Creates a FIFO element appropriate to begin a command for the ARM9.
Definition at line 278 of file CeylanARM7Base.c.
References localCommandCount.
Referenced by handleBatteryStatusRequest(), and handleDSTypeRequest().
FIFOElement read | ( | ) |
Reads an element from the ARM7 FIFO, supposing there is at least one.
Definition at line 459 of file CeylanARM7Base.c.
References dataAvailableForReading(), FIFOErrorWhileReading, and setError().
Referenced by Ceylan::System::FDRead().
FIFOElement readBlocking | ( | ) |
Reads an element from the ARM7 FIFO, waiting if needed until there is one.
Definition at line 490 of file CeylanARM7Base.c.
References dataAvailableForReading(), FIFOErrorWhileReading, FIFOTimeOutWhileReading, setError(), setStatusWord(), StatusReset, and unsetErrorStatus().
Referenced by handleReceivedCommand(), and handleStatusInitRequest().
InterruptMask setEnabledInterrupts | ( | InterruptMask | newMask | ) |
Sets the current set of interrupts enabled.
newMask | the masks describing all the interrupts that are to be enabled. |
Definition at line 417 of file CeylanARM7Base.c.
Referenced by initCeylanSound().
void setError | ( | ARM7ErrorCode | newError | ) |
Sets the ARM7 error code, for the ARM9.
Updates the status word accordingly.
Definition at line 241 of file CeylanARM7Base.c.
References ARM7InError, errorWordPointer, NoError, and setStatusWord().
Referenced by handleReceivedCommand(), handleReceivedSystemSpecificCommand(), handleShutdownIPCRequest(), handleStatusInitRequest(), read(), readBlocking(), write(), and writeBlocking().
void setStatusWord | ( | ARM7StatusWord | newStatus | ) |
Sets the ARM7 status word, for the ARM9.
Definition at line 218 of file CeylanARM7Base.c.
References ARM7InError, and statusWordPointer.
Referenced by readBlocking(), setError(), and writeBlocking().
void unsetErrorStatus | ( | ) |
Unset any previous error status, for example when the error code has been taken into account already.
Definition at line 263 of file CeylanARM7Base.c.
References errorWordPointer, NoError, NoStatusAvailable, and statusWordPointer.
Referenced by readBlocking(), and writeBlocking().
void write | ( | FIFOElement | toSend | ) |
Writes an element to the ARM7 FIFO, supposing there is room for it.
Definition at line 551 of file CeylanARM7Base.c.
References FIFOErrorWhileWriting, setError(), and spaceAvailableForWriting().
Referenced by Ceylan::System::FDWrite().
void writeBlocking | ( | FIFOElement | toSend | ) |
Writes an element to the ARM7 FIFO, waiting if needed until there is room for it.
Definition at line 592 of file CeylanARM7Base.c.
References FIFOErrorWhileWriting, FIFOTimeOutWhileWriting, sendSynchronizeInterruptToARM9(), setError(), setStatusWord(), spaceAvailableForWriting(), StatusReset, and unsetErrorStatus().
Referenced by handleBatteryStatusRequest(), and handleDSTypeRequest().
To specify that all interrupts are to disabled (null value).
Definition at line 56 of file CeylanARM7Base.c.