ronelib
Operating System for the r-one robot
 All Data Structures Files Functions Variables Typedefs
remoteControl.h
Go to the documentation of this file.
1 
17 #ifndef REMOTECONTROL_H_
18 #define REMOTECONTROL_H_
19 
20 #define JOYSTICK_BUTTON_NONE 0
21 #define JOYSTICK_BUTTON_TOP 1
22 #define JOYSTICK_BUTTON_MIDDLE 2
23 #define JOYSTICK_BUTTON_BOTTOM 4
24 
25 #define REMOTE_CONTROL_JOYSTICK_NUM 3
26 
30 typedef struct Joystick{
31  int8 x;
32  int8 y;
33  int8 buttons;
34 } Joystick;
35 
36 
37 
42 void remoteControlInit();
43 
44 //TODO: delete from h file?
45 //void remoteControlSendMsg(int32 TVcmd, int32 RVcmd, uint8 team);
46 
52 void remoteControlSendMsgAccel(uint8 team);
53 
54 
59 boolean remoteControlIsSerialHost(void);
60 
61 Beh* behRemoteControl(Beh* behPtr, uint8 joystickNum);
62 
63 Beh* behRemoteControlCompass(Beh* behPtr, Joystick* joystickPtr, Nbr* nbrNavTowerLowPtr, Nbr* nbrNavTowerHighPtr);
64 
65 //TODO move this to a thread or callback
66 void remoteControlUpdateJoysticks(void);
67 
68 
69 
70 Joystick* remoteControlGetJoystick(uint8 joystickNum);
71 
72 boolean remoteControlJoystickIsActive(uint8 joystickNum, uint32 timeOut);
73 
74 int32 deadzone(int32 val, int32 deadzone);
75 void remoteControlAccelRemote(RadioCmd* radioCmdPtr);
76 //void remoteControlSendMessage(RadioCmd* radioCmdPtr, int32 tv, int32 rv);
77 void remoteControlSendDemoMode(RadioCmd* radioCmdPtr, uint8 demoModeXmit);
78 Beh* behRadioControl(RadioCmd* radioCmdPtr, Beh* behPtr, uint8* demoModePtr);
79 
80 #endif /* REMOTECONTROL_H_ */