You've already forked dspico-usb-examples
mirror of
https://github.com/LNH-team/dspico-usb-examples.git
synced 2026-01-09 16:27:56 -08:00
27 lines
670 B
C++
27 lines
670 B
C++
#pragma once
|
|
|
|
class DSPicoUsbOutEndpoint
|
|
{
|
|
public:
|
|
explicit DSPicoUsbOutEndpoint(u8 endpointAddress)
|
|
: _endpointAddress(endpointAddress), _currentDSPicoBuffer(0), _buffer(nullptr)
|
|
, _bufferLength(0), _bufferOffset(0), _totalReceived(0), _transferActive(false)
|
|
{
|
|
rtos_createMutex(&_mutex);
|
|
}
|
|
|
|
void BeginTransfer(u8* buffer, u32 length);
|
|
void ProcessTransferCompleteEvent(u32 transferredBytes);
|
|
private:
|
|
u8 _endpointAddress;
|
|
u8 _currentDSPicoBuffer;
|
|
u8* _buffer;
|
|
u32 _bufferLength;
|
|
u32 _bufferOffset;
|
|
u32 _totalReceived;
|
|
bool _transferActive;
|
|
rtos_mutex_t _mutex;
|
|
|
|
void ReceiveUsbBlock();
|
|
};
|