| |||
| Home > Configuring Custom Memory Maps, Registers and Peripherals > Creating an enumeration for setting register values | |||
If any registers have enumerated values, then you can optionally set up enumerations, or names, for specific values that are used when the register value is displayed.
To set up enumerations to use for register values:
Locate the Connection Properties for the BCD file that you want to use to define your custom memory mapped registers:
Select Connection Properties... from the Target menu to display the Connection Properties window.
Expand the (*.bcd) Board/Chip Definitions group.
Expand the ...\ group
for the BCD file. For example, expand the filename.bcd...\MP3.bcd group.
Expand the following groups for the BCD file in turn:
*BOARD=MP3
Advanced_Information
ARM (or the corresponding name
specified in your BCD file)
Register_enum.
Right-click on Register_enum to
display the context menu.
Select Make New... from the
context menu to display the Enter Name of New object dialog box.
The name default is inserted.
Enter E_name for
the name of the group. For example, enter E_ENABLE.
Click Create to close the
dialog box. A new E_ group
is created.name
Select the new E_ group
in the left pane. The group contents are displayed in the right pane.name
Set the value of Names in the
right pane to the required enumeration names. The format of this
settings is:
enum1,enum2,...,enumNTo number the enumerations 0,1,...,N.
For example, Disable,Enable defines Disable as 0 and Enable as 1.
enum1=val1,enum2=val2,...,enumN=valNTo give your enumerations specific values. For example,
if you want Enable to equal 7 and Disable to
equal 0, then enter Disable=0,Enable=7.
The assignment can be in any order, for example Enable=7,Disable=0.
For this example, specify Disable,Enable. Figure 4.21 shows an example:
Select Save and Close from the File menu to save your changes and close the Connection Properties window.
See also: