O'Reilly logo

ARM® Cortex® M4 Cookbook by Dr. Mark Fisher

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Configuring GPIO ports

The recipe, helloBlinky_c1v0, that we met in Chapter 1, A Practical Introduction to ARM Cortex, uses the LED_On() and LED_Off() functions to switch the LEDs. These functions are defined in a file named LED_MCBSTM32F400.c, which is automatically included in our project if we select LED (API) Board Support when configuring our project using the RTE manager. Let's write another LED program and then take a closer look at LED_MCBSTM32F400.c.

How to do it…

To configure the GPIO ports follow the outlined steps:

  1. Create a folder named countBlinky_c3v0 and a project named countBlinky; use the RTE manager to select Board Support for the LED (API).
  2. Enter the following source code in file named countBlinky.c and add this to the project: ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required