libnds
|
low level FIFO API. More...
Typedefs | |
typedef void(* | FifoAddressHandlerFunc) (void *address, void *userdata) |
fifo callback function pointer with the sent address and the callback's user data. More... | |
typedef void(* | FifoDatamsgHandlerFunc) (int num_bytes, void *userdata) |
fifo callback function pointer with the number of bytes sent and the callback's user data More... | |
typedef void(* | FifoValue32HandlerFunc) (u32 value32, void *userdata) |
fifo callback function pointer with the sent value and the callback's user data. More... | |
Enumerations |
Functions | |
bool | fifoCheckAddress (int channel) |
checks if there is any addresses in the fifo queue. More... | |
bool | fifoCheckDatamsg (int channel) |
checks if there is any data messages in the fifo queue. More... | |
int | fifoCheckDatamsgLength (int channel) |
gets the number of bytes in the queue for the first data entry. More... | |
bool | fifoCheckValue32 (int channel) |
checks if there is any values in the fifo queue. More... | |
void * | fifoGetAddress (int channel) |
Get the first address in queue for a specific channel. More... | |
int | fifoGetDatamsg (int channel, int buffersize, u8 *destbuffer) |
Reads a data message in a given buffer and returns the number of bytes written. More... | |
u32 | fifoGetValue32 (int channel) |
Get the first value32 in queue for a specific channel. More... | |
bool | fifoInit () |
Initializes the fifo system. More... | |
bool | fifoSendAddress (int channel, void *address) |
Send an address to an channel. More... | |
bool | fifoSendDatamsg (int channel, int num_bytes, u8 *data_array) |
Send a sequence of bytes to the other CPU. More... | |
bool | fifoSendValue32 (int channel, u32 value32) |
Send a 32bit value. More... | |
bool | fifoSetAddressHandler (int channel, FifoAddressHandlerFunc newhandler, void *userdata) |
Set user address message callback. More... | |
bool | fifoSetDatamsgHandler (int channel, FifoDatamsgHandlerFunc newhandler, void *userdata) |
Set user data message callback. More... | |
bool | fifoSetValue32Handler (int channel, FifoValue32HandlerFunc newhandler, void *userdata) |
Set user value32 message callback. More... | |
static void | fifoWaitValue32 (int channel) |
waits for any data messages in the fifo queue. More... | |
low level FIFO API.
typedef void(* FifoAddressHandlerFunc) (void *address, void *userdata) |
fifo callback function pointer with the sent address and the callback's user data.
The handler is called when new data arrives.
typedef void(* FifoDatamsgHandlerFunc) (int num_bytes, void *userdata) |
fifo callback function pointer with the number of bytes sent and the callback's user data
The handler is called when new data arrives. This callback must call fifoGetData to actually retrieve the data. If it doesn't, the data will be destroyed on return.
typedef void(* FifoValue32HandlerFunc) (u32 value32, void *userdata) |
fifo callback function pointer with the sent value 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 | ( | int | channel | ) |
checks if there is any addresses in the fifo queue.
channel | the channel to check. |
bool fifoCheckDatamsg | ( | int | channel | ) |
checks if there is any data messages in the fifo queue.
channel | the channel to check. |
int fifoCheckDatamsgLength | ( | int | channel | ) |
gets the number of bytes in the queue for the first data entry.
channel | the channel to check. |
bool fifoCheckValue32 | ( | int | channel | ) |
checks if there is any values in the fifo queue.
channel | the channel to check. |
void* fifoGetAddress | ( | int | channel | ) |
Get the first address in queue for a specific channel.
channel | the channel to check. |
int fifoGetDatamsg | ( | int | channel, |
int | buffersize, | ||
u8 * | destbuffer | ||
) |
Reads a data message in a given buffer and returns the number of bytes written.
channel | the channel to check. |
buffersize | the size of the buffer where the message will be copied to. |
destbuffer | a pointer to the buffer where the message will be copied to. |
u32 fifoGetValue32 | ( | int | channel | ) |
Get the first value32 in queue for a specific channel.
channel | the channel to check. |
bool fifoInit | ( | ) |
Initializes the fifo system.
Attempts to sync with the other CPU, if it fails, fifo services won't be provided.
bool fifoSendAddress | ( | int | channel, |
void * | address | ||
) |
Send an address to an channel.
Transmits an address in the range 0x02000000-0x023FFFFF to the other CPU.
channel | channel number to send to. |
address | address to send. |
bool fifoSendDatamsg | ( | int | channel, |
int | num_bytes, | ||
u8 * | data_array | ||
) |
Send a sequence of bytes to the other CPU.
num_bytes can be between 0 and FIFO_MAX_DATA_BYTES - sending 0 bytes can be useful sometimes...
channel | channel number to send to |
num_bytes | number of bytes to send |
data_array | pointer to data array |
bool fifoSendValue32 | ( | int | channel, |
u32 | value32 | ||
) |
Send a 32bit value.
Transmits a 32bit value to the other CPU.
channel | channel number to send to |
value32 | 32bit value to send |
bool fifoSetAddressHandler | ( | int | channel, |
FifoAddressHandlerFunc | newhandler, | ||
void * | userdata | ||
) |
Set user address message callback.
Set a callback to receive incoming address messages on a specific channel.
channel | channel number to send to. |
newhandler | a function pointer to the new handler function. |
userdata | a pointer that will be passed on to the handler when it will be called. |
bool fifoSetDatamsgHandler | ( | int | channel, |
FifoDatamsgHandlerFunc | newhandler, | ||
void * | userdata | ||
) |
Set user data message callback.
Set a callback to receive incoming data messages on a specific channel.
channel | channel number to send to. |
newhandler | a function pointer to the new handler function. |
userdata | a pointer that will be passed on to the handler when it will be called. |
bool fifoSetValue32Handler | ( | int | channel, |
FifoValue32HandlerFunc | newhandler, | ||
void * | userdata | ||
) |
Set user value32 message callback.
Set a callback to receive incoming value32 messages on a specific channel.
channel | channel number to send to. |
newhandler | a function pointer to the new handler function. |
userdata | a pointer that will be passed on to the handler when it will be called. |
|
inlinestatic |
waits for any data messages in the fifo queue.
channel | the channel to check. |