AnsweredAssumed Answered

Creating Sequential One-Dimensional Buffers

Question asked by spflanze on Jun 18, 2012
Latest reply on Jul 10, 2012 by CraigG

I am confused by the example code in the documentation at:

Device Drivers and System Services Manual for Blackfin® Processors > 10 Device Driver Manager > Creating Sequential One-Dimensional Buffers

 

As I understand this example the element width is set to 1 byte and there are 64 inbound elements and 2 output elements. According to this code snippet from that help file:

 

#define INBOUND_ELEMENTS (64) // number of elements to read in

#define OUTBOUND_ELEMENTS (2) // number of elements to write out


 

static u32 InboundData[INBOUND_ELEMENTS]; // inbound data

static u32 OutboundData[OUTBOUND_ELEMENTS];  // outbound data

 

the number of bytes reserved for the incoming buffer 256 and the for the outbound buffer it is 8 bytes. This is because each element of these data arrays is 4 bytes. I need to know why much more memory than needed is reserved for these buffers. I also need to know how the data will be packed in the buffer. Is the output data supposed to be packed into the least significant bytes of each element in OutboundData? Does the 64 bytes of data returned come back in the least significant byte of the each element in InboundData?

 

I also need to know which one of the functions adi_dev_Write or adi_dev_Read to pass the buffer sequence to. Or does a single call to adi_dev_SequentialIO take their place?

 

This buffer will be used with the Two Wire Interface to communicate with an AD5272 Digital Potentiometer.

 

 


Outcomes