fifocommon.h File Reference

low level FIFO API. More...

#include "ndstypes.h"

Enumerations

enum  PM_LedBlinkMode {
  PM_LED_ON = (0<<4),
  PM_LED_SLEEP = (1<<4),
  PM_LED_BLINK = (3<<4)
}
 Power Management LED blink mode control bits. More...

Functions

bool fifoInit ()
 Initializes the fifo system.
bool fifoSendAddress (int channel, void *address)
 Send an address.
bool fifoSendDatamsg (int channel, int num_bytes, u8 *data_array)
 Send a sequence of bytes to the other CPU.
bool fifoSendValue32 (int channel, u32 value32)
 Send a 32bit value.
bool fifoSetAddressHandler (int channel, FifoAddressHandlerFunc newhandler, void *userdata)
 Set user address message callback.
bool fifoSetValue32Handler (int channel, FifoValue32HandlerFunc newhandler, void *userdata)
 Set user value32 message callback.


Detailed Description

low level FIFO API.


Enumeration Type Documentation

Power Management LED blink mode control bits.

Enumerator:
PM_LED_ON  Steady on.
PM_LED_SLEEP  Blinking, mostly off.
PM_LED_BLINK  Blinking, mostly on.


Function Documentation

fifoInit (  ) 

Initializes the fifo system.

Attempts to sync with the other CPU, if it fails, fifo services won't be provided.

Note:
call irqInit() before calling this function.

fifoSendAddress ( int  channel,
void *  address 
)

Send an address.

Parameters:
channel channel number to send to
address address to send Transmits an address in the range 0x02000000-0x023FFFFF to the other CPU.

fifoSendDatamsg ( int  channel,
int  num_bytes,
u8 *  data_array 
)

Send a sequence of bytes to the other CPU.

Parameters:
channel channel number to send to
num_bytes number of bytes to send
data_array pointer to data array
num_bytes can be between 0 and FIFO_MAX_DATA_BYTES (see above) - sending 0 bytes can be useful sometimes ...

fifoSendValue32 ( int  channel,
u32  value32 
)

Send a 32bit value.

Parameters:
channel channel number to send to
value32 32bit value to send Transmits a 32bit value to the other CPU.
Note:
Transfer is more efficient if the top 8 bits are zero. So sending smaller values or bitmasks that don't include the top bits is preferred.

fifoSetAddressHandler ( int  channel,
FifoAddressHandlerFunc  newhandler,
void *  userdata 
)

Set user address message callback.

Parameters:
channel 
newhandler 
userdata Set a callback to receive incoming address messages on a specific channel.

fifoSetValue32Handler ( int  channel,
FifoValue32HandlerFunc  newhandler,
void *  userdata 
)

Set user value32 message callback.

Set user data message callback.

Parameters:
channel 
newhandler 
userdata Set a callback to receive incoming value32 messages on a specific channel.
channel 
newhandler 
userdata Set a callback to receive incoming data messages on a specific channel.


Generated on Sun Mar 7 12:47:54 2010 for libnds by  doxygen 1.5.7.1