#include <revolution/kpad.h>
typedef struct KPADUnifiedWpadStatus {
union {
WPADStatus core;
WPADFSStatus fs;
WPADCLStatus cl;
} u;
u8 fmt;
u8 padding;
} KPADUnifiedWpadStatus;
void KPADGetUnifiedWpadStatus( s32 chan,
KPADUnifiedWpadStatus *dst,
u32 count ) ;
chan |
one of the WPAD_CHANn values. |
dst |
Pointer to the buffer that stores the controller data |
count |
Number of stored data. This value cannot exceed KPAD_RING_BUFS. |
None.
Copies the controller data stored in the internal buffer by the KPAD library to an application created buffer.
Regardless of the number of data actually completed sampling in the KPAD library, the number of stored data will always be that specified by count. The top most element will be the newest sampling data.
Note: This function will not decrement the "number of sampling completed data" counter in the KPAD library. The KPADRead function decrements the counter to prevent repeat use of data already processed.
Using the KPADRead function return value immediately preceding this will give a number close to the actual sampling completed data count. However, there is a chance of a controller data sampling (interrupt) after a KPADRead function call. If you wish to use the exact same number of data or wish to obtain the same data processed by an immediately preceding KPADRead function, KPADRead and this function need to be called in interrupt prohibited state.
The application should reference the copied data through the following method. For error status and controller type definitions, see the WPADStatus structure description.
u.core.err). The offset of this member is shared and can be checked, regardless of whether the external extension controller is connected.
WPAD_ERR_NONE, sampling completed data is stored in the member u. Even if the value is not WPAD_ERR_NONE, some of the data may be properly sampled.
u.core.dev). The offset of this member is also shared regardless of whether the external extension controller is connected.
fmt). The WPADGetDataFormat function return value at sampling is stored in a u8 type.
KPADUnifiedWpadStatus
KPADRead
WPADStatus
WPADFSStatus
WPADCLStatus
2006/10/25 Initial version.
CONFIDENTIAL