[128] | 1 | /*
|
---|
| 2 | * Copyright (C) 2013-2014 by Embedded and Real-Time Systems Laboratory
|
---|
| 3 | * Graduate School of Information Science, Nagoya Univ., JAPAN
|
---|
| 4 | *
|
---|
| 5 | * $Id: rcb3.h 213 2014-09-02 11:48:58Z honda $
|
---|
| 6 | */
|
---|
| 7 |
|
---|
| 8 | #ifndef _RCB3_H_
|
---|
| 9 | #define _RCB3_H_
|
---|
| 10 |
|
---|
| 11 | /*
|
---|
| 12 | * RCB3d¶ðÍ
|
---|
| 13 | */
|
---|
| 14 | /*
|
---|
| 15 | * RCB3 Message format
|
---|
| 16 | */
|
---|
| 17 | #define RCB3_MSG_LEN 8
|
---|
| 18 | #define RCB3_MSG_HEADER_1 0x80
|
---|
| 19 |
|
---|
| 20 | #define RCB3_MSG_OFFSET_BUTTON_H 1
|
---|
| 21 | #define RCB3_MSG_OFFSET_BUTTON_L 2
|
---|
| 22 | #define RCB3_MSG_OFFSET_L_ANALOG_LR 3
|
---|
| 23 | #define RCB3_MSG_OFFSET_L_ANALOG_UD 4
|
---|
| 24 | #define RCB3_MSG_OFFSET_R_ANALOG_LR 5
|
---|
| 25 | #define RCB3_MSG_OFFSET_R_ANALOG_UD 6
|
---|
| 26 |
|
---|
| 27 | #define RCB3_MSG_BUTTON_UP 0x0001
|
---|
| 28 | #define RCB3_MSG_BUTTON_DOWN 0x0002
|
---|
| 29 | #define RCB3_MSG_BUTTON_LEFT 0x0004
|
---|
| 30 | #define RCB3_MSG_BUTTON_RIGHT 0x0008
|
---|
| 31 | #define RCB3_MSG_BUTTON_TRIANGLE 0x0010
|
---|
| 32 | #define RCB3_MSG_BUTTON_CROSS 0x0020
|
---|
| 33 | #define RCB3_MSG_BUTTON_NOUGHT 0x0040
|
---|
| 34 | #define RCB3_MSG_BUTTON_SQUARE 0x0100
|
---|
| 35 | #define RCB3_MSG_BUTTON_L1 0x0200
|
---|
| 36 | #define RCB3_MSG_BUTTON_L2 0x0400
|
---|
| 37 | #define RCB3_MSG_BUTTON_R1 0x0800
|
---|
| 38 | #define RCB3_MSG_BUTTON_R2 0x1000
|
---|
| 39 | #define RCB3_MSG_BUTTON_START 0x0003
|
---|
| 40 | #define RCB3_MSG_BUTTON_SELECT 0x000C
|
---|
| 41 |
|
---|
| 42 | #define RCB3_MSG_ANALOG_MAX 127
|
---|
| 43 | #define RCB3_MSG_ANALOG_MIN 1
|
---|
| 44 | #define RCB3_MSG_ANALOG_NEUTRAL 64
|
---|
| 45 |
|
---|
| 46 |
|
---|
| 47 | /*
|
---|
| 48 | * OóÔÆ»ÝóÔð¦·|C^
|
---|
| 49 | */
|
---|
| 50 | extern boolean *p_g_pre_ps3button;
|
---|
| 51 | extern boolean *p_g_cur_ps3button;
|
---|
| 52 | extern sint8 *p_g_pre_ps3analog;
|
---|
| 53 | extern sint8 *p_g_cur_ps3analog;
|
---|
| 54 | extern uint8 g_rcb3_rmsg[RCB3_MSG_LEN];
|
---|
| 55 |
|
---|
| 56 | /*
|
---|
| 57 | * e{^óÔÌÔ
|
---|
| 58 | */
|
---|
| 59 | #define NO_PS3BUTTON_UP 0
|
---|
| 60 | #define NO_PS3BUTTON_DOWN 1
|
---|
| 61 | #define NO_PS3BUTTON_LEFT 3
|
---|
| 62 | #define NO_PS3BUTTON_RIGHT 2
|
---|
| 63 | #define NO_PS3BUTTON_TRIANGLE 4
|
---|
| 64 | #define NO_PS3BUTTON_CROSS 5
|
---|
| 65 | #define NO_PS3BUTTON_NOUGHT 6
|
---|
| 66 | #define NO_PS3BUTTON_SQUARE 7
|
---|
| 67 | #define NO_PS3BUTTON_L1 8
|
---|
| 68 | #define NO_PS3BUTTON_L2 9
|
---|
| 69 | #define NO_PS3BUTTON_R1 10
|
---|
| 70 | #define NO_PS3BUTTON_R2 11
|
---|
| 71 | #define NO_PS3BUTTON_START 12
|
---|
| 72 | #define NO_PS3BUTTON_SELECT 13
|
---|
| 73 |
|
---|
| 74 | #define NO_PS3ANALOG_L_LR 0
|
---|
| 75 | #define NO_PS3ANALOG_L_UD 1
|
---|
| 76 | #define NO_PS3ANALOG_R_LR 2
|
---|
| 77 | #define NO_PS3ANALOG_R_UD 3
|
---|
| 78 |
|
---|
| 79 | /*
|
---|
| 80 | * ú»
|
---|
| 81 | */
|
---|
| 82 | void rcb3_Init(void);
|
---|
| 83 |
|
---|
| 84 |
|
---|
| 85 | /*
|
---|
| 86 | * RCB3R}hÌðÍ
|
---|
| 87 | *
|
---|
| 88 | * óMµ½1oCgÉøÉwèµÄÄÑo·D
|
---|
| 89 | * d¶ÌÅãÅTRUEðÔ·D
|
---|
| 90 | */
|
---|
| 91 | extern boolean rcb3_AddReceivedByte(uint8 c);
|
---|
| 92 |
|
---|
| 93 | #endif /* _RCB3_H_ */
|
---|