15.3.2.2 Use Model 2: GPIO Loopback Mode

GPIO Loopback mode (shown in the following figure) loops back all the 32 GPIOs by controlling the MSS_LOOPBACK bit of Table 15-8 System register.

  1. Enable GPIOs using MSS configurator in Libero SoC.
  2. Initialize all 32 GPIOs to a predefined state using the MSS_GPIO_init API in SoftConsole or Libero SoC.
  3. Set the MSS_GPIOLOOPBACK1 bit of the Table 15-8 System register in the SoftConsole application.
  4. Configure GPIOs as output and input by using the MSS_GPIO_config API.
  5. Use the MSS_GPIO_set_output API to set the value of the GPIO_OUT register.
  6. Use the interrupt API MSS_GPIO_enable_irq to configure all 32 GPIO outputs as an interrupts to the Cortex-M3 processor.

    (or)

    Use the API MSS_GPIO_get_inputs to read the looped back values and use them the application.

Figure 15-11. GPIO Loopback Diagram