mirror of
https://github.com/LNH-team/dspico-usb-examples.git
synced 2026-06-02 09:16:50 +02:00
Initial commit
This commit is contained in:
26
platform/DSPicoUsbOutEndpoint.h
Normal file
26
platform/DSPicoUsbOutEndpoint.h
Normal file
@@ -0,0 +1,26 @@
|
||||
#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();
|
||||
};
|
||||
Reference in New Issue
Block a user