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.
- Enable GPIOs using MSS configurator in Libero SoC.
- Initialize all 32 GPIOs to a predefined state using the MSS_GPIO_init API in SoftConsole or Libero SoC.
- Set the MSS_GPIOLOOPBACK1 bit of the Table 15-8 System register in the SoftConsole application.
- Configure GPIOs as output and input by using the MSS_GPIO_config API.
- Use the MSS_GPIO_set_output API to set the value of the GPIO_OUT register.
- 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.