1 /*---------------------------------------------------------------------------*
2   Project:  WPAD
3   File:     wpadBulk.h
4 
5   Copyright (C) 2008-2011 Nintendo.  All rights reserved.
6 
7   These coded instructions, statements, and computer programs contain
8   proprietary information of Nintendo of America Inc. and/or Nintendo
9   Company Ltd., and are protected by Federal copyright law.  They may
10   not be disclosed to third parties or copied or duplicated in any form,
11   in whole or in part, without the prior written consent of Nintendo.
12 
13  *---------------------------------------------------------------------------*/
14 
15 #ifndef __WPAD_BULK_H__
16 #define __WPAD_BULK_H__
17 
18 #include <cafe/pads/wpad/wpad.h>
19 
20 #ifdef __cplusplus
21 extern "C" {
22 #endif
23 
24 #define WPAD_DEV_BULK_01          21
25 #define WPAD_DEV_BULK_02          22
26 #define WPAD_DEV_BULK_03          23
27 #define WPAD_DEV_BULK_04          24
28 #define WPAD_DEV_BULK_05          25
29 #define WPAD_DEV_BULK_06          26
30 #define WPAD_DEV_BULK_07          27
31 #define WPAD_DEV_BULK_08          28
32 
33 #define WPAD_IS_BULK_DEVICE(x)      ( x == WPAD_DEV_BULK_01 \
34                                    || x == WPAD_DEV_BULK_02 \
35                                    || x == WPAD_DEV_BULK_03 \
36                                    || x == WPAD_DEV_BULK_04 \
37                                    || x == WPAD_DEV_BULK_05 \
38                                    || x == WPAD_DEV_BULK_06 \
39                                    || x == WPAD_DEV_BULK_07 \
40                                    || x == WPAD_DEV_BULK_08 )
41 
42 // data format of Core + Acc + Bulk
43 #define WPAD_FMT_BULK             19    // buttons, acc, Bulk
44 
45 #define WPAD_MAX_BULK_BUFS        21
46 
47 typedef struct WPADBKStatus
48 {
49     u16       button;               // Or-ed WPAD_BUTTON_* bits
50     s16       accX;                 // -WPAD_ACC_RESO/2 <= accX < WPAD_ACC_RESO/2
51     s16       accY;                 // -WPAD_ACC_RESO/2 <= accY < WPAD_ACC_RESO/2
52     s16       accZ;                 // -WPAD_ACC_RESO/2 <= accZ < WPAD_ACC_RESO/2
53     DPDObject obj[WPAD_DPD_MAX_OBJECTS];
54 
55     u8        dev;                  // one of WPAD_DEV_* number
56     s8        err;                  // one of WPAD_ERR_* number
57 
58     u8        bulk[WPAD_MAX_BULK_BUFS];// buffer for additional data(21 bytes)
59     u8        padding;
60 
61 } WPADBKStatus;
62 
63 #ifdef __cplusplus
64 }
65 #endif
66 #endif // __WPAD_BULK_H__
67