1
0
mirror of https://github.com/preble/libpinproc synced 2026-02-24 18:25:23 +01:00

Implement ganged writes to improve USB utilization

This commit is contained in:
gstellenberg
2009-05-29 12:05:25 -05:00
parent dc8ec90ab5
commit 375f2f4005
2 changed files with 52 additions and 10 deletions

View File

@@ -38,6 +38,7 @@ using namespace std;
#define maxDriverGroups (26)
#define maxDrivers (256)
#define maxSwitchRules (256<<2) // 8 bits of switchNum indicies plus bits for debounced and state.
#define maxWriteWords (1536) // Hardware supports 2048 word bursts, but restrict to 1536 for margin.
class PRDevice
{
@@ -76,6 +77,13 @@ protected:
PRResult VerifyChipID();
// Raw write and read methods
//
/** Schedules data to be written to the P-ROC. */
PRResult PrepareWriteData(uint32_t * buffer, int32_t numWords);
/** Initiates a burst write of all data scheduled to be written to the P-ROC. */
PRResult FlushWriteData();
/** Writes data to P-ROC.
* Returns #kPFailure if the number of words read does not match the number requested.
@@ -112,6 +120,9 @@ protected:
queue<uint32_t> unrequestedDataQueue; /**< Queue of words received from the device that were not requested via RequestData(). Usually switch events. */
queue<uint32_t> requestedDataQueue; /**< Queue of words received from the device as the result of a call to RequestData(). */
uint32_t preparedWriteWords[maxWriteWords];
int32_t numPreparedWriteWords;
uint8_t collected_bytes_fifo[FTDI_BUFFER_SIZE];
int32_t collected_bytes_rd_addr;
int32_t collected_bytes_wr_addr;