本文整理匯總了C++中FifoByteCount函數的典型用法代碼示例。如果您正苦於以下問題:C++ FifoByteCount函數的具體用法?C++ FifoByteCount怎麽用?C++ FifoByteCount使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了FifoByteCount函數的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。
示例1: USB_SendSpace
// Space in send EP
u8 USB_SendSpace(u8 ep)
{
LockEP lock(ep);
if (!ReadWriteAllowed())
return 0;
return 64 - FifoByteCount();
}
示例2: USB_Flush
void
USB_Flush(uint8_t ep)
{
SetEP(ep);
if (FifoByteCount())
ReleaseTX();
}
示例3: USB_SendSpace
uint8_t
USB_SendSpace(uint8_t ep)
{
LockEP lock(ep);
if (!ReadWriteAllowed()) return (0);
return (64 - FifoByteCount());
}
示例4: USB_Recv
int
USB_Recv(uint8_t ep, void* d, int len)
{
if (!_usbConfiguration || len < 0) return (-1);
LockEP lock(ep);
uint8_t n = FifoByteCount();
len = min(n,len);
n = len;
uint8_t* dst = (uint8_t*)d;
while (n--)
*dst++ = Recv8();
if (len && !FifoByteCount())
ReleaseRX();
return (len);
}
示例5: USB_Recv
// Non Blocking receive
// Return number of bytes read
int USB_Recv(u8 ep, void* d, int len)
{
if (!_usbConfiguration || len < 0)
return -1;
LockEP lock(ep);
u8 n = FifoByteCount();
len = min(n,len);
n = len;
u8* dst = (u8*)d;
while (n--)
*dst++ = Recv8();
if (len && !FifoByteCount()) // release empty buffer
ReleaseRX();
return len;
}
示例6: USB_SendSpace
// Space in send EP
u8 USB_SendSpace(u8 ep)
{
LockEP lock(ep);
if (!ReadWriteAllowed())
return 0;
// subtract 1 from the EP size to never send a full packet,
// this avoids dealing with ZLP's in USB_Send
return USB_EP_SIZE - 1 - FifoByteCount();
}
示例7: USBD_SendSpace
// Space in send EP
uint8_t USBD_SendSpace(uint8_t ep)
{
SetEP(ep);
if (!ReadWriteAllowed())
{
return 0;
}
return 64 - FifoByteCount();
}
示例8: USB_Available
// Number of bytes, assumes a rx endpoint
u8 USB_Available(u8 ep)
{
LockEP lock(ep);
return FifoByteCount();
}
示例9: USBD_Available
// Number of bytes, assumes a rx endpoint
uint8_t USBD_Available(uint8_t ep)
{
SetEP(ep);
return FifoByteCount();
}
示例10: USB_Available
uint8_t
USB_Available(uint8_t ep)
{
LockEP lock(ep);
return (FifoByteCount());
}