CeylanARM7Base.h File Reference

#include "CeylanARM7Codes.h"

Include dependency graph for CeylanARM7Base.h:

This graph shows which files directly or indirectly include this file:

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 Documentation

typedef uint32 BufferSize

For buffers.

Definition at line 96 of file CeylanARM7Base.h.

typedef char Byte

For buffers.

Definition at line 92 of file CeylanARM7Base.h.

typedef uint8 FIFOCommandCount

Describes a number of FIFO commands.

Definition at line 88 of file CeylanARM7Base.h.

typedef uint32 FIFOElement

One of the 16 entries of the FIFO.

Definition at line 84 of file CeylanARM7Base.h.

typedef int InterruptMask

Masks describing which interrupts are enabled.

Definition at line 101 of file CeylanARM7Base.h.


Function Documentation

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.

See also:
testCeylanSound.arm7.c for an example
Note:
Must be defined by the user.

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.

See also:
testCeylanSound.arm7.c for an example
Note:
Must be defined by the user.

Referenced by handleReceivedCommand().

void handleReceivedSystemSpecificCommand ( FIFOCommandID  commandID,
FIFOElement  firstElement 
)

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.

Parameters:
newMask the masks describing all the interrupts that are to be enabled.
Returns:
The previous mask that was used, before being replaced by the specified one.
Note:
Usually used to deactivate all IRQ.

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.

Note:
If previous error code was not NoError, will be left as is. The first error (most interesting one) is kept.

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.

Note:
If previous status was ARM7InError, will be left as is, so that error status is not lost.

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().


Variable Documentation

To specify that all interrupts are to disabled (null value).

Definition at line 56 of file CeylanARM7Base.c.


Generated on Thu Jun 4 20:39:21 2009 for Ceylan by  doxygen 1.5.8