1 /*---------------------------------------------------------------------------*
2   Project:  Revolution OS - WPAD
3   File:     wpadBulk.h
4 
5   Copyright 2008 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   $Log: wpadBulk.h,v $
14   Revision 1.1.2.4  2009/12/10 07:35:54  tojo
15   Added 1byte padding.
16 
17   Revision 1.1.2.3  2009/12/10 06:27:52  tojo
18   Cleaned up.
19 
20   Revision 1.1.2.2  2009/12/09 07:09:08  yasuda_shumpei
21   Add DPDObject to WPADBKStatus.
22 
23   Revision 1.1.2.1  2009/12/03 10:36:23  yasuda_shumpei
24   Initial Check-in.
25 
26 
27 
28   $NoKeywords: $
29  *---------------------------------------------------------------------------*/
30 
31 #ifndef __WPAD_BULK_H__
32 #define __WPAD_BULK_H__
33 
34 #include <revolution/wpad.h>
35 
36 #ifdef __cplusplus
37 extern "C" {
38 #endif
39 
40 #define WPAD_DEV_BULK_01          21
41 #define WPAD_DEV_BULK_02          22
42 #define WPAD_DEV_BULK_03          23
43 #define WPAD_DEV_BULK_04          24
44 #define WPAD_DEV_BULK_05          25
45 #define WPAD_DEV_BULK_06          26
46 #define WPAD_DEV_BULK_07          27
47 #define WPAD_DEV_BULK_08          28
48 
49 #define WPAD_IS_BULK_DEVICE(x)      ( x == WPAD_DEV_BULK_01 \
50                                    || x == WPAD_DEV_BULK_02 \
51                                    || x == WPAD_DEV_BULK_03 \
52                                    || x == WPAD_DEV_BULK_04 \
53                                    || x == WPAD_DEV_BULK_05 \
54                                    || x == WPAD_DEV_BULK_06 \
55                                    || x == WPAD_DEV_BULK_07 \
56                                    || x == WPAD_DEV_BULK_08 )
57 
58 // data format of Core + Acc + Bulk
59 #define WPAD_FMT_BULK             19    // buttons, acc, Bulk
60 
61 #define WPAD_MAX_BULK_BUFS        21
62 
63 typedef struct WPADBKStatus
64 {
65     u16       button;               // Or-ed WPAD_BUTTON_* bits
66     s16       accX;                 // -WPAD_ACC_RESO/2 <= accX < WPAD_ACC_RESO/2
67     s16       accY;                 // -WPAD_ACC_RESO/2 <= accY < WPAD_ACC_RESO/2
68     s16       accZ;                 // -WPAD_ACC_RESO/2 <= accZ < WPAD_ACC_RESO/2
69     DPDObject obj[WPAD_DPD_MAX_OBJECTS];
70 
71     u8        dev;                  // one of WPAD_DEV_* number
72     s8        err;                  // one of WPAD_ERR_* number
73 
74     u8        bulk[WPAD_MAX_BULK_BUFS];// buffer for additional data(21 bytes)
75     u8        padding;
76 
77 } WPADBKStatus;
78 
79 #ifdef __cplusplus
80 }
81 #endif
82 #endif // __WPAD_BULK_H__
83