pru_ipc_macros.inc
Register Memory Used

26 Bytes (6.5 regs)

DRAM Memory Used

(8 + 4*noOfBuffers) Bytes

s_PruIpc_config

Strucutre to store the configurable parameters for the Pru Ipc Instance

Size

5 bytes

Elements
blockSize

Number of data packets per Block

noOfBlocks

Number of Blocks per Buffer

noOfBuffers

Maximum Number of Active Buffers

See Also
dataSize

Size of the data packets

s_PruIpc_iterator

Strucutre to store the iterators for the Pru Ipc Instance

Size

9 bytes

Elements
packet

To track data packet index

block

To track block index

buffer

To track buffer index

idxInBlock

To track index inside blocks

See Also
s_PruIpc_register

Strucutre to store temporary registers for the Pru Ipc Instance

Size

6 bytes

Elements
bufferBaseAddr

Stores base address for buffer buffers

bufferOffset

Stores memory offset for TMP.bufferBaseAddr

See Also
Macros
m_pru_ipc_init

Initialization code when the Pru Ipc is started

PEAK cycles: 11 cycle

Invokes

None

Pseudo code:

memcpy(offset(dataSize), PRU_IPC_CONFIG_MEM + DATASIZE_OFFSET, 1);
memcpy(offset(CFG.blockSize), PRU_IPC_CONFIG_MEM + BLOCKSIZE_OFFSET, 4);
ITR = 0;
Parameters
dataSize

Size of the data packets Returns: None

See Also
m_pru_ipc_send

Sends the ADC data packets to the shared memory for each Buffer Creates interrupt event for r5f core to read data packets.  Resets ITR.packet, ITR.block if they oveflow their maximum value

PEAK cycles: (15 + 10*noOfBuffers) cycle

Invokes

None

Pseudo code:

for (ITR.buffer = 0, TMP.bufferOffset = BUFFERBASE_OFFSET;
ITR.buffer < CFG.noOfBuffers;
ITR.buffer++, TMP.bufferOffset+=4) {
dataReg = *dataRegBaseAddr++;
memcpy(offset(TMP.bufferBaseAddr), PRU_IPC_CONFIG_MEM + TMP.bufferOffset, 4);
if (TMP.bufferBaseAddr == 0) continue;
memcpy(offset(dataReg), TMP.bufferBaseAddr + ITR.packet, dataSize);
}
ITR.packet += dataSize;
ITR.idxInBlock++;