summaryrefslogtreecommitdiff
path: root/tinyusb/class
diff options
context:
space:
mode:
authorhathach <[email protected]>2015-05-01 19:13:43 +0700
committerhathach <[email protected]>2015-05-01 19:13:43 +0700
commita3e7c104b3e4eb15c6a7846650274636f40df78e (patch)
treec911bfd12b34bcd5b6e2172e052c91de23cb9b75 /tinyusb/class
parent6ee14bdd23884854ce1b563fdc8789359e68f4e8 (diff)
simplify tusbh_cdc_ to tuh_cdc_
Diffstat (limited to 'tinyusb/class')
-rw-r--r--tinyusb/class/cdc_host.c14
-rw-r--r--tinyusb/class/cdc_host.h16
2 files changed, 15 insertions, 15 deletions
diff --git a/tinyusb/class/cdc_host.c b/tinyusb/class/cdc_host.c
index 0227e5e95..04ca46f00 100644
--- a/tinyusb/class/cdc_host.c
+++ b/tinyusb/class/cdc_host.c
@@ -80,7 +80,7 @@ STATIC_ INLINE_ bool tusbh_cdc_is_mounted(uint8_t dev_addr)
#endif
}
-bool tusbh_cdc_is_busy(uint8_t dev_addr, cdc_pipeid_t pipeid)
+bool tuh_cdc_is_busy(uint8_t dev_addr, cdc_pipeid_t pipeid)
{
if ( !tusbh_cdc_is_mounted(dev_addr) ) return false;
@@ -106,7 +106,7 @@ bool tusbh_cdc_is_busy(uint8_t dev_addr, cdc_pipeid_t pipeid)
//--------------------------------------------------------------------+
// APPLICATION API (parameter validation needed)
//--------------------------------------------------------------------+
-bool tusbh_cdc_serial_is_mounted(uint8_t dev_addr)
+bool tuh_cdc_serial_is_mounted(uint8_t dev_addr)
{
// TODO consider all AT Command as serial candidate
return tusbh_cdc_is_mounted(dev_addr) &&
@@ -114,7 +114,7 @@ bool tusbh_cdc_serial_is_mounted(uint8_t dev_addr)
(cdch_data[dev_addr-1].interface_protocol <= CDC_COMM_PROTOCOL_ATCOMMAND_CDMA);
}
-tusb_error_t tusbh_cdc_send(uint8_t dev_addr, void const * p_data, uint32_t length, bool is_notify)
+tusb_error_t tuh_cdc_send(uint8_t dev_addr, void const * p_data, uint32_t length, bool is_notify)
{
ASSERT( tusbh_cdc_is_mounted(dev_addr), TUSB_ERROR_CDCH_DEVICE_NOT_MOUNTED);
ASSERT( p_data != NULL && length, TUSB_ERROR_INVALID_PARA);
@@ -125,7 +125,7 @@ tusb_error_t tusbh_cdc_send(uint8_t dev_addr, void const * p_data, uint32_t leng
return hcd_pipe_xfer( pipe_out, (void *) p_data, length, is_notify);
}
-tusb_error_t tusbh_cdc_receive(uint8_t dev_addr, void * p_buffer, uint32_t length, bool is_notify)
+tusb_error_t tuh_cdc_receive(uint8_t dev_addr, void * p_buffer, uint32_t length, bool is_notify)
{
ASSERT( tusbh_cdc_is_mounted(dev_addr), TUSB_ERROR_CDCH_DEVICE_NOT_MOUNTED);
ASSERT( p_buffer != NULL && length, TUSB_ERROR_INVALID_PARA);
@@ -217,7 +217,7 @@ tusb_error_t cdch_open_subtask(uint8_t dev_addr, tusb_descriptor_interface_t con
{
// FIXME mounted class flag is not set yet
- tusbh_cdc_mounted_cb(dev_addr);
+ tuh_cdc_mounted_cb(dev_addr);
}
OSAL_SUBTASK_END
@@ -225,7 +225,7 @@ tusb_error_t cdch_open_subtask(uint8_t dev_addr, tusb_descriptor_interface_t con
void cdch_isr(pipe_handle_t pipe_hdl, tusb_event_t event, uint32_t xferred_bytes)
{
- tusbh_cdc_xfer_isr( pipe_hdl.dev_addr, event, get_app_pipeid(pipe_hdl), xferred_bytes );
+ tuh_cdc_xfer_isr( pipe_hdl.dev_addr, event, get_app_pipeid(pipe_hdl), xferred_bytes );
}
void cdch_close(uint8_t dev_addr)
@@ -238,7 +238,7 @@ void cdch_close(uint8_t dev_addr)
memclr_(p_cdc, sizeof(cdch_data_t));
- tusbh_cdc_unmounted_cb(dev_addr);
+ tuh_cdc_unmounted_cb(dev_addr);
}
diff --git a/tinyusb/class/cdc_host.h b/tinyusb/class/cdc_host.h
index a7e96394b..ed04c903d 100644
--- a/tinyusb/class/cdc_host.h
+++ b/tinyusb/class/cdc_host.h
@@ -62,7 +62,7 @@
* \retval true if device supports
* \retval false if device does not support or is not mounted
*/
-bool tusbh_cdc_serial_is_mounted(uint8_t dev_addr) ATTR_PURE ATTR_WARN_UNUSED_RESULT;
+bool tuh_cdc_serial_is_mounted(uint8_t dev_addr) ATTR_PURE ATTR_WARN_UNUSED_RESULT;
/** \brief Check if the interface is currently busy or not
* \param[in] dev_addr device address
@@ -71,9 +71,9 @@ bool tusbh_cdc_serial_is_mounted(uint8_t dev_addr) ATTR_PURE ATTR_WARN_UNUSED_RE
* \retval false if the interface is not busy, meaning the stack successfully transferred data from/to device
* \note This function is used to check if previous transfer is complete (success or error), so that the next transfer
* can be scheduled. User needs to make sure the corresponding interface is mounted
- * (by \ref tusbh_cdc_serial_is_mounted) before calling this function.
+ * (by \ref tuh_cdc_serial_is_mounted) before calling this function.
*/
-bool tusbh_cdc_is_busy(uint8_t dev_addr, cdc_pipeid_t pipeid) ATTR_PURE ATTR_WARN_UNUSED_RESULT;
+bool tuh_cdc_is_busy(uint8_t dev_addr, cdc_pipeid_t pipeid) ATTR_PURE ATTR_WARN_UNUSED_RESULT;
/** \brief Perform USB OUT transfer to device
* \param[in] dev_addr device address
@@ -86,7 +86,7 @@ bool tusbh_cdc_is_busy(uint8_t dev_addr, cdc_pipeid_t pipeid) ATTR_PURE ATTR_WA
* \note This function is non-blocking and returns immediately. The result of USB transfer will be reported by the
* interface's callback function. \a p_data must be declared with \ref TUSB_CFG_ATTR_USBRAM.
*/
-tusb_error_t tusbh_cdc_send(uint8_t dev_addr, void const * p_data, uint32_t length, bool is_notify);
+tusb_error_t tuh_cdc_send(uint8_t dev_addr, void const * p_data, uint32_t length, bool is_notify);
/** \brief Perform USB IN transfer to get data from device
* \param[in] dev_addr device address
@@ -99,7 +99,7 @@ tusb_error_t tusbh_cdc_send(uint8_t dev_addr, void const * p_data, uint32_t leng
* \note This function is non-blocking and returns immediately. The result of USB transfer will be reported by the
* interface's callback function. \a p_data must be declared with \ref TUSB_CFG_ATTR_USBRAM.
*/
-tusb_error_t tusbh_cdc_receive(uint8_t dev_addr, void * p_buffer, uint32_t length, bool is_notify);
+tusb_error_t tuh_cdc_receive(uint8_t dev_addr, void * p_buffer, uint32_t length, bool is_notify);
//--------------------------------------------------------------------+
// CDC APPLICATION CALLBACKS
@@ -108,13 +108,13 @@ tusb_error_t tusbh_cdc_receive(uint8_t dev_addr, void * p_buffer, uint32_t lengt
* \param[in] dev_addr Address of newly mounted device
* \note This callback should be used by Application to set-up interface-related data
*/
-void tusbh_cdc_mounted_cb(uint8_t dev_addr);
+void tuh_cdc_mounted_cb(uint8_t dev_addr);
/** \brief Callback function that will be invoked when a device with CDC Abstract Control Model interface is unmounted
* \param[in] dev_addr Address of newly unmounted device
* \note This callback should be used by Application to tear-down interface-related data
*/
-void tusbh_cdc_unmounted_cb(uint8_t dev_addr);
+void tuh_cdc_unmounted_cb(uint8_t dev_addr);
/** \brief Callback function that is invoked when an transferring event occurred
* \param[in] dev_addr Address of device
@@ -127,7 +127,7 @@ void tusbh_cdc_unmounted_cb(uint8_t dev_addr);
* - TUSB_EVENT_XFER_STALLED : previously scheduled transfer is stalled by device.
* \note
*/
-void tusbh_cdc_xfer_isr(uint8_t dev_addr, tusb_event_t event, cdc_pipeid_t pipe_id, uint32_t xferred_bytes);
+void tuh_cdc_xfer_isr(uint8_t dev_addr, tusb_event_t event, cdc_pipeid_t pipe_id, uint32_t xferred_bytes);
/// @} // group CDC_Serial_Host
/// @}