|
wiiuse
|
Functions | |
| void | wiiuse_handshake (struct wiimote_t *wm, byte *data, uint16_t len) |
| Get initialization data from the wiimote. More... | |
| int | wiiuse_wait_report (struct wiimote_t *wm, int report, byte *buffer, int bufferLength, unsigned long timeout_ms) |
| Wait until specified report arrives and return it. More... | |
| void | wiiuse_read_data_sync (struct wiimote_t *wm, byte memory, unsigned addr, unsigned short size, byte *data) |
| Read memory/register data synchronously. More... | |
| void | wiiuse_init_platform_fields (struct wiimote_t *wm) |
| void | wiiuse_cleanup_platform_fields (struct wiimote_t *wm) |
| int | wiiuse_os_find (struct wiimote_t **wm, int max_wiimotes, int timeout) |
| int | wiiuse_os_connect (struct wiimote_t **wm, int wiimotes) |
| void | wiiuse_os_disconnect (struct wiimote_t *wm) |
| int | wiiuse_os_poll (struct wiimote_t **wm, int wiimotes) |
| int | wiiuse_os_read (struct wiimote_t *wm, byte *buf, int len) |
| int | wiiuse_os_write (struct wiimote_t *wm, byte report_type, byte *buf, int len) |
| unsigned long | wiiuse_os_ticks () |
| void wiiuse_handshake | ( | struct wiimote_t * | wm, |
| byte * | data, | ||
| uint16_t | len | ||
| ) |
Get initialization data from the wiimote.
| wm | Pointer to a wiimote_t structure. |
| data | unused |
| len | unused |
When first called for a wiimote_t structure, a request is sent to the wiimote for initialization information. This includes factory set accelerometer data. The handshake will be concluded when the wiimote responds with this data.
| void wiiuse_read_data_sync | ( | struct wiimote_t * | wm, |
| byte | memory, | ||
| unsigned | addr, | ||
| unsigned short | size, | ||
| byte * | data | ||
| ) |
Read memory/register data synchronously.
| wm | Pointer to a wiimote_t structure. |
| memory | If set to non-zero, reads EEPROM, otherwise registers |
| addr | Address offset to read from |
| size | How many bytes to read |
| data | Pre-allocated memory to store the received data |
Synchronous/blocking read, this function will not return until it receives the specified amount of data from the Wiimote.
| int wiiuse_wait_report | ( | struct wiimote_t * | wm, |
| int | report, | ||
| byte * | buffer, | ||
| int | bufferLength, | ||
| unsigned long | timeout_ms | ||
| ) |
Wait until specified report arrives and return it.
| wm | Pointer to a wiimote_t structure. |
| buffer | Pre-allocated memory to store the received data |
| bufferLength | size of buffer in bytes |
| timeout_ms | timeout in ms, 0 = wait forever |
Synchronous/blocking, this function will not return until it receives the specified report from the Wiimote or timeout occurs.
Returns 1 on success, -1 on failure.
1.8.13