Data Structures | |
struct | tLPMFeature |
struct | tUSBRingBufObject |
struct | tUSBBufferVars |
struct | tUSBBuffer |
Macros | |
#define | USB_BUFFER_FLAG_SEND_ZLP 0x00000001 |
#define | USBLIB_FEATURE_LPM 0x00000001 |
#define | USBLIB_FEATURE_LPM_RMT_WAKE 0x00000002 |
#define | USBLIB_FEATURE_LPM_EN 0x00000001 |
#define | USBLIB_FEATURE_LPM_DIS 0x00000000 |
#define | USBLIB_FEATURE_CPUCLK 0x00000002 |
#define | USBLIB_FEATURE_USBPLL 0x00000003 |
#define | USBLIB_FEATURE_USBULPI 0x00000004 |
#define | USBLIB_FEATURE_ULPI_NONE 0x00000000 |
#define | USBLIB_FEATURE_ULPI_HS 0x00000010 |
#define | USBLIB_FEATURE_ULPI_FS 0x00000020 |
#define | USBLIB_FEATURE_POWER 0x00000005 |
#define | USBLIB_FEATURE_POWER_SELF 0x00000001 |
#define | USBLIB_FEATURE_POWER_BUS 0x00000000 |
#define | USBLIB_FEATURE_REMOTE_WAKE 0x00000002 |
#define | NULL ((void *)0) |
Typedefs | |
typedef uint32_t(* | tUSBPacketTransfer) (void *pvHandle, uint8_t *pi8Data, uint32_t ui32Length, bool bLast) |
typedef uint32_t(* | tUSBPacketAvailable) (void *pvHandle) |
Functions | |
const tUSBBuffer * | USBBufferInit (tUSBBuffer *psBuffer) |
void | USBBufferZeroLengthPacketInsert (const tUSBBuffer *psBuffer, bool bSendZLP) |
void | USBBufferInfoGet (const tUSBBuffer *psBuffer, tUSBRingBufObject *psRingBuf) |
void | USBBufferDataWritten (const tUSBBuffer *psBuffer, uint32_t ui32Length) |
void | USBBufferDataRemoved (const tUSBBuffer *psBuffer, uint32_t ui32Length) |
void * | USBBufferCallbackDataSet (tUSBBuffer *psBuffer, void *pvCBData) |
uint32_t | USBBufferWrite (const tUSBBuffer *psBuffer, const uint8_t *pui8Data, uint32_t ui32Length) |
void | USBBufferFlush (const tUSBBuffer *psBuffer) |
uint32_t | USBBufferRead (const tUSBBuffer *psBuffer, uint8_t *pui8Data, uint32_t ui32Length) |
uint32_t | USBBufferDataAvailable (const tUSBBuffer *psBuffer) |
uint32_t | USBBufferSpaceAvailable (const tUSBBuffer *psBuffer) |
uint32_t | USBBufferEventCallback (void *pvCBData, uint32_t ui32Event, uint32_t ui32MsgValue, void *pvMsgData) |
bool | USBRingBufFull (tUSBRingBufObject *psUSBRingBuf) |
bool | USBRingBufEmpty (tUSBRingBufObject *psUSBRingBuf) |
void | USBRingBufFlush (tUSBRingBufObject *psUSBRingBuf) |
uint32_t | USBRingBufUsed (tUSBRingBufObject *psUSBRingBuf) |
uint32_t | USBRingBufFree (tUSBRingBufObject *psUSBRingBuf) |
uint32_t | USBRingBufContigUsed (tUSBRingBufObject *psUSBRingBuf) |
uint32_t | USBRingBufContigFree (tUSBRingBufObject *psUSBRingBuf) |
uint32_t | USBRingBufSize (tUSBRingBufObject *psUSBRingBuf) |
uint8_t | USBRingBufReadOne (tUSBRingBufObject *psUSBRingBuf) |
void | USBRingBufRead (tUSBRingBufObject *psUSBRingBuf, uint8_t *pui8Data, uint32_t ui32Length) |
void | USBRingBufAdvanceRead (tUSBRingBufObject *psUSBRingBuf, uint32_t ui32NumBytes) |
void | USBRingBufAdvanceWrite (tUSBRingBufObject *psUSBRingBuf, uint32_t ui32NumBytes) |
void | USBRingBufWriteOne (tUSBRingBufObject *psUSBRingBuf, uint8_t ui8Data) |
void | USBRingBufWrite (tUSBRingBufObject *psUSBRingBuf, const uint8_t *pui8Data, uint32_t ui32Length) |
void | USBRingBufInit (tUSBRingBufObject *psUSBRingBuf, uint8_t *pui8Buf, uint32_t ui32Size) |
#define USB_BUFFER_FLAG_SEND_ZLP 0x00000001 |
Referenced by USBBufferZeroLengthPacketInsert().
#define USBLIB_FEATURE_LPM 0x00000001 |
This feature setting enables or disables LPM support in the USB library in either host or device mode depending on if the USBHCDFeatureSet() or USBDCDFeatureSet() is called. If no action is taken the default behavior of USB library is to not support LPM transactions. The pvFeature value is a pointer to a 32-bit value containing the a logical OR of the following values:
Referenced by USBDCDFeatureSet().
#define USBLIB_FEATURE_LPM_RMT_WAKE 0x00000002 |
#define USBLIB_FEATURE_LPM_EN 0x00000001 |
Referenced by USBDCDFeatureSet().
#define USBLIB_FEATURE_LPM_DIS 0x00000000 |
#define USBLIB_FEATURE_CPUCLK 0x00000002 |
This feature setting allows an application to inform the USB library of the current processor speed that is can use for internal timing when the frame counter is not yet running. The pvFeature is a pointer to a 32-bit value that holds the processor frequency in Hz.
Referenced by USBHCDFeatureSet().
#define USBLIB_FEATURE_USBPLL 0x00000003 |
This feature setting allows an application to inform the USB library of the current USB PLL rate in cases where the USB library needs this information for internal configuration. If this feature is not set, then default rate for the USB PLL is 480MHz. The pvFeature is a pointer to an 32-bit value that holds the USB PLL speed in Hz. If the application needs to use an external USB clock the PLL value should be set to zero. This is used when connecting to an external USB phy which is providing the 60-MHz clock.
Referenced by USBDCDFeatureSet().
#define USBLIB_FEATURE_USBULPI 0x00000004 |
This feature setting allows an application to disable or configure and enable the ULPI features in the USB library. If this feature is not set, the default behavior is to not support ULPI operation. The pvFeature is a pointer to an 32-bit value that holds the USB ULPI configuration. The following are the valid settings for this feature:
Referenced by USBDBulkCompositeInit(), USBDCDCCompositeInit(), and USBDCDFeatureGet().
#define USBLIB_FEATURE_ULPI_NONE 0x00000000 |
#define USBLIB_FEATURE_ULPI_HS 0x00000010 |
#define USBLIB_FEATURE_ULPI_FS 0x00000020 |
#define USBLIB_FEATURE_POWER 0x00000005 |
This feature setting enables or disables various power settings in the USB library in either host or device mode depending on if the USBHCDFeatureSet() or USBDCDFeatureSet() is called. The pvFeature value is a pointer to a 32-bit value containing the a logical OR of the following values:
#define USBLIB_FEATURE_POWER_SELF 0x00000001 |
#define USBLIB_FEATURE_POWER_BUS 0x00000000 |
#define USBLIB_FEATURE_REMOTE_WAKE 0x00000002 |
#define NULL ((void *)0) |
Referenced by USBRingBufAdvanceRead(), USBRingBufAdvanceWrite(), USBRingBufContigFree(), USBRingBufContigUsed(), USBRingBufEmpty(), USBRingBufFlush(), USBRingBufFree(), USBRingBufFull(), USBRingBufInit(), USBRingBufRead(), USBRingBufReadOne(), USBRingBufSize(), USBRingBufUsed(), USBRingBufWrite(), and USBRingBufWriteOne().
typedef uint32_t(* tUSBPacketTransfer) (void *pvHandle, uint8_t *pi8Data, uint32_t ui32Length, bool bLast) |
A function pointer type which describes either a class driver packet read or packet write function (both have the same prototype) to the USB buffer object.
typedef uint32_t(* tUSBPacketAvailable) (void *pvHandle) |
A function pointer type which describes either a class driver transmit or receive packet available function (both have the same prototype) to the USB buffer object.
pvHandle | is the handle of the device. |
const tUSBBuffer* USBBufferInit | ( | tUSBBuffer * | psBuffer | ) |
Initializes a USB buffer object to be used with a given USB controller and device or host class driver.
psBuffer | points to a structure containing information on the buffer memory to be used and the underlying device or host class driver whose data is to be buffered. This structure must remain accessible for as long as the buffer is in use. |
This function is used to initialize a USB buffer object and insert it into the function and callback interfaces between an underlying driver and the application. The caller supplies information on both the RAM to be used to buffer data, the type of buffer to be created (transmit or receive) and the functions to be called in the lower layer to transfer data to or from the USB controller.
References tUSBBuffer::pfnAvailable, tUSBBuffer::pfnCallback, tUSBBuffer::pfnTransfer, tUSBBuffer::pui8Buffer, tUSBBuffer::sPrivateData, tUSBBufferVars::sRingBuf, tUSBBuffer::ui32BufferSize, tUSBBufferVars::ui32Flags, and USBRingBufInit().
void USBBufferZeroLengthPacketInsert | ( | const tUSBBuffer * | psBuffer, |
bool | bSendZLP | ||
) |
Enables or disables zero-length packet insertion.
psBuffer | is the pointer to the buffer instance whose information is being queried. |
bSendZLP | is true to send zero-length packets or false to prevent them from being sent. |
This function allows the use of zero-length packets to be controlled by an application. In cases where the USB buffer has sent a full (64 byte) packet and then discovers that the transmit buffer is empty, the default behavior is to do nothing. Some protocols, however, require that a zero- length packet be inserted to signal the end of the data. When using such a protocol, this function should be called with bSendZLP set to true to enable the desired behavior.
References tUSBBufferVars::ui32Flags, and USB_BUFFER_FLAG_SEND_ZLP.
void USBBufferInfoGet | ( | const tUSBBuffer * | psBuffer, |
tUSBRingBufObject * | psRingBuf | ||
) |
Returns the current ring buffer indices for this USB buffer.
psBuffer | is the pointer to the buffer instance whose information is being queried. |
psRingBuf | is a pointer to storage that will be written with the current ring buffer control structure for this USB buffer. |
This function is provided to aid a client wishing to write data directly into the USB buffer rather than using the USBBufferWrite() function. This may be necessary to control when the USBBuffer starts transmission of a large block of data, for example.
A transmit buffer will immediately send a new packet on any call to USBBufferWrite() if the underlying layer indicates that a transmission can be started. In some cases this is not desirable and a client may wish to wishes to write more data to the buffer in advance of starting transmission to the lower layer. In such cases, this function may be called to retrieve the current ring buffer indices and the buffer accessed directly. Once the client has written all data it wishes to send, it should call function USBBufferDataWritten() to indicate that transmission may begin.
References tUSBRingBufObject::pui8Buf, tUSBBuffer::sPrivateData, tUSBBufferVars::sRingBuf, tUSBRingBufObject::ui32ReadIndex, tUSBRingBufObject::ui32Size, and tUSBRingBufObject::ui32WriteIndex.
void USBBufferDataWritten | ( | const tUSBBuffer * | psBuffer, |
uint32_t | ui32Length | ||
) |
Indicates that a client has written data directly into the buffer and wishes to start transmission.
psBuffer | is the pointer to the buffer instance into which data has been written. |
ui32Length | is the number of bytes of data that the client has written. |
This function updates the USB buffer write pointer and starts transmission of the data in the buffer assuming the lower layer is ready to receive a new packet. The function is provided to aid a client wishing to write data directly into the USB buffer rather than using the USBBufferWrite() function. This may be necessary to control when the USB buffer starts transmission of a large block of data, for example.
A transmit buffer will immediately send a new packet on any call to USBBufferWrite() if the underlying layer indicates that a transmission can be started. In some cases this is not desirable and a client may wish to write more data to the buffer in advance of starting transmission to the lower layer. In such cases, USBBufferInfoGet() may be called to retrieve the current ring buffer indices and the buffer accessed directly. Once the client has written all data it wishes to send (taking care to handle the ring buffer wrap), it should call this function to indicate that transmission may begin.
References tUSBBufferVars::sRingBuf, and USBRingBufAdvanceWrite().
void USBBufferDataRemoved | ( | const tUSBBuffer * | psBuffer, |
uint32_t | ui32Length | ||
) |
Indicates that a client has read data directly out of the buffer.
psBuffer | is the pointer to the buffer instance from which data has been read. |
ui32Length | is the number of bytes of data that the client has read. |
This function updates the USB buffer read pointer to remove data that the client has read directly rather than via a call to USBBufferRead(). The function is provided to aid a client wishing to minimize data copying. To read directly from the buffer, a client must call USBBufferInfoGet() to retrieve the current buffer inpsBufVarsdices. With this information, the data following the current read index can be read. Once the client has processed much data as it needs, USBBufferDataRemoved() must be called to advance the read pointer past the data that has been read and free up that section of the buffer. The client must take care to correctly handle the wrap point if accessing the buffer directly.
References tUSBBufferVars::sRingBuf, and USBRingBufAdvanceRead().
void* USBBufferCallbackDataSet | ( | tUSBBuffer * | psBuffer, |
void * | pvCBData | ||
) |
Sets the callback pointer supplied to clients of this buffer.
psBuffer | is the pointer to the buffer instance whose callback data is to be changed. |
pvCBData | is the pointer the client wishes to receive on all future callbacks from this buffer. |
This function sets the callback pointer which this buffer will supply to clients as the pvCBData parameter in all future calls to the event callback.
References tUSBBuffer::pvCBData.
uint32_t USBBufferWrite | ( | const tUSBBuffer * | psBuffer, |
const uint8_t * | pui8Data, | ||
uint32_t | ui32Length | ||
) |
Writes a block of data to the transmit buffer and queues it for transmission to the USB controller.
psBuffer | points to the pointer instance into which data is to be written. |
pui8Data | points to the first byte of data which is to be written. |
ui32Length | is the number of bytes of data to write to the buffer. |
This function copies the supplied data into the transmit buffer. The transmit buffer data will be packetized according to the constraints imposed by the lower layer in use and sent to the USB controller as soon as possible. Once a packet is transmitted and acknowledged, a USB_EVENT_TX_COMPLETE event will be sent to the application callback indicating the number of bytes that have been sent from the buffer.
Attempts to send more data than there is space for in the transmit buffer will result in fewer bytes than expected being written. The value returned by the function indicates the actual number of bytes copied to the buffer.
References tUSBBuffer::bTransmitBuffer, tUSBBufferVars::sRingBuf, USBRingBufFree(), and USBRingBufWrite().
void USBBufferFlush | ( | const tUSBBuffer * | psBuffer | ) |
Flushes a USB buffer, discarding any data that it contains.
psBuffer | is the pointer to the buffer instance which is to be flushed. |
This function discards all data currently in the supplied buffer without processing (transmitting it via the USB controller or passing it to the client depending upon the buffer mode).
References tUSBBufferVars::sRingBuf, and USBRingBufFlush().
uint32_t USBBufferRead | ( | const tUSBBuffer * | psBuffer, |
uint8_t * | pui8Data, | ||
uint32_t | ui32Length | ||
) |
Reads a block of data from a USB receive buffer into storage supplied by the caller.
psBuffer | is the pointer to the buffer instance from which data is to be read. |
pui8Data | points to a buffer into which the received data will be written. |
ui32Length | is the size of the buffer pointed to by pui8Data. |
This function reads up to ui32Length bytes of data received from the USB host into the supplied application buffer. If the receive buffer contains fewer than ui32Length bytes of data, the data that is present will be copied and the return code will indicate the actual number of bytes copied to pui8Data.
References tUSBBufferVars::sRingBuf, USBRingBufRead(), and USBRingBufUsed().
uint32_t USBBufferDataAvailable | ( | const tUSBBuffer * | psBuffer | ) |
Returns the number of bytes of data available in the buffer.
psBuffer | is the pointer to the buffer instance which is to be queried. |
This function may be used to determine the number of bytes of data in a buffer. For a receive buffer, this indicates the number of bytes that the client can read from the buffer using USBBufferRead(). For a transmit buffer, this indicates the amount of data that remains to be sent to the USB controller.
References tUSBBufferVars::sRingBuf, and USBRingBufUsed().
uint32_t USBBufferSpaceAvailable | ( | const tUSBBuffer * | psBuffer | ) |
Returns the number of free bytes in the buffer.
psBuffer | is the pointer to the buffer instance which is to be queried. |
This function returns the number of free bytes in the buffer. For a transmit buffer, this indicates the maximum number of bytes that can be passed on a call to USBBufferWrite() and accepted for transmission. For a receive buffer, it indicates the number of bytes that can be read from the USB controller before the buffer will be full.
References tUSBBufferVars::sRingBuf, and USBRingBufFree().
uint32_t USBBufferEventCallback | ( | void * | pvCBData, |
uint32_t | ui32Event, | ||
uint32_t | ui32MsgValue, | ||
void * | pvMsgData | ||
) |
Called by the USB buffer to notify the client of asynchronous events.
pvCBData | is the client-supplied callback pointer associated with this buffer instance. |
ui32Event | is the identifier of the event being sent. This will be a general event identifier of the form USBD_EVENT_xxxx or a device class-dependent event of the form USBD_CDC_EVENT_xxx or USBD_HID_EVENT_xxx. |
ui32MsgValue | is an event-specific parameter value. |
pvMsgData | is an event-specific data pointer. |
This function is the USB buffer event handler that applications should register with the USB device class driver as the callback for the channel which is to be buffered using this buffer.
References tUSBBuffer::bTransmitBuffer, and USB_EVENT_RX_AVAILABLE.
bool USBRingBufFull | ( | tUSBRingBufObject * | psUSBRingBuf | ) |
Determines whether a ring buffer is full or not.
psUSBRingBuf | is the ring buffer object to empty. |
This function is used to determine whether or not a given ring buffer is full. The structure is specifically to ensure that we do not see warnings from the compiler related to the order of volatile accesses being undefined.
References NULL, tUSBRingBufObject::ui32ReadIndex, tUSBRingBufObject::ui32Size, and tUSBRingBufObject::ui32WriteIndex.
bool USBRingBufEmpty | ( | tUSBRingBufObject * | psUSBRingBuf | ) |
Determines whether a ring buffer is empty or not.
psUSBRingBuf | is the ring buffer object to empty. |
This function is used to determine whether or not a given ring buffer is empty. The structure is specifically to ensure that we do not see warnings from the compiler related to the order of volatile accesses being undefined.
References NULL, tUSBRingBufObject::ui32ReadIndex, and tUSBRingBufObject::ui32WriteIndex.
void USBRingBufFlush | ( | tUSBRingBufObject * | psUSBRingBuf | ) |
Empties the ring buffer.
psUSBRingBuf | is the ring buffer object to empty. |
Discards all data from the ring buffer.
References NULL, tUSBRingBufObject::ui32ReadIndex, and tUSBRingBufObject::ui32WriteIndex.
Referenced by USBBufferFlush().
uint32_t USBRingBufUsed | ( | tUSBRingBufObject * | psUSBRingBuf | ) |
Returns number of bytes stored in ring buffer.
psUSBRingBuf | is the ring buffer object to check. |
This function returns the number of bytes stored in the ring buffer.
References NULL, tUSBRingBufObject::ui32ReadIndex, tUSBRingBufObject::ui32Size, and tUSBRingBufObject::ui32WriteIndex.
Referenced by USBBufferDataAvailable(), USBBufferRead(), USBRingBufAdvanceRead(), USBRingBufFree(), USBRingBufRead(), and USBRingBufReadOne().
uint32_t USBRingBufFree | ( | tUSBRingBufObject * | psUSBRingBuf | ) |
Returns number of bytes available in a ring buffer.
psUSBRingBuf | is the ring buffer object to check. |
This function returns the number of bytes available in the ring buffer.
References NULL, tUSBRingBufObject::ui32Size, and USBRingBufUsed().
Referenced by USBBufferSpaceAvailable(), USBBufferWrite(), USBRingBufAdvanceWrite(), USBRingBufWrite(), and USBRingBufWriteOne().
uint32_t USBRingBufContigUsed | ( | tUSBRingBufObject * | psUSBRingBuf | ) |
Returns number of contiguous bytes of data stored in ring buffer ahead of the current read pointer.
psUSBRingBuf | is the ring buffer object to check. |
This function returns the number of contiguous bytes of data available in the ring buffer ahead of the current read pointer. This represents the largest block of data which does not straddle the buffer wrap.
References NULL, tUSBRingBufObject::ui32ReadIndex, tUSBRingBufObject::ui32Size, and tUSBRingBufObject::ui32WriteIndex.
uint32_t USBRingBufContigFree | ( | tUSBRingBufObject * | psUSBRingBuf | ) |
Returns number of contiguous free bytes available in a ring buffer.
psUSBRingBuf | is the ring buffer object to check. |
This function returns the number of contiguous free bytes ahead of the current write pointer in the ring buffer.
References NULL, tUSBRingBufObject::ui32ReadIndex, tUSBRingBufObject::ui32Size, and tUSBRingBufObject::ui32WriteIndex.
uint32_t USBRingBufSize | ( | tUSBRingBufObject * | psUSBRingBuf | ) |
Returns the size in bytes of a ring buffer.
psUSBRingBuf | is the ring buffer object to check. |
This function returns the size of the ring buffer.
References NULL, and tUSBRingBufObject::ui32Size.
uint8_t USBRingBufReadOne | ( | tUSBRingBufObject * | psUSBRingBuf | ) |
Reads a single byte of data from a ring buffer.
psUSBRingBuf | points to the ring buffer to be written to. |
This function reads a single byte of data from a ring buffer.
References NULL, tUSBRingBufObject::pui8Buf, tUSBRingBufObject::ui32ReadIndex, and USBRingBufUsed().
Referenced by USBRingBufRead().
void USBRingBufRead | ( | tUSBRingBufObject * | psUSBRingBuf, |
uint8_t * | pui8Data, | ||
uint32_t | ui32Length | ||
) |
Reads data from a ring buffer.
psUSBRingBuf | points to the ring buffer to be read from. |
pui8Data | points to where the data should be stored. |
ui32Length | is the number of bytes to be read. |
This function reads a sequence of bytes from a ring buffer.
References NULL, USBRingBufReadOne(), and USBRingBufUsed().
Referenced by USBBufferRead().
void USBRingBufAdvanceRead | ( | tUSBRingBufObject * | psUSBRingBuf, |
uint32_t | ui32NumBytes | ||
) |
Removes bytes from the ring buffer by advancing the read index.
psUSBRingBuf | points to the ring buffer from which bytes are to be removed. |
ui32NumBytes | is the number of bytes to be removed from the buffer. |
This function advances the ring buffer read index by a given number of bytes, removing that number of bytes of data from the buffer. If ui32NumBytes is larger than the number of bytes currently in the buffer, the buffer is emptied.
References NULL, and USBRingBufUsed().
Referenced by USBBufferDataRemoved().
void USBRingBufAdvanceWrite | ( | tUSBRingBufObject * | psUSBRingBuf, |
uint32_t | ui32NumBytes | ||
) |
Adds bytes to the ring buffer by advancing the write index.
psUSBRingBuf | points to the ring buffer to which bytes have been added. |
ui32NumBytes | is the number of bytes added to the buffer. |
This function should be used by clients who wish to add data to the buffer directly rather than via calls to USBRingBufWrite() or USBRingBufWriteOne(). It advances the write index by a given number of bytes.
References NULL, tUSBRingBufObject::ui32ReadIndex, tUSBRingBufObject::ui32Size, tUSBRingBufObject::ui32WriteIndex, and USBRingBufFree().
Referenced by USBBufferDataWritten().
void USBRingBufWriteOne | ( | tUSBRingBufObject * | psUSBRingBuf, |
uint8_t | ui8Data | ||
) |
Writes a single byte of data to a ring buffer.
psUSBRingBuf | points to the ring buffer to be written to. |
ui8Data | is the byte to be written. |
This function writes a single byte of data into a ring buffer.
References NULL, tUSBRingBufObject::pui8Buf, tUSBRingBufObject::ui32WriteIndex, and USBRingBufFree().
Referenced by USBRingBufWrite().
void USBRingBufWrite | ( | tUSBRingBufObject * | psUSBRingBuf, |
const uint8_t * | pui8Data, | ||
uint32_t | ui32Length | ||
) |
Writes data to a ring buffer.
psUSBRingBuf | points to the ring buffer to be written to. |
pui8Data | points to the data to be written. |
ui32Length | is the number of bytes to be written. |
This function write a sequence of bytes into a ring buffer.
References NULL, USBRingBufFree(), and USBRingBufWriteOne().
Referenced by USBBufferWrite().
void USBRingBufInit | ( | tUSBRingBufObject * | psUSBRingBuf, |
uint8_t * | pui8Buf, | ||
uint32_t | ui32Size | ||
) |
Initializes a ring buffer object.
psUSBRingBuf | points to the ring buffer to be initialized. |
pui8Buf | points to the data buffer to be used for the ring buffer. |
ui32Size | is the size of the buffer in bytes. |
This function initializes a ring buffer object, preparing it to store data.
References NULL, tUSBRingBufObject::pui8Buf, tUSBRingBufObject::ui32ReadIndex, tUSBRingBufObject::ui32Size, and tUSBRingBufObject::ui32WriteIndex.
Referenced by USBBufferInit().