wiiuse
Functions
Internal: Event Utilities

Functions

void wiiuse_pressed_buttons (struct wiimote_t *wm, byte *msg)
 Find what buttons are pressed. More...
 
void handle_wm_accel (struct wiimote_t *wm, byte *msg)
 Handle accel data in a wiimote message. More...
 
int state_changed (struct wiimote_t *wm)
 Determine if the current state differs significantly from the previous. More...
 
void handshake_expansion (struct wiimote_t *wm, byte *data, uint16_t len)
 Handle the handshake data from the expansion device. More...
 
void disable_expansion (struct wiimote_t *wm)
 Disable the expansion device if it was enabled. More...
 
void propagate_event (struct wiimote_t *wm, byte event, byte *msg)
 Analyze the event that occurred on a wiimote. More...
 
void idle_cycle (struct wiimote_t *wm)
 Called on a cycle where no significant change occurs. More...
 
void clear_dirty_reads (struct wiimote_t *wm)
 Clear out all old 'dirty' read requests. More...
 

Detailed Description

Function Documentation

◆ clear_dirty_reads()

void clear_dirty_reads ( struct wiimote_t *  wm)

Clear out all old 'dirty' read requests.

Parameters
wmPointer to a wiimote_t structure.

◆ disable_expansion()

void disable_expansion ( struct wiimote_t *  wm)

Disable the expansion device if it was enabled.

Parameters
wmA pointer to a wiimote_t structure.
dataThe data read in from the device.
lenThe length of the data block, in bytes.

If the data is NULL then this function will try to start a handshake with the expansion.

◆ handle_wm_accel()

void handle_wm_accel ( struct wiimote_t *  wm,
byte *  msg 
)

Handle accel data in a wiimote message.

Parameters
wmPointer to a wiimote_t structure.
msgThe message specified in the event packet.

◆ handshake_expansion()

void handshake_expansion ( struct wiimote_t *  wm,
byte *  data,
uint16_t  len 
)

Handle the handshake data from the expansion device.

Parameters
wmA pointer to a wiimote_t structure.
dataThe data read in from the device.
lenThe length of the data block, in bytes.

Tries to determine what kind of expansion was attached and invoke the correct handshake function.

If the data is NULL then this function will try to start a handshake with the expansion.

◆ idle_cycle()

void idle_cycle ( struct wiimote_t *  wm)

Called on a cycle where no significant change occurs.

Parameters
wmPointer to a wiimote_t structure.

◆ propagate_event()

void propagate_event ( struct wiimote_t *  wm,
byte  event,
byte *  msg 
)

Analyze the event that occurred on a wiimote.

Parameters
wmPointer to a wiimote_t structure.
eventThe event that occurred.
msgThe message specified in the event packet.

Pass the event to the registered event callback.

◆ state_changed()

int state_changed ( struct wiimote_t *  wm)

Determine if the current state differs significantly from the previous.

Parameters
wmA pointer to a wiimote_t structure.
Returns
1 if a significant change occurred, 0 if not.

◆ wiiuse_pressed_buttons()

void wiiuse_pressed_buttons ( struct wiimote_t *  wm,
byte *  msg 
)

Find what buttons are pressed.

Parameters
wmPointer to a wiimote_t structure.
msgThe message specified in the event packet.