mirror of
https://github.com/felis/USB_Host_Shield_2.0.git
synced 2024-03-22 11:31:26 +01:00
Updated comments - especially in BTHID.h
This commit is contained in:
parent
14fda1372c
commit
8ae6f8bb1d
4 changed files with 22 additions and 15 deletions
2
BTD.h
2
BTD.h
|
@ -286,7 +286,7 @@ public:
|
|||
*/
|
||||
virtual boolean DEVCLASSOK(uint8_t klass) {
|
||||
return (klass == USB_CLASS_WIRELESS_CTRL);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Used by the USB core to check what this driver support.
|
||||
|
|
25
BTHID.h
25
BTHID.h
|
@ -42,11 +42,11 @@ public:
|
|||
* @param ACLData Incoming acldata.
|
||||
*/
|
||||
virtual void ACLData(uint8_t* ACLData);
|
||||
/** Used to run part of the state maschine. */
|
||||
/** Used to run part of the state machine. */
|
||||
virtual void Run();
|
||||
/** Use this to reset the service. */
|
||||
virtual void Reset();
|
||||
/** Used this to disconnect any of the controllers. */
|
||||
/** Used this to disconnect the devices. */
|
||||
virtual void disconnect();
|
||||
|
||||
/**@}*/
|
||||
|
@ -60,24 +60,31 @@ public:
|
|||
return true;
|
||||
};
|
||||
|
||||
/**
|
||||
* Set HID protocol mode.
|
||||
* @param mode HID protocol to use. Either HID_BOOT_PROTOCOL or HID_RPT_PROTOCOL.
|
||||
*/
|
||||
void setProtocolMode(uint8_t mode) {
|
||||
protocolMode = mode;
|
||||
};
|
||||
|
||||
/** Used to set the leds on a keyboard */
|
||||
/**
|
||||
* Used to set the leds on a keyboard.
|
||||
* @param data See KBDLEDS in hidboot.h
|
||||
*/
|
||||
void setLeds(uint8_t data);
|
||||
|
||||
/** True if a device is connected */
|
||||
bool connected;
|
||||
|
||||
/** Call this to start the paring sequence with a controller */
|
||||
/** Call this to start the paring sequence with a device */
|
||||
void pair(void) {
|
||||
if(pBtd)
|
||||
pBtd->pairWithHID();
|
||||
};
|
||||
|
||||
/**
|
||||
* Used to call your own function when the controller is successfully initialized.
|
||||
* Used to call your own function when the device is successfully initialized.
|
||||
* @param funcOnInit Function to call.
|
||||
*/
|
||||
void attachOnInit(void (*funcOnInit)(void)) {
|
||||
|
@ -87,28 +94,28 @@ public:
|
|||
private:
|
||||
BTD *pBtd; // Pointer to BTD instance
|
||||
|
||||
HIDReportParser *pRptParser[NUM_PARSERS];
|
||||
HIDReportParser *pRptParser[NUM_PARSERS]; // Pointer to HIDReportParsers.
|
||||
|
||||
/** Set report protocol. */
|
||||
void setProtocol();
|
||||
uint8_t protocolMode;
|
||||
|
||||
/**
|
||||
* Called when the controller is successfully initialized.
|
||||
* Called when a device is successfully initialized.
|
||||
* Use attachOnInit(void (*funcOnInit)(void)) to call your own function.
|
||||
* This is useful for instance if you want to set the LEDs in a specific way.
|
||||
*/
|
||||
void onInit() {
|
||||
if(pFuncOnInit)
|
||||
pFuncOnInit(); // Call the user function
|
||||
}
|
||||
};
|
||||
void (*pFuncOnInit)(void); // Pointer to function called in onInit()
|
||||
|
||||
void L2CAP_task(); // L2CAP state machine
|
||||
|
||||
/* Variables filled from HCI event management */
|
||||
uint16_t hci_handle;
|
||||
bool activeConnection; // Used to indicate if it's already has established a connection
|
||||
bool activeConnection; // Used to indicate if it already has established a connection
|
||||
|
||||
/* Variables used by high level L2CAP task */
|
||||
uint8_t l2cap_state;
|
||||
|
|
4
PS3BT.h
4
PS3BT.h
|
@ -46,7 +46,7 @@ public:
|
|||
* @param ACLData Incoming acldata.
|
||||
*/
|
||||
virtual void ACLData(uint8_t* ACLData);
|
||||
/** Used to run part of the state maschine. */
|
||||
/** Used to run part of the state machine. */
|
||||
virtual void Run();
|
||||
/** Use this to reset the service. */
|
||||
virtual void Reset();
|
||||
|
@ -147,7 +147,7 @@ public:
|
|||
/** Turn all LEDs off. */
|
||||
void setLedOff() {
|
||||
setLedRaw(0);
|
||||
}
|
||||
};
|
||||
/**
|
||||
* Turn the specific ::LED off.
|
||||
* @param a The ::LED to turn off.
|
||||
|
|
6
Wii.h
6
Wii.h
|
@ -63,7 +63,7 @@ public:
|
|||
* @param ACLData Incoming acldata.
|
||||
*/
|
||||
virtual void ACLData(uint8_t* ACLData);
|
||||
/** Used to run part of the state maschine. */
|
||||
/** Used to run part of the state machine. */
|
||||
virtual void Run();
|
||||
/** Use this to reset the service. */
|
||||
virtual void Reset();
|
||||
|
@ -90,7 +90,7 @@ public:
|
|||
void pair(void) {
|
||||
if(pBtd)
|
||||
pBtd->pairWithWiimote();
|
||||
}
|
||||
};
|
||||
/**
|
||||
* Used to read the joystick of the Nunchuck.
|
||||
* @param a Either ::HatX or ::HatY.
|
||||
|
@ -152,7 +152,7 @@ public:
|
|||
/** Turn all LEDs off. */
|
||||
void setLedOff() {
|
||||
setLedRaw(0);
|
||||
}
|
||||
};
|
||||
/**
|
||||
* Turn the specific ::LED off.
|
||||
* @param a The ::LED to turn off.
|
||||
|
|
Loading…
Reference in a new issue