| |||
| Home > Configuring Custom Memory Maps, Registers and Peripherals > Creating a custom peripheral > 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):
Expand the required peripheral register group. For
this example, expand the SERBUS_CTRL_SET group.
Expand the Bit_fields group.
You are now going to set up a bit field.
Create the required bit field (B_SCLS for
this example):
Right-click on the Default group
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 B_SCLS for the name of the bit field.
This specifies the bit field symbol name, which you can reference
using @B_. For
example, namecexpression @B_SCLS.
Click Create to create the B_SCLS bit
field.
Repeat these steps to create additional bit fields as required.
Select the new bit field (B_SCLS)
in the left pane and set up the required values. For example:
Set Position to 0 (this
is the default).
Change Size to the required value.
Leave the value set to 1, which is the default.
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.
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.23 shows an example.
Set up any additional bit fields you have created.
Select Save and Close from the File menu to save your changes and close the Connection Properties window.