The preceding example is somewhat misleading in its simplicity. Consider that to configure a GPIO pin requires writing two 2-bit fields at the correct location in correct configuration register. In general, the detail required can be excruciating.
Fortunately, the standard peripheral library provides modules for each peripheral that can greatly simplify this task. For example, the following is a subset of the procedures available for managing GPIO ports: