English
Language : 

MCIMX233CJM4B Datasheet, PDF (1521/1612 Pages) Freescale Semiconductor, Inc – i.MX23 Applications Processor Reference Manual
Register Macro Usage
// Macros and defines that relate to the fields of a register are named:
//
//
BM_<module>_<regname>_<field>
//
BP_<module>_<regname>_<field>
//
- defines for the field's bit mask and bit position
//
//
BF_<module>_<regname>_<field>()
//
BF_<module>_<regname>_<field>_V(<valuename>)
//
- macros for generating a bit field value. The parameter is masked
//
and shifted to the field position.
//
//
BW_<module>_<regname>_<field>()
//
- macro for writing a bit field. Usually expands to a CS operation.
//
Not generated for read-only fields.
//
//
BV_<module>_<regname>_<field>__<valuename>
//
- define equates to an unshifted named value for the field
//
// Some hardware modules repeat the same register definition multiple times. An
// example is a block that implements multiple channels. For these registers,
// the name adds a lowercase 'n' after the module, and the HW_ macros take a
// numbered parameter to select the channel (or instance). This allows these
// macros to be used in for loops.
//
//
HW_<module>n_<regname><macrotype>(n,...)
//
- the n parameter must evaluate to an integer, and selects the channel
//
or instance number.
//
// The regs.h include file provides several “generic” macros that can be used
// as an alternate syntax for the various register operations. Because most
// operations involve using two or more of the above defines/macros, the <module>,
// <regname> and <field> are often repeated in a C expression. The generic
// macros provide shorthand to avoid the repetition. Refer to the following
// examples for the alternate syntax.
The C++ style comments above represent a single-instance block. For multiple-instance blocks, the mac-
ros are similar, but have an instance number as the first parameter where needed. (Differences only
shown below.)
Note: x is the block instance number. If shown, v is the value field for the macro.
// HW_<module>_<regname>_ADDR(x)
// HW_<module>_<regname>_<SET | CLR | TOG>_ADDR(x)
// - defines for the indicated register address
//
// HW_<module>_<regname>
// - a define for accessing the primary register using the typedef.
// Should be used as an rvalue (i.e., for reading), but avoided as
// an lvalue (i.e., for writing). Will usually generate RMW when
// used as an lvalue.
//
// HW_<module>_<regname>_RD(x)
// HW_<module>_<regname>_WR(x)
// - macros for reading/writing the primary register as a whole
//
// HW_<module>_<regname>_<SET | CLR | TOG>(x)
// - macros for writing the associated set | clear | toggle registers
Freescale Semiconductor
i.MX23 Applications Processor Reference Manual, Rev. 1
Preliminary—Subject to Change Without Notice
39-3