UDI_PIO_REP_ARGS(3udi)


Parameters for repeated PIO transactions

SYNOPSIS

#include <udi.h>

#define \

   UDI_PIO_REP_ARGS ( \

	mode, mem_reg, mem_stride, \

	pio_reg, pio_stride, cnt_reg ) \

		((mode)|(mem_reg)|((mem_stride)<<5)| \

		 ((pio_reg)<<7)|((pio_stride)<<10)| \

		 ((cnt_reg)<<13))
 

ARGUMENTS mode is the addressing mode used to access the memory operand, according to Table 4-1, "PIO Addressing Modes".

mem_reg is the number of the register used to access the memory operand, according to Table 4-1.

mem_stride is the stride value used to increment the memory offset between repeats.

pio_reg is the number of the register used to hold the initial PIO offset. The 32 low-order bits of the register value are used for the PIO offset; any higher order bits are ignored; smaller values previously loaded into the register are zero extended to 32 bits.

pio_stride is the stride value used to increment the PIO offset between repeats.

cnt_reg is the number of the register used to hold the repeat count. The 32 low-order bits of the register value are used for the count; any higher order bits are ignored; smaller values previously loaded into the register are zero extended to 32 bits.

description The UDI_PIO_REP_ARGS macro is used to construct the operand value for UDI_PIO_REP_IN_IND and UDI_PIO_REP_OUT_IND repeating PIO operations (see udi_pio_trans_t).

A repeat operation repeats a basic PIO transaction the number of times indicated by the repeat count from the cnt_reg register. The memory location and PIO offset for the first repetition are determined by mode, mem_reg, and pio_reg. For subsequent repetitions, the memory offset (if mode is not UDI_PIO_DIRECT) and PIO offset are incremented according to the corresponding stride values. The values in the original registers (mem_reg, pio_reg, and cnt_reg) are not affected by stride increments or by repeat count decrements.

The stride values mem_stride and pio_stride indicate a (possibly zero) multiple of the target operation's transaction size, according to the following table.
Table 4-6 Stride Values for PIO Repeat Operations
Stride Code Stride Size in Bytes Multiple of Transaction Size
0
0
0
1
2^tran_size
1
2
2^(tran_size+1)
2
3
2^(tran_size+2)
4

Some examples of how to use stride values are shown in the following table.
Table 4-7 Example Uses of PIO Stride Parameters
Function mem_stride pio_stride
Copy array to/from a contiguous range of device memory
1
1
Copy array to/from single device register
1
0
Fill range of device memory w/single value
0
1
Fill lower 2 bytes of a series of 4-byte aligned device registers (tran_size = 2) with a single value
0
2
Fill lower 2 bytes of a series of 4-byte aligned device registers (tran_size = 2) from an array of 2-byte values
1
2


UDI Physical I/O Specification Contents