libdragon
Data Structures | Macros | Functions
joybus.c File Reference

Joybus Subsystem. More...

Data Structures

struct  joybus_msg_t
 A message to be sent to JoyBus, with its completion callback. More...
 

Macros

#define MAX_JOYBUS_MSGS   8
 Maximum number of pending joybus messages.
 
SI status register bit definitions
#define SI_STATUS_DMA_BUSY   ( 1 << 0 )
 SI DMA busy.
 
#define SI_STATUS_IO_BUSY   ( 1 << 1 )
 SI IO busy.
 
Joybus internal state machine values

#define JOYBUS_STATE_IDLE   0
 Joybus state: idle (no pending messages)
 
#define JOYBUS_STATE_SENDING   1
 JoyBus state: sending a message to PIF.
 
#define JOYBUS_STATE_RECEIVING   2
 JoyBus state: receiving a reply from PIF.
 

Functions

void __joybus_init (void)
 Initialize the joybus subsystem.
 
void joybus_exec_async (const void *input, void(*callback)(uint64_t *output, void *ctx), void *ctx)
 Execute an asynchronous joybus message. More...
 
void joybus_exec (const void *input, void *output)
 Write a 64-byte block of data to the PIF and read the 64-byte result. More...
 

Detailed Description

Joybus Subsystem.