libnds
|
Low level FIFO API. More...
Typedefs | |
typedef void(* | FifoAddressHandlerFunc) (void *address, void *userdata) |
Callback that is called with the address sent from the other CPU and the callback's user data. | |
typedef void(* | FifoDatamsgHandlerFunc) (int num_bytes, void *userdata) |
Callback that is called with the number of bytes sent from the other CPU and the callback's user data. | |
typedef void(* | FifoValue32HandlerFunc) (u32 value32, void *userdata) |
Callback that is called with the 32-bit value sent from the other CPU and the callback's user data. | |
Enumerations | |
enum | FifoChannels { FIFO_PM = 0 , FIFO_SOUND = 1 , FIFO_SYSTEM = 2 , FIFO_MAXMOD = 3 , FIFO_DSWIFI = 4 , FIFO_STORAGE = 5 , FIFO_FIRMWARE = 6 , FIFO_CAMERA = 7 , FIFO_USER_01 = 8 , FIFO_USER_02 = 9 , FIFO_USER_03 = 10 , FIFO_USER_04 = 11 , FIFO_USER_05 = 12 , FIFO_USER_06 = 13 , FIFO_USER_07 = 14 , FIFO_USER_08 = 15 , FIFO_SDMMC = 5 } |
Enum values for the different FIFO channels. More... | |
enum | FifoPMCommands |
Enum values for the FIFO power management commands. | |
enum | FifoSoundCommand |
Enum values for the FIFO sound commands. | |
enum | FifoSystemCommands |
Enum values for the FIFO system commands. | |
enum | FifoWifiCommands |
Enum values for the FIFO wifi commands. | |
enum | PM_LedBlinkMode { PM_LED_ON = 0 , PM_LED_SLEEP = 1 , PM_LED_BLINK = 3 } |
Power Management LED blink mode control bits. More... | |
Functions | |
bool | fifoCheckAddress (u32 channel) |
Checks if there are any address messages in the queue. | |
bool | fifoCheckDatamsg (u32 channel) |
Checks if there are any data messages in the queue. | |
int | fifoCheckDatamsgLength (u32 channel) |
Gets the size of the first message in the queue of a specific channel. | |
bool | fifoCheckValue32 (u32 channel) |
Checks if there are any value32 messages in the queue. | |
void * | fifoGetAddress (u32 channel) |
Gets the first address in the queue of a specific channel. | |
int | fifoGetDatamsg (u32 channel, int buffersize, u8 *destbuffer) |
Reads a data message in a given buffer. | |
u32 | fifoGetValue32 (u32 channel) |
Gets the first value32 in the queue of a specific channel. | |
bool | fifoInit (void) |
Initializes the FIFO system. | |
void | fifoMutexAcquire (u32 channel) |
Acquires the mutex of the specified FIFO channel. | |
void | fifoMutexRelease (u32 channel) |
Releases the mutex of the specified FIFO channel. | |
bool | fifoMutexTryAcquire (u32 channel) |
Tries to acquire the mutex of the specified FIFO channel. | |
bool | fifoSendAddress (u32 channel, void *address) |
Sends a main RAM address to the other CPU. | |
bool | fifoSendDatamsg (u32 channel, u32 num_bytes, u8 *data_array) |
Sends a sequence of bytes to the other CPU. | |
bool | fifoSendSpecialCommand (u32 cmd) |
Sends a special command to the other CPU. | |
bool | fifoSendValue32 (u32 channel, u32 value32) |
Sends a 32-bit value to the other CPU. | |
bool | fifoSetAddressHandler (u32 channel, FifoAddressHandlerFunc newhandler, void *userdata) |
Sets user address message callback. | |
bool | fifoSetDatamsgHandler (u32 channel, FifoDatamsgHandlerFunc newhandler, void *userdata) |
Sets user data message callback. | |
bool | fifoSetValue32Handler (u32 channel, FifoValue32HandlerFunc newhandler, void *userdata) |
Sets user value32 message callback. | |
static void | fifoWaitAddress (u32 channel) |
Waits for any address message in a FIFO channel and blocks until there is one available. | |
static void | fifoWaitAddressAsync (u32 channel) |
Waits for any address message in a FIFO channel and yields until there isn't one available. | |
static void | fifoWaitDatamsg (u32 channel) |
Waits for any data message in a FIFO channel and blocks until there is one available. | |
static void | fifoWaitDatamsgAsync (u32 channel) |
Waits for any data message in a FIFO channel and yields until there isn't one available. | |
static void | fifoWaitValue32 (u32 channel) |
Waits for any value32 message in a FIFO channel and blocks until there is one available. | |
static void | fifoWaitValue32Async (u32 channel) |
Waits for any value32 message in a FIFO channel and yields until there isn't one available. | |
Low level FIFO API.
typedef void(* FifoAddressHandlerFunc) (void *address, void *userdata) |
Callback that is called with the address sent from the other CPU and the callback's user data.
The handler is called when new data arrives.
typedef void(* FifoDatamsgHandlerFunc) (int num_bytes, void *userdata) |
Callback that is called with the number of bytes sent from the other CPU and the callback's user data.
The handler is called when new data arrives. This callback must call fifoGetDatamsg() to actually retrieve the data. If it doesn't, the data will be destroyed on return.
typedef void(* FifoValue32HandlerFunc) (u32 value32, void *userdata) |
Callback that is called with the 32-bit value sent from the other CPU and the callback's user data.
The handler is called when new data arrives.
enum FifoChannels |
Enum values for the different FIFO channels.
enum PM_LedBlinkMode |
bool fifoCheckAddress | ( | u32 | channel | ) |
Checks if there are any address messages in the queue.
channel | Channel number. |
bool fifoCheckDatamsg | ( | u32 | channel | ) |
Checks if there are any data messages in the queue.
channel | Channel number. |
int fifoCheckDatamsgLength | ( | u32 | channel | ) |
Gets the size of the first message in the queue of a specific channel.
channel | Channel number. |
bool fifoCheckValue32 | ( | u32 | channel | ) |
Checks if there are any value32 messages in the queue.
channel | Channel number. |
void * fifoGetAddress | ( | u32 | channel | ) |
Gets the first address in the queue of a specific channel.
channel | Channel number. |
Reads a data message in a given buffer.
channel | Channel number. |
buffersize | Size of the provided buffer. |
destbuffer | Pointer to the buffer to store the message. |
Gets the first value32 in the queue of a specific channel.
channel | Channel number. |
bool fifoInit | ( | void | ) |
Initializes the FIFO system.
Attempts to sync with the other CPU. If it fails, FIFO services won't be provided.
void fifoMutexAcquire | ( | u32 | channel | ) |
Acquires the mutex of the specified FIFO channel.
channel | Channel number. |
void fifoMutexRelease | ( | u32 | channel | ) |
Releases the mutex of the specified FIFO channel.
channel | Channel number. |
bool fifoMutexTryAcquire | ( | u32 | channel | ) |
Tries to acquire the mutex of the specified FIFO channel.
channel | Channel number. |
bool fifoSendAddress | ( | u32 | channel, |
void * | address | ||
) |
Sends a main RAM address to the other CPU.
channel | Channel number. |
address | Address to send (0x02000000-0x02FFFFFF). |
Sends a sequence of bytes to the other CPU.
channel | Channel number. |
num_bytes | Number of bytes to send (0 to FIFO_MAX_DATA_BYTES). |
data_array | Pointer to data array |
bool fifoSendSpecialCommand | ( | u32 | cmd | ) |
Sends a special command to the other CPU.
cmd | Command identifier. |
Sends a 32-bit value to the other CPU.
channel | Channel number. |
value32 | Value to send. |
bool fifoSetAddressHandler | ( | u32 | channel, |
FifoAddressHandlerFunc | newhandler, | ||
void * | userdata | ||
) |
Sets user address message callback.
Sets a callback to receive incoming address messages of a specific channel.
channel | Channel number. |
newhandler | Function pointer to the new handler. |
userdata | Pointer that will be passed on to the handler when it will be called (as "userdata"). |
bool fifoSetDatamsgHandler | ( | u32 | channel, |
FifoDatamsgHandlerFunc | newhandler, | ||
void * | userdata | ||
) |
Sets user data message callback.
Sets a callback to receive incoming data messages of a specific channel.
channel | Channel number. |
newhandler | Function pointer to the new handler. |
userdata | Pointer that will be passed on to the handler when it will be called (as "userdata"). |
bool fifoSetValue32Handler | ( | u32 | channel, |
FifoValue32HandlerFunc | newhandler, | ||
void * | userdata | ||
) |
Sets user value32 message callback.
Sets a callback to receive incoming value32 messages of a specific channel.
channel | Channel number. |
newhandler | Function pointer to the new handler. |
userdata | Pointer that will be passed on to the handler when it will be called (as "userdata"). |
|
inlinestatic |
Waits for any address message in a FIFO channel and blocks until there is one available.
channel | Channel number. |
|
inlinestatic |
Waits for any address message in a FIFO channel and yields until there isn't one available.
channel | Channel number. |
|
inlinestatic |
Waits for any data message in a FIFO channel and blocks until there is one available.
channel | Channel number. |
|
inlinestatic |
Waits for any data message in a FIFO channel and yields until there isn't one available.
channel | Channel number. |
|
inlinestatic |
Waits for any value32 message in a FIFO channel and blocks until there is one available.
channel | Channel number. |
|
inlinestatic |
Waits for any value32 message in a FIFO channel and yields until there isn't one available.
channel | Channel number. |