本文整理汇总了C++中USBDevice_SAMD21G18x::epBank0DisableTransferComplete方法的典型用法代码示例。如果您正苦于以下问题:C++ USBDevice_SAMD21G18x::epBank0DisableTransferComplete方法的具体用法?C++ USBDevice_SAMD21G18x::epBank0DisableTransferComplete怎么用?C++ USBDevice_SAMD21G18x::epBank0DisableTransferComplete使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类USBDevice_SAMD21G18x
的用法示例。
在下文中一共展示了USBDevice_SAMD21G18x::epBank0DisableTransferComplete方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: recv
// Non Blocking receive
// Return number of bytes read
uint32_t USBDeviceClass::recv(uint32_t ep, void *_data, uint32_t len)
{
if (!_usbConfiguration)
return -1;
if (available(ep) < len)
len = available(ep);
armRecv(ep);
usbd.epBank0DisableTransferComplete(ep);
memcpy(_data, udd_ep_out_cache_buffer[ep], len);
// release empty buffer
if (len && !available(ep)) {
// The RAM Buffer is empty: we can receive data
usbd.epBank0ResetReady(ep);
// Clear Transfer complete 0 flag
usbd.epBank0AckTransferComplete(ep);
}
return len;
}
示例2: recv
// Non Blocking receive
// Return number of bytes read
uint32_t USBDeviceClass::recv(uint32_t ep, void *_data, uint32_t len)
{
if (!_usbConfiguration)
return -1;
if (available(ep) < len)
len = available(ep);
#ifdef PIN_LED_RXL
digitalWrite(PIN_LED_RXL, LOW);
rxLEDPulse = TX_RX_LED_PULSE_MS;
#endif
armRecv(ep);
usbd.epBank0DisableTransferComplete(ep);
memcpy(_data, udd_ep_out_cache_buffer[ep], len);
// release empty buffer
if (len && !available(ep)) {
// The RAM Buffer is empty: we can receive data
usbd.epBank0ResetReady(ep);
// Clear Transfer complete 0 flag
usbd.epBank0AckTransferComplete(ep);
}
return len;
}