Periphbitgrpzs - Set Bit Group To Given Value; Periphbitset Arguments - Freescale Semiconductor DSP56800E User Manual

Hide thumbs Also See for DSP56800E:
Table of Contents

Advertisement

Mask
pAddr
Description: The periphBitGrpRS macro sets the bit group to a given value in a memory location
addressed by parameter pAddr. All bits specified by GroupMask are affected. The bits are either
set if the corresponding bits in Mask value are also set or they are cleared if the corresponding bits
in Mask value are cleared.
The "RS" variant uses two non-interruptible instructions bfclr and bfset to accomplish the
requested operation. The bfclr first clears the "zero" bits in the destination location, and bfset then
sets the "one" bits there.
Caution: This macro is the optimal way how to set the specified group of bits to given value.
However, it must be kept in mind that during the short time between these two bit operations, the
target memory location goes through the third state where the bit group might contain invalid
value ("zeroes" already cleared but "ones" not yet set).
Example 2-24. periphBitGrpRS macro usage
periphBitGrpRS(0x007f, 10, &ArchIO.Pll.plldb);
This code sets the lower 7 bits of PLL Divide-By register to the value 10. Other bits in the register
are not affected.
2.4.2.8

periphBitGrpZS - set bit group to given value

Call(s):
void periphBitGrpZS(UWord16 GroupMask, UWord16 Mask,
Arguments:
GroupMask
Mask
pAddr
Description: The periphBitGrpZS macro sets the bit group to a given value in a memory location
addressed by parameter pAddr. All bits specified by GroupMask are affected. The bits are either
set if the corresponding bits in Mask value are also set or they are cleared if the corresponding bits
in Mask value are cleared.
The "ZS" variant uses two non-interruptible instructions bfclr and bfset to accomplish the
requested operation. The bfclr first clears all bits in GroupMask and bfset then sets the "one" bits
there.
FREESCALE SEMICONDUCTOR
Table 2-9. periphBitSet arguments
in
"ones" bit mask.
in
The memory address.
UWord16 *pAddr);
Table 2-10. periphBitSet arguments
in
Group mask
in
"ones" bit mask.
in
The memory address.
Targeting 56F8xxx Platform
Boot Sequence
2-17

Advertisement

Table of Contents
loading

Table of Contents