The following code fragment prepares and submits a chain of two
buffers. The first and third buffers describe data sent out through
the device, and the second and fourth buffers describe data that is
read in from the device. The driver cals back the application after
the last buffer in the chain is processed, passing the address of the
buffer that just completed as a parameter to the callback function.
#define ELEMENT_WIDTH
#define NUM_BUFFERS
#define INBOUND_ELEMENTS
#define OUTBOUND_ELEMENTS
static u32 InboundData[INBOUND_ELEMENTS];
static u32 OutboundData[OUTBOUND_ELEMENTS];
// the actual buffers
static ADI_DEV_SEQ_1D_BUFFER SeqBuffer[NUM_BUFFERS
// create outbound buffer for the driver to process
SeqBuffer[0].Buffer.Data
SeqBuffer[0].Buffer.ElementCount
SeqBuffer[0].Buffer.ElementWidth
SeqBuffer[0].Buffer.CallbackParameter = NULL;
SeqBuffer[0].Buffer.pNext = (ADI_DEV_1D_BUFFER
*)&SeqBuffer[1];
SeqBuffer[0].Direction = ADI_DEV_DIRECTION_OUTBOUND;
// create inbound buffer for the driver to process
SeqBuffer[1].Buffer.Data
SeqBuffer[1].Buffer.ElementCount = INBOUND_ELEMENTS;
VisualDSP++ 5.0 Device Drivers and System
Services Manual for Blackfin Processors
(1)
// width of a data element
(2)
(64)
// number of elements to read in
(2)
// number of elements to write out
// no callback
Device Driver Manager
// number of buffers
// inbound data
// outbound data
= OutboundData;
= OUTBOUND_ELEMENTS;
= ELEMENT_WIDTH;
= InboundData;
];
10-29
Need help?
Do you have a question about the VisualDSP++ 5.0 and is the answer not in the manual?