feat: add RTL-SDR, R820t drivers, radio APIs, and sdr demo tool

This commit is contained in:
daniel committed 2026-06-22 11:49:16 +02:00
1 parent 121f3f2081
commit 108538f60c
20 files changed
+2213 -12

No files matched your search

+19
View File
@@ -320,6 +320,12 @@ namespace Drivers::USB::Xhci {
// pipe (e.g. during Bluetooth firmware download).
void ResetInterruptEndpoint(uint8_t slotId);
// Clear a halted bulk IN endpoint (Reset Endpoint + Set TR Dequeue) without
// re-arming. Must be called from process context (it issues commands that
// wait on the event ring); the caller re-arms with QueueBulkInTransfer.
// Used for SDR stream stall recovery (RTL2832 bulk IN can STALL on start).
void ResetBulkInEndpoint(uint8_t slotId);
// True while PollEvents() is draining the event ring. A command submitter
// reached from inside an event callback must fire-and-forget (not wait),
// since a nested PollEvents() is a no-op.
@@ -329,6 +335,19 @@ namespace Drivers::USB::Xhci {
void QueueBulkInTransfer(uint8_t slotId, uint8_t* data, uint64_t dataPhys, uint32_t length);
void QueueBulkOutTransfer(uint8_t slotId, uint8_t* data, uint64_t dataPhys, uint32_t length);
// Continuous multi-buffer bulk-IN streaming. StartBulkInStream allocates
// `numBuffers` (clamped to 16) DMA buffers of `xferLen` bytes (clamped to a
// 4 KiB page) and keeps that many transfers outstanding, auto-re-arming each
// as it completes. The slot's registered transfer callback receives every
// buffer's data but must NOT re-arm itself (the event handler does). This
// eliminates the FIFO-overflow gap of single-outstanding bulk IN. Use for
// sustained high-rate sources (RTL-SDR I/Q). PrimeBulkInStream re-queues the
// whole pool after a stall reset; StopBulkInStream disarms the rotation.
// All three are process-context calls.
void StartBulkInStream(uint8_t slotId, uint32_t xferLen, uint32_t numBuffers);
void PrimeBulkInStream(uint8_t slotId);
void StopBulkInStream(uint8_t slotId);
// Queue a bulk transfer and wait for its completion. Used by storage-style
// class drivers that need command/response ordering on bulk pipes.
uint32_t BulkTransfer(uint8_t slotId, bool dirIn, void* data, uint64_t dataPhys,