IoCopyOut (FUN)

FUNCTION IoCopyOut

IoCopyOut should be used for copying data of I/O channels.

This function copies a specific number of bits from adress “pbySrc” + “wSrcStartBit” to “pbyDst” + “wDstStartBit”. Depending on the local byte order of the CPU, this function takes also care about swapping.

If possible, the data is copied in bytes. If not, the bits are copied seperately one after another. In the latter case, the bit accesses are done atomically, using SysCpuSetBit[/2].

Note, that this function (similar to memcpy in C) makes no additional checks of input parameters. The caller has to take care about the validity of pointers and sizes, passed to this function.

As the function implements no error handling, the exact count of “wSize” bits is copied to “pbyDst” + “wDstStartBit”.

InOut:

Scope

Name

Type

Comment

Input

pbyDst

POINTER TO BYTE

pointer to destination memory

wDstStartBit

WORD

start bit in destination memory (>= 0)

pbySrc

POINTER TO BYTE

pointer to source memory

wSrcStartBit

WORD

start bit in source memory (>= 0)

wSize

WORD

number of bits to copy

wBaseSize

WORD

size of base type of the I/O channel