summaryrefslogtreecommitdiff
path: root/src/class/hid
diff options
context:
space:
mode:
authorhathach <[email protected]>2018-07-24 00:45:07 +0700
committerhathach <[email protected]>2018-07-24 00:45:07 +0700
commit3400dfdf4ea478894b2a96ac0bd27868c052fbeb (patch)
treedd125486da17644a8929da89fec079a47f3757af /src/class/hid
parent546f2a1165555819bf3ef09fe1afcfbcbb084dd9 (diff)
nrf52840 boot mouse does not work, need more work
Diffstat (limited to 'src/class/hid')
-rw-r--r--src/class/hid/hid.h9
-rw-r--r--src/class/hid/hid_device.c2
-rw-r--r--src/class/hid/hid_device.h8
3 files changed, 11 insertions, 8 deletions
diff --git a/src/class/hid/hid.h b/src/class/hid/hid.h
index c898b09d4..9872172a9 100644
--- a/src/class/hid/hid.h
+++ b/src/class/hid/hid.h
@@ -167,14 +167,17 @@ typedef struct ATTR_PACKED
int8_t x; /**< Current delta x movement of the mouse. */
int8_t y; /**< Current delta y movement on the mouse. */
int8_t wheel; /**< Current delta wheel movement on the mouse. */
+// int8_t pan;
} hid_mouse_report_t;
/// Standard Mouse Buttons Bitmap
typedef enum
{
- MOUSE_BUTTON_LEFT = BIT_(0), ///< Left button
- MOUSE_BUTTON_RIGHT = BIT_(1), ///< Right button
- MOUSE_BUTTON_MIDDLE = BIT_(2) ///< Middle button
+ MOUSE_BUTTON_LEFT = BIT_(0), ///< Left button
+ MOUSE_BUTTON_RIGHT = BIT_(1), ///< Right button
+ MOUSE_BUTTON_MIDDLE = BIT_(2), ///< Middle button
+ MOUSE_BUTTON_BACKWARD = BIT_(3), ///< Backward button,
+ MOUSE_BUTTON_FORWARD = BIT_(4), ///< Forward button,
}hid_mouse_button_bm_t;
/// @}
diff --git a/src/class/hid/hid_device.c b/src/class/hid/hid_device.c
index 7aca8ef8e..1efceafd0 100644
--- a/src/class/hid/hid_device.c
+++ b/src/class/hid/hid_device.c
@@ -167,7 +167,7 @@ bool tud_hid_mouse_busy(void)
return dcd_edpt_busy(TUD_OPT_RHPORT, _mse_itf.ep_in);
}
-bool tud_hid_mouse_send(hid_mouse_report_t const *p_report)
+bool tud_hid_mouse_send_report(hid_mouse_report_t const *p_report)
{
VERIFY( tud_mounted() && !tud_hid_mouse_busy() );
diff --git a/src/class/hid/hid_device.h b/src/class/hid/hid_device.h
index 21561041a..1293d212d 100644
--- a/src/class/hid/hid_device.h
+++ b/src/class/hid/hid_device.h
@@ -65,7 +65,7 @@ bool tud_hid_keyboard_busy(void);
/** \brief Send a keyboard report
* \param[in,out] p_report Report data, if NULL, an empty report (all zeroes) is used
- * \returns true on success, false otherwise (not mounted or busy)
+ * \returns true on success, false otherwise (not mounted or busy)
*/
bool tud_hid_keyboard_send_report(hid_keyboard_report_t const *p_report);
@@ -127,10 +127,10 @@ ATTR_WEAK void tud_hid_keyboard_set_report_cb(hid_report_type_t report_type, uin
bool tud_hid_mouse_busy(void);
/** \brief Perform transfer queuing
- * \param[in,out] p_report address that is used to store data from device. Must be accessible by usb controller (see \ref CFG_TUSB_ATTR_USBRAM)
- * \returns true on success, false otherwise (not mounted or busy)
+ * \param[in,out] p_report Report data, if NULL, an empty report (all zeroes) is used
+ * \returns true on success, false otherwise (not mounted or busy)
*/
-bool tud_hid_mouse_send(hid_mouse_report_t const *p_report);
+bool tud_hid_mouse_send_report(hid_mouse_report_t const *p_report);
/*------------- Callbacks -------------*/