Manipulation of the configuration

The pin settings needs a name, a pinmap model and an associated package.

The "PinSettings" keyword precedes the name to be given to the configuration.

The "include" keyword introduces the URI to the pinmap model... This file is provided by the "StellarStudio" team.

Now you can edit the file, add the peripherals and their corresponding configurations.

Hint: remember that at any time you can use the magic key combination so that the editor will help you with a contextual content assist helper menu.

Figure 1. Choose a peripheral

add an opening bracket,

Now choose a pin to configure,

Figure 2. Choose a direction, ...

magic key again

Figure 3. ... then a function associated to a pin

The pin is assigned a default name, that the user can change (the keyword introducing the pin name is 'as'. By default the pin name is named after the associated function, with the 'Pin_' prefix.

The syntax here says that the input function CAN3_RX_M_CAN_3_RX is assigned to the pin E7_159 and is named Pin_CAN3_RX_M_CAN_3_RX.

Figure 4. Pin is chosen

Now you must add IO settings (registers configuration for the created pin). You need to add the 'IO' keyword, then use <CTRL><Space bar> again to add registers values for your pin configuration.

magic key again

Figure 5. Add registers bitfields

You can assign either all default bit fields, choosing the first option in the menu add missing attributes with their default values or add individual bit fields at a time.

Please refer to the appropriate MCU reference manual whenever you need some details on the bit fields possible configurations.

For the chosen register, you need to assign a value. There are some bit fields for which an enumerated value is provided. In such a case, the content assist helps you once more, providing you with the different available values.

Figure 6. Resulting configuration

Please note that even if the configuration has been completed with default values, you can choose to change attributes' values, or remove some of them, nevertheless, missing values will be considered as warnings.

--> as long as the pin configuration does not contain the whole set of register attributes, the configuration will appear with a warning.

Figure 7. Warnings on incomplete pin configurations

Now, you can add some additional pins inside the peripheral by using <CTRL><Space bar>.

You can notice that functions already used by a previous configuration are not displayed in the contextual menu.

Figure 8. Add some additional pins

You can add a comment with your peripheral. You must add this comment after the peripheral name, and before the { character.

Figure 9. Add some comments

Inside the generated file, the comment will appear as below:

Figure 10. Comments are added to the generated code