First Release

Dependencies:   USBDevice

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers Out_PS3USB.h Source File

Out_PS3USB.h

00001 /** Class: Out_PS3USB
00002  *
00003  * Output class for PlayStation3 USB Joystick
00004  *
00005  */
00006 
00007 #include "mbed.h"
00008 #include "InputStatus.h"
00009 #include "USBJoystick.h"
00010 
00011 class Out_PS3USB
00012 {
00013 public:
00014     /** Constructor: Out_PS3USB
00015      *
00016      * Parameters:
00017      * inputStatus  - Input status
00018      */
00019 
00020     Out_PS3USB(InputStatus *inputStatus);
00021 
00022 private:
00023     // Private constants
00024     static const int USBUPDATEINTERVAL__MSEC = 10;
00025     
00026     // mbed pins
00027 
00028     // Variable
00029     InputStatus *_InputStatus;
00030     USBJoystick *_MyJS;
00031     Ticker      _USBUpdateTicker;
00032     
00033     // Private Method
00034     void Initialize(void);
00035     void USBUpdate(void);
00036 //    void InitInterruptPriority(void);
00037 
00038 
00039 
00040 // for InputControll
00041 public:
00042     void SetupInputControll(void (*startInputFunction)(void), void (*stopInputFunction)(void));
00043     class CDummy;
00044     template<class T>
00045     void SetupInputControll(T* inputInstance, void (T::*startInputMethod)(void), void (T::*stopInputMethod)(void))
00046     {
00047         _InputInstance    = (CDummy*) inputInstance;
00048         StartInputMethod = (void (CDummy::*)(void)) startInputMethod;
00049         StopInputMethod  = (void (CDummy::*)(void)) stopInputMethod;
00050     }
00051 
00052 private:
00053     CDummy*         _InputInstance;
00054     void (CDummy::*StartInputMethod)(void);
00055     void (CDummy::*StopInputMethod)(void);
00056     void (*StartInputFunction)(void);
00057     void (*StopInputFunction)(void);
00058     void EnableInput(void);
00059     void DisableInput(void);
00060 
00061 };
00062 
00063