MSS GPIO
UG0331 User Guide Revision 15.0 573
Step 6
Double-click Export Firmware under Handoff Design for Firmware Development in the Libero SoC
design flow window to generate the SoftConsole Firmware Project. The SoftConsole folder contains the
mss_gpio firmware driver. The firmware driver mss_gpio (mss_gpio.h and mss_gpio.c), which provides a
set of functions for controlling the MSS GPIOs, can be downloaded from the Microsemi Firmware
Catalog.
Note: The MSS GPIO supports full behavioral simulation models. Refer to SmartFusion2 MSS BFM Simulation
User Guide for information.
16.3.2 MSS GPIO Use Models
This section explains the use models and gives directions for using MSS GPIOs in an application.
16.3.2.1 Use Model 1: Configuring GPIOs to Act as Interrupt to Cortex-M3 Processor
1. Enable GPIOs using MSS configurator in Libero SoC.
2. Initialize GPIOs to a predefined state using the MSS_GPIO_init API in SoftConsole or Libero SoC.
3. Configure GPIOs as inputs by using the MSS_GPIO_config API in SoftConsole or Libero SoC.
4. Use the interrupt API MSS_GPIO_enable_irq to dynamically configure the input from the MSIO to
interrupt the Cortex-M3 processor. Use API MSS_GPIO_disable_irq to disable the interrupt to the
Cortex-M3 processor.
5. Each GPIO input can also be read using the MSS_GPIO_get_inputs API.
Table 537 • MSS GPIO APIs
Category API Description and Usage
Initialization MSS_GPIO_Init Used for initializing the GPIO byte-wide reset state
Configuration MSS_GPIO_config Used to configure GPIO as input, output, tristate, or
bidirectional
Reading and setting MSS_GPIO_get_inputoutputs Sets the GPIO input state
MSS_GPIO_get_outputs Get the GPIO input state
MSS_GPIO_set_outputs Sets the GPIO output state
MSS_GPIO_set_outputs Get the GPIO output state
Interrupt control MSS_GPIO_disable_irq Disable the GPIO interrupt feature
MSS_GPIO_enable_irq Enable the GPIO interrupt feature
MSS_GPIO_clear_irq Clear interrupt on GPIO