4.11. 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:

  1. Locate the Connection Properties for the BCD file that you want to use to define your custom memory mapped registers:

    1. Select Connection Properties... from the Target menu to display the Connection Properties window.

    2. Expand the (*.bcd) Board/Chip Definitions group.

    3. Expand the ...\filename.bcd group for the BCD file. For example, expand the ...\MP3.bcd group.

  2. Expand the following groups for the BCD file in turn:

    1. *BOARD=MP3

    2. Advanced_Information

    3. ARM (or the corresponding name specified in your BCD file)

    4. Register_enum.

  3. Right-click on Register_enum to display the context menu.

  4. Select Make New... from the context menu to display the Enter Name of New object dialog box. The name default is inserted.

  5. Enter E_name for the name of the group. For example, enter E_ENABLE.

  6. Click Create to close the dialog box. A new E_name group is created.

  7. Select the new E_name group in the left pane. The group contents are displayed in the right pane.

  8. Set the value of Names in the right pane to the required enumeration names. The format of this settings is:

    enum1,enum2,...,enumN

    To number the enumerations 0,1,...,N. For example, Disable,Enable defines Disable as 0 and Enable as 1.

    enum1=val1,enum2=val2,...,enumN=valN

    To 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:

    Figure 4.21. Creating enumerations

    Creating enumerations

  9. Select Save and Close from the File menu to save your changes and close the Connection Properties window.

See also:

Copyright © 2002-2010 ARM Limited. All rights reserved.ARM DUI 0182M
Non-ConfidentialID102410