-
Notifications
You must be signed in to change notification settings - Fork 88
piolib: support transfer lengths that don't fit in 16 bits #107
Copy link
Copy link
Closed
Description
struct rp1_pio_sm_xfer_data_args {
uint16_t sm;
uint16_t dir;
uint16_t data_bytes;
void *data;
};The structure used for data transfers is limited to a 16-bit count of data_bytes.
Our application would like to do larger transfers. Right now we are working around this limitation by submitting several buffers of data sequentially, but it would be preferable if we could submit all the data in one go:
constexpr size_t MAX_XFER = 32768;
void pio_sm_xfer_data_large(PIO pio, int sm, int direction, size_t size, uint32_t *databuf) {
while(size) {
size_t xfersize = std::min(size_t{MAX_XFER}, size);
int r = pio_sm_xfer_data(pio, sm, direction, xfersize, databuf);
if (r) {
perror("pio_sm_xfer_data (reboot may be required)");
abort();
}
size -= xfersize;
databuf += xfersize / sizeof(*databuf);
}
}```Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels