4.13.4. Defining separate bit fields for a custom peripheral register

To define separate bit fields for a custom peripheral register (SERBUS_CTRL_SET in this example):

  1. Expand the required peripheral register group. For this example, expand the SERBUS_CTRL_SET group.

  2. Expand the Bit_fields group. You are now going to set up a bit field.

  3. Create the required bit field (B_SCLS for this example):

    1. Right-click on the Default group to display the context menu.

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

    3. Enter B_SCLS for the name of the bit field.

      Note

      This specifies the bit field symbol name, which you can reference using @B_name. For example, cexpression @B_SCLS.

    4. Click Create to create the B_SCLS bit field.

    5. Repeat these steps to create additional bit fields as required.

  4. Select the new bit field (B_SCLS) in the left pane and set up the required values. For example:

    1. Set Position to 0 (this is the default).

    2. Change Size to the required value. Leave the value set to 1, which is the default.

    3. If you want to specify an enumeration for the bit field, you must have previously created the enumeration.

      For example, right-click on Enum, and select E_ENABLE from the context menu.

    4. If you want a specific name to be displayed for your bit field, modify the Gui_name setting. Otherwise, the bit field name (B_SCLS) is used. For example, change Gui_name to SCL Set.

    Figure 4.26 shows the settings for this example.

    Figure 4.26. Creating bit fields for peripheral registers

    Creating bit fields for peripheral registers
  5. Set up any additional bit fields you have created.

  6. Select Save Changes from the File menu to save the these changes.

See also

Copyright © 2002-2007 ARM Limited. All rights reserved.ARM DUI 0182I
Non-Confidential