mirror of
https://github.com/hathach/tinyusb.git
synced 2025-03-25 23:38:06 +00:00
more API rename
This commit is contained in:
parent
f1148ca5ac
commit
68fa17e17c
@ -257,7 +257,7 @@ void hid_task(void)
|
|||||||
uint8_t const addr = 1;
|
uint8_t const addr = 1;
|
||||||
|
|
||||||
#if CFG_TUH_HID_KEYBOARD
|
#if CFG_TUH_HID_KEYBOARD
|
||||||
if ( tuh_hid_keyboard_is_mounted(addr) )
|
if ( tuh_hid_keyboard_mounted(addr) )
|
||||||
{
|
{
|
||||||
if ( !tuh_hid_keyboard_is_busy(addr) )
|
if ( !tuh_hid_keyboard_is_busy(addr) )
|
||||||
{
|
{
|
||||||
@ -268,7 +268,7 @@ void hid_task(void)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if CFG_TUH_HID_MOUSE
|
#if CFG_TUH_HID_MOUSE
|
||||||
if ( tuh_hid_mouse_is_mounted(addr) )
|
if ( tuh_hid_mouse_mounted(addr) )
|
||||||
{
|
{
|
||||||
if ( !tuh_hid_mouse_is_busy(addr) )
|
if ( !tuh_hid_mouse_is_busy(addr) )
|
||||||
{
|
{
|
||||||
|
@ -50,7 +50,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
//--------------------------------------------------------------------+
|
//--------------------------------------------------------------------+
|
||||||
// Application API (Multiple Ports)
|
// Application API (Multiple Instances)
|
||||||
// CFG_TUD_HID > 1
|
// CFG_TUD_HID > 1
|
||||||
//--------------------------------------------------------------------+
|
//--------------------------------------------------------------------+
|
||||||
|
|
||||||
@ -76,7 +76,7 @@ bool tud_hid_n_mouse_report(uint8_t itf, uint8_t report_id, uint8_t buttons, int
|
|||||||
bool tud_hid_n_gamepad_report(uint8_t itf, uint8_t report_id, int8_t x, int8_t y, int8_t z, int8_t rz, int8_t rx, int8_t ry, uint8_t hat, uint16_t buttons);
|
bool tud_hid_n_gamepad_report(uint8_t itf, uint8_t report_id, int8_t x, int8_t y, int8_t z, int8_t rz, int8_t rx, int8_t ry, uint8_t hat, uint16_t buttons);
|
||||||
|
|
||||||
//--------------------------------------------------------------------+
|
//--------------------------------------------------------------------+
|
||||||
// Application API (Single Port)
|
// Application API (Single Instance)
|
||||||
//--------------------------------------------------------------------+
|
//--------------------------------------------------------------------+
|
||||||
static inline bool tud_hid_ready(void);
|
static inline bool tud_hid_ready(void);
|
||||||
static inline bool tud_hid_boot_mode(void);
|
static inline bool tud_hid_boot_mode(void);
|
||||||
|
@ -113,7 +113,7 @@ tusb_error_t hidh_interface_get_report(uint8_t dev_addr, void * report, hidh_int
|
|||||||
static hidh_interface_t keyboardh_data[CFG_TUSB_HOST_DEVICE_MAX]; // does not have addr0, index = dev_address-1
|
static hidh_interface_t keyboardh_data[CFG_TUSB_HOST_DEVICE_MAX]; // does not have addr0, index = dev_address-1
|
||||||
|
|
||||||
//------------- KEYBOARD PUBLIC API (parameter validation required) -------------//
|
//------------- KEYBOARD PUBLIC API (parameter validation required) -------------//
|
||||||
bool tuh_hid_keyboard_is_mounted(uint8_t dev_addr)
|
bool tuh_hid_keyboard_mounted(uint8_t dev_addr)
|
||||||
{
|
{
|
||||||
return tuh_device_is_configured(dev_addr) && (keyboardh_data[dev_addr-1].ep_in != 0);
|
return tuh_device_is_configured(dev_addr) && (keyboardh_data[dev_addr-1].ep_in != 0);
|
||||||
}
|
}
|
||||||
@ -125,7 +125,7 @@ tusb_error_t tuh_hid_keyboard_get_report(uint8_t dev_addr, void* p_report)
|
|||||||
|
|
||||||
bool tuh_hid_keyboard_is_busy(uint8_t dev_addr)
|
bool tuh_hid_keyboard_is_busy(uint8_t dev_addr)
|
||||||
{
|
{
|
||||||
return tuh_hid_keyboard_is_mounted(dev_addr) && hcd_edpt_busy(dev_addr, keyboardh_data[dev_addr-1].ep_in);
|
return tuh_hid_keyboard_mounted(dev_addr) && hcd_edpt_busy(dev_addr, keyboardh_data[dev_addr-1].ep_in);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
@ -138,14 +138,14 @@ bool tuh_hid_keyboard_is_busy(uint8_t dev_addr)
|
|||||||
static hidh_interface_t mouseh_data[CFG_TUSB_HOST_DEVICE_MAX]; // does not have addr0, index = dev_address-1
|
static hidh_interface_t mouseh_data[CFG_TUSB_HOST_DEVICE_MAX]; // does not have addr0, index = dev_address-1
|
||||||
|
|
||||||
//------------- Public API -------------//
|
//------------- Public API -------------//
|
||||||
bool tuh_hid_mouse_is_mounted(uint8_t dev_addr)
|
bool tuh_hid_mouse_mounted(uint8_t dev_addr)
|
||||||
{
|
{
|
||||||
return tuh_device_is_configured(dev_addr) && (mouseh_data[dev_addr-1].ep_in != 0);
|
return tuh_device_is_configured(dev_addr) && (mouseh_data[dev_addr-1].ep_in != 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool tuh_hid_mouse_is_busy(uint8_t dev_addr)
|
bool tuh_hid_mouse_is_busy(uint8_t dev_addr)
|
||||||
{
|
{
|
||||||
return tuh_hid_mouse_is_mounted(dev_addr) && hcd_edpt_busy(dev_addr, mouseh_data[dev_addr-1].ep_in);
|
return tuh_hid_mouse_mounted(dev_addr) && hcd_edpt_busy(dev_addr, mouseh_data[dev_addr-1].ep_in);
|
||||||
}
|
}
|
||||||
|
|
||||||
tusb_error_t tuh_hid_mouse_get_report(uint8_t dev_addr, void * report)
|
tusb_error_t tuh_hid_mouse_get_report(uint8_t dev_addr, void * report)
|
||||||
|
@ -46,6 +46,16 @@
|
|||||||
#define CFG_TUH_HID_MAX_REPORT 8
|
#define CFG_TUH_HID_MAX_REPORT 8
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------+
|
||||||
|
// Application API (Multiple Instances)
|
||||||
|
// CFG_TUH_HID > 1
|
||||||
|
//--------------------------------------------------------------------+
|
||||||
|
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------+
|
||||||
|
// Application API (Single Instance)
|
||||||
|
//--------------------------------------------------------------------+
|
||||||
|
|
||||||
//--------------------------------------------------------------------+
|
//--------------------------------------------------------------------+
|
||||||
// KEYBOARD Application API
|
// KEYBOARD Application API
|
||||||
//--------------------------------------------------------------------+
|
//--------------------------------------------------------------------+
|
||||||
@ -63,7 +73,7 @@ extern uint8_t const hid_keycode_to_ascii_tbl[2][128]; // TODO used weak attr if
|
|||||||
* \retval true if device supports Keyboard interface
|
* \retval true if device supports Keyboard interface
|
||||||
* \retval false if device does not support Keyboard interface or is not mounted
|
* \retval false if device does not support Keyboard interface or is not mounted
|
||||||
*/
|
*/
|
||||||
bool tuh_hid_keyboard_is_mounted(uint8_t dev_addr);
|
bool tuh_hid_keyboard_mounted(uint8_t dev_addr);
|
||||||
|
|
||||||
/** \brief Check if the interface is currently busy or not
|
/** \brief Check if the interface is currently busy or not
|
||||||
* \param[in] dev_addr device address
|
* \param[in] dev_addr device address
|
||||||
@ -128,7 +138,7 @@ void tuh_hid_keyboard_unmounted_cb(uint8_t dev_addr);
|
|||||||
* \retval true if device supports Mouse interface
|
* \retval true if device supports Mouse interface
|
||||||
* \retval false if device does not support Mouse interface or is not mounted
|
* \retval false if device does not support Mouse interface or is not mounted
|
||||||
*/
|
*/
|
||||||
bool tuh_hid_mouse_is_mounted(uint8_t dev_addr);
|
bool tuh_hid_mouse_mounted(uint8_t dev_addr);
|
||||||
|
|
||||||
/** \brief Check if the interface is currently busy or not
|
/** \brief Check if the interface is currently busy or not
|
||||||
* \param[in] dev_addr device address
|
* \param[in] dev_addr device address
|
||||||
|
Loading…
x
Reference in New Issue
Block a user