本文整理汇总了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());
}