libopencm3
A free/libre/open-source firmware library for various ARM Cortex-M3 microcontrollers.
General Purpose I/O Defines

Defined Constants and Types for the MSP432E4 General Purpose I/O. More...

Collaboration diagram for General Purpose I/O Defines:

Modules

 GPIO Register Base Addresses
 GPIO Register Base Addresses.
 
 GPIO Pin Identifiers
 GPIO Pin Identifiers.
 
 GPIO Alternate Functions Identifiers
 GPIO Alternate Functions Identifiers.
 
 GPIO Registers
 GPIO Registers.
 
 GPIO_IM Values
 GPIO Interrupt Mask Register Values.
 
 GPIO_RIS Values
 GPIO Raw Interrupt Status Register Values.
 
 GPIO_MIS Values
 GPIO Masked Interrupt Status Register Values.
 
 GPIO_RIS Values
 GPIO Interrupt Clear Register Values.
 
 GPIO_LOCK Values
 GPIO Lock Register Values.
 
 GPIO_PCTL Values
 GPIO Port Control Register Values.
 
 GPIO_SI Values
 GPIO Select Interrupt Register Values.
 
 GPIO_WAKEPEN Values
 GPIO Wake Pin Enable Register Values.
 
 GPIO_WAKELVL Values
 GPIO Wake Level Register Values.
 
 GPIO_WAKESTAT Values
 GPIO Wake Status Register Values.
 
 GPIO_PP Values
 GPIO Peripheral Property Register Values.
 
 GPIO_PC Values
 GPIO Peripheral Configuration Register Values.
 
 GPIO_AF_PA0 Values
 GPIO PA0 Alternate Functions Values.
 
 GPIO_AF_PA1 Values
 GPIO PA1 Alternate Functions Values.
 
 GPIO_AF_PA2 Values
 GPIO PA2 Alternate Functions Values.
 
 GPIO_AF_PA3 Values
 GPIO PA3 Alternate Functions Values.
 
 GPIO_AF_PA4 Values
 GPIO PA4 Alternate Functions Values.
 
 GPIO_AF_PA5 Values
 GPIO PA5 Alternate Functions Values.
 
 GPIO_AF_PA6 Values
 GPIO PA6 Alternate Functions Values.
 
 GPIO_AF_PA7 Values
 GPIO PA7 Alternate Functions Values.
 
 GPIO_AF_PB0 Values
 GPIO PB0 Alternate Functions Values.
 
 GPIO_AF_PB1 Values
 GPIO PB1 Alternate Functions Values.
 
 GPIO_AF_PB2 Values
 GPIO PB2 Alternate Functions Values.
 
 GPIO_AF_PB3 Values
 GPIO PB3 Alternate Functions Values.
 
 GPIO_AF_PB4 Values
 GPIO PB4 Alternate Functions Values.
 
 GPIO_AF_PB5 Values
 GPIO PB5 Alternate Functions Values.
 
 GPIO_AF_PB6 Values
 GPIO PB6 Alternate Functions Values.
 
 GPIO_AF_PB7 Values
 GPIO PB7 Alternate Functions Values.
 
 GPIO_AF_PC0 Values
 GPIO PC0 Alternate Functions Values.
 
 GPIO_AF_PC1 Values
 GPIO PC1 Alternate Functions Values.
 
 GPIO_AF_PC2 Values
 GPIO PC2 Alternate Functions Values.
 
 GPIO_AF_PC3 Values
 GPIO PC3 Alternate Functions Values.
 
 GPIO_AF_PC4 Values
 GPIO PC4 Alternate Functions Values.
 
 GPIO_AF_PC5 Values
 GPIO PC5 Alternate Functions Values.
 
 GPIO_AF_PC6 Values
 GPIO PC6 Alternate Functions Values.
 
 GPIO_AF_PC7 Values
 GPIO PC7 Alternate Functions Values.
 
 GPIO_AF_PD0 Values
 GPIO PD0 Alternate Functions Values.
 
 GPIO_AF_PD1 Values
 GPIO PD1 Alternate Functions Values.
 
 GPIO_AF_PD2 Values
 GPIO PD2 Alternate Functions Values.
 
 GPIO_AF_PD3 Values
 GPIO PD3 Alternate Functions Values.
 
 GPIO_AF_PD4 Values
 GPIO PD4 Alternate Functions Values.
 
 GPIO_AF_PD5 Values
 GPIO PD5 Alternate Functions Values.
 
 GPIO_AF_PD6 Values
 GPIO PD6 Alternate Functions Values.
 
 GPIO_AF_PD7 Values
 GPIO PD7 Alternate Functions Values.
 
 GPIO_AF_PE0 Values
 GPIO PE0 Alternate Functions Values.
 
 GPIO_AF_PE1 Values
 GPIO PE1 Alternate Functions Values.
 
 GPIO_AF_PE2 Values
 GPIO PE2 Alternate Functions Values.
 
 GPIO_AF_PE3 Values
 GPIO PE3 Alternate Functions Values.
 
 GPIO_AF_PE4 Values
 GPIO PE4 Alternate Functions Values.
 
 GPIO_AF_PE5 Values
 GPIO PE5 Alternate Functions Values.
 
 GPIO_AF_PE6 Values
 GPIO PE6 Alternate Functions Values.
 
 GPIO_AF_PE7 Values
 GPIO PE7 Alternate Functions Values.
 
 GPIO_AF_PF0 Values
 GPIO PF0 Alternate Functions Values.
 
 GPIO_AF_PF1 Values
 GPIO PF1 Alternate Functions Values.
 
 GPIO_AF_PF2 Values
 GPIO PF2 Alternate Functions Values.
 
 GPIO_AF_PF3 Values
 GPIO PF3 Alternate Functions Values.
 
 GPIO_AF_PF4 Values
 GPIO PF4 Alternate Functions Values.
 
 GPIO_AF_PF5 Values
 GPIO PF5 Alternate Functions Values.
 
 GPIO_AF_PF6 Values
 GPIO PF6 Alternate Functions Values.
 
 GPIO_AF_PF7 Values
 GPIO PF7 Alternate Functions Values.
 
 GPIO_AF_PG0 Values
 GPIO PG0 Alternate Functions Values.
 
 GPIO_AF_PG1 Values
 GPIO PG1 Alternate Functions Values.
 
 GPIO_AF_PG2 Values
 GPIO PG2 Alternate Functions Values.
 
 GPIO_AF_PG3 Values
 GPIO PG3 Alternate Functions Values.
 
 GPIO_AF_PG4 Values
 GPIO PG4 Alternate Functions Values.
 
 GPIO_AF_PG5 Values
 GPIO PG5 Alternate Functions Values.
 
 GPIO_AF_PG6 Values
 GPIO PG6 Alternate Functions Values.
 
 GPIO_AF_PG7 Values
 GPIO PG7 Alternate Functions Values.
 
 GPIO_AF_PH0 Values
 GPIO PH0 Alternate Functions Values.
 
 GPIO_AF_PH1 Values
 GPIO PH1 Alternate Functions Values.
 
 GPIO_AF_PH2 Values
 GPIO PH2 Alternate Functions Values.
 
 GPIO_AF_PH3 Values
 GPIO PH3 Alternate Functions Values.
 
 GPIO_AF_PH4 Values
 GPIO PH4 Alternate Functions Values.
 
 GPIO_AF_PH5 Values
 GPIO PH5 Alternate Functions Values.
 
 GPIO_AF_PH6 Values
 GPIO PH6 Alternate Functions Values.
 
 GPIO_AF_PH7 Values
 GPIO PH7 Alternate Functions Values.
 
 GPIO_AF_PJ0 Values
 GPIO PJ0 Alternate Functions Values.
 
 GPIO_AF_PJ1 Values
 GPIO PJ1 Alternate Functions Values.
 
 GPIO_AF_PJ2 Values
 GPIO PJ2 Alternate Functions Values.
 
 GPIO_AF_PJ3 Values
 GPIO PJ3 Alternate Functions Values.
 
 GPIO_AF_PJ4 Values
 GPIO PJ4 Alternate Functions Values.
 
 GPIO_AF_PJ5 Values
 GPIO PJ5 Alternate Functions Values.
 
 GPIO_AF_PJ6 Values
 GPIO PJ6 Alternate Functions Values.
 
 GPIO_AF_PJ7 Values
 GPIO PJ7 Alternate Functions Values.
 
 GPIO_AF_PK0 Values
 GPIO PK0 Alternate Functions Values.
 
 GPIO_AF_PK1 Values
 GPIO PK1 Alternate Functions Values.
 
 GPIO_AF_PK2 Values
 GPIO PK2 Alternate Functions Values.
 
 GPIO_AF_PK3 Values
 GPIO PK3 Alternate Functions Values.
 
 GPIO_AF_PK4 Values
 GPIO PK4 Alternate Functions Values.
 
 GPIO_AF_PK5 Values
 GPIO PK5 Alternate Functions Values.
 
 GPIO_AF_PK6 Values
 GPIO PK6 Alternate Functions Values.
 
 GPIO_AF_PK7 Values
 GPIO PK7 Alternate Functions Values.
 
 GPIO_AF_PL0 Values
 GPIO PL0 Alternate Functions Values.
 
 GPIO_AF_PL1 Values
 GPIO PL1 Alternate Functions Values.
 
 GPIO_AF_PL2 Values
 GPIO PL2 Alternate Functions Values.
 
 GPIO_AF_PL3 Values
 GPIO PL3 Alternate Functions Values.
 
 GPIO_AF_PL4 Values
 GPIO PL4 Alternate Functions Values.
 
 GPIO_AF_PL5 Values
 GPIO PL5 Alternate Functions Values.
 
 GPIO_AF_PL6 Values
 GPIO PL6 Alternate Functions Values.
 
 GPIO_AF_PL7 Values
 GPIO PL7 Alternate Functions Values.
 
 GPIO_AF_PM0 Values
 GPIO PM0 Alternate Functions Values.
 
 GPIO_AF_PM1 Values
 GPIO PM1 Alternate Functions Values.
 
 GPIO_AF_PM2 Values
 GPIO PM2 Alternate Functions Values.
 
 GPIO_AF_PM3 Values
 GPIO PM3 Alternate Functions Values.
 
 GPIO_AF_PM4 Values
 GPIO PM4 Alternate Functions Values.
 
 GPIO_AF_PM5 Values
 GPIO PM5 Alternate Functions Values.
 
 GPIO_AF_PM6 Values
 GPIO PM6 Alternate Functions Values.
 
 GPIO_AF_PM7 Values
 GPIO PM7 Alternate Functions Values.
 
 GPIO_AF_PN0 Values
 GPIO PN0 Alternate Functions Values.
 
 GPIO_AF_PN1 Values
 GPIO PN1 Alternate Functions Values.
 
 GPIO_AF_PN2 Values
 GPIO PN2 Alternate Functions Values.
 
 GPIO_AF_PN3 Values
 GPIO PN3 Alternate Functions Values.
 
 GPIO_AF_PN4 Values
 GPIO PN4 Alternate Functions Values.
 
 GPIO_AF_PN5 Values
 GPIO PN5 Alternate Functions Values.
 
 GPIO_AF_PN7 Values
 GPIO PN6 Alternate Functions Values.
 
 GPIO_AF_PN7 Values
 GPIO PN7 Alternate Functions Values.
 
 GPIO_AF_PP0 Values
 GPIO PP0 Alternate Functions Values.
 
 GPIO_AF_PP1 Values
 GPIO PP1 Alternate Functions Values.
 
 GPIO_AF_PP2 Values
 GPIO PP2 Alternate Functions Values.
 
 GPIO_AF_PP3 Values
 GPIO PP3 Alternate Functions Values.
 
 GPIO_AF_PP4 Values
 GPIO PP4 Alternate Functions Values.
 
 GPIO_AF_PP5 Values
 GPIO PP5 Alternate Functions Values.
 
 GPIO_AF_PP6 Values
 GPIO PP6 Alternate Functions Values.
 
 GPIO_AF_PP7 Values
 GPIO PP7 Alternate Functions Values.
 
 GPIO_AF_PQ0 Values
 GPIO PQ0 Alternate Functions Values.
 
 GPIO_AF_PQ1 Values
 GPIO PQ1 Alternate Functions Values.
 
 GPIO_AF_PQ2 Values
 GPIO PQ2 Alternate Functions Values.
 
 GPIO_AF_PQ3 Values
 GPIO PQ3 Alternate Functions Values.
 
 GPIO_AF_PQ4 Values
 GPIO PQ4 Alternate Functions Values.
 
 GPIO_AF_PQ5 Values
 GPIO PQ5 Alternate Functions Values.
 
 GPIO_AF_PQ6 Values
 GPIO PQ6 Alternate Functions Values.
 
 GPIO_AF_PQ7 Values
 GPIO PQ7 Alternate Functions Values.
 
 GPIO_AF_PR0 Values
 GPIO PR0 Alternate Functions Values.
 
 GPIO_AF_PR1 Values
 GPIO PR1 Alternate Functions Values.
 
 GPIO_AF_PR2 Values
 GPIO PR2 Alternate Functions Values.
 
 GPIO_AF_PR3 Values
 GPIO PR3 Alternate Functions Values.
 
 GPIO_AF_PR4 Values
 GPIO PR4 Alternate Functions Values.
 
 GPIO_AF_PR5 Values
 GPIO PR5 Alternate Functions Values.
 
 GPIO_AF_PR6 Values
 GPIO PR6 Alternate Functions Values.
 
 GPIO_AF_PR7 Values
 GPIO PR7 Alternate Functions Values.
 
 GPIO_AF_PS0 Values
 GPIO PS0 Alternate Functions Values.
 
 GPIO_AF_PS1 Values
 GPIO PS1 Alternate Functions Values.
 
 GPIO_AF_PS2 Values
 GPIO PS2 Alternate Functions Values.
 
 GPIO_AF_PS3 Values
 GPIO PS3 Alternate Functions Values.
 
 GPIO_AF_PS4 Values
 GPIO PS4 Alternate Functions Values.
 
 GPIO_AF_PS5 Values
 GPIO PS5 Alternate Functions Values.
 
 GPIO_AF_PS6 Values
 GPIO PS6 Alternate Functions Values.
 
 GPIO_AF_PS7 Values
 GPIO PS7 Alternate Functions Values.
 
 GPIO_AF_PT0 Values
 GPIO PT0 Alternate Functions Values.
 
 GPIO_AF_PT1 Values
 GPIO PT1 Alternate Functions Values.
 
 GPIO_AF_PT2 Values
 GPIO PT2 Alternate Functions Values.
 
 GPIO_AF_PT3 Values
 GPIO PT3 Alternate Functions Values.
 

Enumerations

enum  gpio_mode { GPIO_MODE_OUTPUT , GPIO_MODE_INPUT , GPIO_MODE_ANALOG }
 GPIO Mode Definitions. More...
 
enum  gpio_pull_up_down { GPIO_PUPD_NONE , GPIO_PUPD_PULLUP , GPIO_PUPD_PULLDOWN }
 GPIO Pull-Up/Pull-Down Definitions. More...
 
enum  gpio_output_type { GPIO_OTYPE_PP , GPIO_OTYPE_OD }
 GPIO Output Type Definitions. More...
 
enum  gpio_drive_strength {
  GPIO_DRIVE_2MA , GPIO_DRIVE_4MA , GPIO_DRIVE_6MA , GPIO_DRIVE_8MA ,
  GPIO_DRIVE_10MA , GPIO_DRIVE_12MA
}
 GPIO Drive Strength Definitions. More...
 
enum  gpio_slew_ctl { GPIO_SLEW_CTL_ENABLE , GPIO_SLEW_CTL_DISABLE }
 GPIO Slew Control Definitions. More...
 
enum  gpio_trigger {
  GPIO_TRIG_LVL_LOW , GPIO_TRIG_LVL_HIGH , GPIO_TRIG_EDGE_FALL , GPIO_TRIG_EDGE_RISE ,
  GPIO_TRIG_EDGE_BOTH
}
 GPIO Trigger Level/Edge Definitions. More...
 

Functions

void gpio_mode_setup (uint32_t gpioport, enum gpio_mode mode, enum gpio_pull_up_down pull_up_down, uint8_t gpios)
 General Purpose Input/Outputs Set Pin Mode. More...
 
void gpio_set_output_options (uint32_t gpioport, enum gpio_output_type otype, enum gpio_drive_strength drive, enum gpio_slew_ctl slewctl, uint8_t gpios)
 General Purpose Input/Outputs Set Output Options. More...
 
void gpio_set_af (uint32_t gpioport, uint8_t alt_func_num, uint8_t gpios)
 General Purpose Input/Outputs Set Alternate Function Selection. More...
 
void gpio_configure_trigger (uint32_t gpioport, enum gpio_trigger trigger, uint8_t gpios)
 General Purpose Input/Outputs Configure Interrupt Trigger. More...
 
void gpio_set (uint32_t gpioport, uint8_t gpios)
 General Purpose Input/Outputs Set a Group of Pins Atomic. More...
 
void gpio_clear (uint32_t gpioport, uint8_t gpios)
 General Purpose Input/Outputs Clear a Group of Pins Atomic. More...
 
uint8_t gpio_get (uint32_t gpioport, uint8_t gpios)
 General Purpose Input/Outputs Read a Group of Pins. More...
 
void gpio_toggle (uint32_t gpioport, uint8_t gpios)
 General Purpose Input/Outputs Toggle a Group of Pins. More...
 
uint8_t gpio_port_read (uint32_t gpioport)
 General Purpose Input/Outputs Read from a Port. More...
 
void gpio_port_write (uint32_t gpioport, uint8_t data)
 General Purpose Input/Outputs Write to a Port. More...
 
void gpio_enable_interrupts (uint32_t gpioport, uint8_t gpios)
 General Purpose Input/Outputs Enable Interrupts on specified pins. More...
 
void gpio_disable_interrupts (uint32_t gpioport, uint8_t gpios)
 General Purpose Input/Outputs Disable interrupts on specified pins. More...
 
void gpio_unlock_commit (uint32_t gpioport, uint8_t gpios)
 General Purpose Input/Outputs Unlock The Commit Control. More...
 
uint8_t gpio_is_interrupt_source (uint32_t gpioport, uint8_t gpios)
 General Purpose Input/Outputs Determine if interrupt is generated by the given pin. More...
 
void gpio_clear_interrupt_flag (uint32_t gpioport, uint8_t gpios)
 General Purpose Input/Outputs Mark Interrupt as Serviced. More...
 

Detailed Description

Defined Constants and Types for the MSP432E4 General Purpose I/O.

Version
1.0.0
Date
23 September 2018

LGPL License Terms libopencm3 License

Enumeration Type Documentation

◆ gpio_drive_strength

GPIO Drive Strength Definitions.

Enumerator
GPIO_DRIVE_2MA 

2mA drive

GPIO_DRIVE_4MA 

4mA drive

GPIO_DRIVE_6MA 

6mA drive

GPIO_DRIVE_8MA 

8mA drive

GPIO_DRIVE_10MA 

10mA drive

GPIO_DRIVE_12MA 

12mA drive

Definition at line 2473 of file gpio.h.

◆ gpio_mode

enum gpio_mode

GPIO Mode Definitions.

Enumerator
GPIO_MODE_OUTPUT 

Configure pin as output.

GPIO_MODE_INPUT 

Configure pin as input.

GPIO_MODE_ANALOG 

Configure pin as analog function.

Definition at line 2453 of file gpio.h.

◆ gpio_output_type

GPIO Output Type Definitions.

Enumerator
GPIO_OTYPE_PP 

Push-pull configuration.

GPIO_OTYPE_OD 

Open drain configuration.

Definition at line 2467 of file gpio.h.

◆ gpio_pull_up_down

GPIO Pull-Up/Pull-Down Definitions.

Enumerator
GPIO_PUPD_NONE 

Do not pull the pin high or low.

GPIO_PUPD_PULLUP 

Pull the pin high.

GPIO_PUPD_PULLDOWN 

Pull the pin low.

Definition at line 2460 of file gpio.h.

◆ gpio_slew_ctl

GPIO Slew Control Definitions.

Enumerator
GPIO_SLEW_CTL_ENABLE 

Slew rate control enable.

GPIO_SLEW_CTL_DISABLE 

Slew rate control disable.

Definition at line 2483 of file gpio.h.

◆ gpio_trigger

GPIO Trigger Level/Edge Definitions.

Enumerator
GPIO_TRIG_LVL_LOW 

Level trigger, signal low.

GPIO_TRIG_LVL_HIGH 

Level trigger, signal high.

GPIO_TRIG_EDGE_FALL 

Falling edge trigger.

GPIO_TRIG_EDGE_RISE 

Rising edge trigger.

GPIO_TRIG_EDGE_BOTH 

Both edges trigger.

Definition at line 2489 of file gpio.h.

Function Documentation

◆ gpio_clear()

void gpio_clear ( uint32_t  gpioport,
uint8_t  gpios 
)

General Purpose Input/Outputs Clear a Group of Pins Atomic.

Clear one or more pins of the given GPIO port to 0 in an atomic operation.

Parameters
[in]gpioportGPIO block register address base GPIO Register Base Addresses
[in]gpiosPin identifiers GPIO Pin Identifiers. If multiple pins are to be changed, use bitwise OR '|' to separate them.

Definition at line 306 of file gpio.c.

References GPIO_DATA.

◆ gpio_clear_interrupt_flag()

void gpio_clear_interrupt_flag ( uint32_t  gpioport,
uint8_t  gpios 
)

General Purpose Input/Outputs Mark Interrupt as Serviced.

After an interrupt is services, its flag must be cleared. If the flag is not cleared, then execution will jump back to the start of the ISR after the ISR returns.

Parameters
[in]gpioportGPIO block register address base GPIO Register Base Addresses
[in]gpiosPin identifiers GPIO Pin Identifiers. If multiple pins are to be clear interrupt flag, use bitwise OR '|' to separate them.

Definition at line 445 of file gpio.c.

References GPIO_ICR.

◆ gpio_configure_trigger()

void gpio_configure_trigger ( uint32_t  gpioport,
enum gpio_trigger  trigger,
uint8_t  gpios 
)

General Purpose Input/Outputs Configure Interrupt Trigger.

Sets the trigger level/edge, for a set of GPIO pins on a given GPIO port.

Parameters
[in]gpioportGPIO block register address base GPIO Register Base Addresses
[in]triggerTrigger configuration gpio_trigger
  • GPIO_TRIG_LVL_LOW – Trigger on low level
  • GPIO_TRIG_LVL_HIGH – Trigger on high level
  • GPIO_TRIG_EDGE_FALL – Trigger on falling edges
  • GPIO_TRIG_EDGE_RISE – Trigger on rising edges
  • GPIO_TRIG_EDGE_BOTH – Trigger on all edges
[in]gpiosPin identifiers GPIO Pin Identifiers. If multiple pins are to be configure, use bitwise OR '|' to separate them.

Definition at line 253 of file gpio.c.

References GPIO_IBE, GPIO_IEV, GPIO_IS, GPIO_TRIG_EDGE_BOTH, GPIO_TRIG_EDGE_FALL, GPIO_TRIG_EDGE_RISE, GPIO_TRIG_LVL_HIGH, and GPIO_TRIG_LVL_LOW.

◆ gpio_disable_interrupts()

void gpio_disable_interrupts ( uint32_t  gpioport,
uint8_t  gpios 
)

General Purpose Input/Outputs Disable interrupts on specified pins.

Disable interrupts on the specified GPIO pins.

Parameters
[in]gpioportGPIO block register address base GPIO Register Base Addresses
[in]gpiosPin identifiers GPIO Pin Identifiers. Pins whose interrupts to disable. If multiple pins are to be disable interrupt, use bitwise OR '|' to separate them.

Definition at line 393 of file gpio.c.

References GPIO_IM.

◆ gpio_enable_interrupts()

void gpio_enable_interrupts ( uint32_t  gpioport,
uint8_t  gpios 
)

General Purpose Input/Outputs Enable Interrupts on specified pins.

Enable interrupts on the specified GPIO pins.

Note
The NVIC must be enabled and properly configured for the interrupt to be routed to the CPU.
Parameters
[in]gpioportGPIO block register address base GPIO Register Base Addresses)
[in]gpiosPin identifiers GPIO Pin Identifiers. Pins whose interrupts to enable. If multiple pins are to be enable interrupt, use bitwise OR '|' to separate them.

Definition at line 378 of file gpio.c.

References GPIO_IM.

◆ gpio_get()

uint8_t gpio_get ( uint32_t  gpioport,
uint8_t  gpios 
)

General Purpose Input/Outputs Read a Group of Pins.

Parameters
[in]gpioportGPIO block register address base GPIO Register Base Addresses
[in]gpiosPin identifiers GPIO Pin Identifiers. If multiple pins are to be read, use bitwise OR '|' to separate them.
Returns
Unsigned int8 value of the pin values. The bit position of the pin value returned corresponds to the pin number.

Definition at line 320 of file gpio.c.

References GPIO_DATA.

◆ gpio_is_interrupt_source()

uint8_t gpio_is_interrupt_source ( uint32_t  gpioport,
uint8_t  gpios 
)

General Purpose Input/Outputs Determine if interrupt is generated by the given pin.

Parameters
[in]gpioportGPIO block register address base GPIO Register Base Addresses
[in]gpiosSource pin identifiers GPIO Pin Identifiers. If multiple pins are to be check, use bitwise OR '|' to separate them.
Returns
Unsigned int8. The bit position of the pin value returned corresponds to the pin number.

Definition at line 430 of file gpio.c.

References GPIO_MIS.

◆ gpio_mode_setup()

void gpio_mode_setup ( uint32_t  gpioport,
enum gpio_mode  mode,
enum gpio_pull_up_down  pull_up_down,
uint8_t  gpios 
)

General Purpose Input/Outputs Set Pin Mode.

Sets the Pin Direction, Analog/Digital Mode and Output Pin Pull, for a set of GPIO pins on a given GPIO port.

Parameters
[in]gpioportGPIO block register address base GPIO Register Base Addresses
[in]modePin mode gpio_mode
  • GPIO_MODE_OUTPUT – Configure pin as output
  • GPIO_MODE_INPUT – Configure pin as input
  • GPIO_MODE_ANALOG – Configure pin as analog function
[in]pull_up_downPin pull up/down configuration gpio_pull_up_down
  • GPIO_PUPD_NONE – Do not pull the pin high or low
  • GPIO_PUPD_PULLUP – Pull the pin high
  • GPIO_PUPD_PULLDOWN – Pull the pin low
[in]gpiosPin identifiers GPIO Pin Identifiers. If multiple pins are to be set, use bitwise OR '|' to separate them.

Definition at line 55 of file gpio.c.

References GPIO_AFSEL, GPIO_AMSEL, GPIO_DEN, GPIO_DIR, GPIO_MODE_ANALOG, GPIO_MODE_INPUT, GPIO_MODE_OUTPUT, GPIO_PDR, GPIO_PUPD_NONE, GPIO_PUPD_PULLDOWN, GPIO_PUPD_PULLUP, and GPIO_PUR.

◆ gpio_port_read()

uint8_t gpio_port_read ( uint32_t  gpioport)

General Purpose Input/Outputs Read from a Port.

Read the current value of the given GPIO port.

Parameters
[in]gpioportGPIO block register address base GPIO Register Base Addresses
Returns
Unsigned int8. The value held in the specified GPIO port.

Definition at line 348 of file gpio.c.

References GPIO_ALL, and GPIO_DATA.

◆ gpio_port_write()

void gpio_port_write ( uint32_t  gpioport,
uint8_t  data 
)

General Purpose Input/Outputs Write to a Port.

Write a value to the given GPIO port.

Parameters
[in]gpioportGPIO block register address base GPIO Register Base Addresses
[in]dataUnsigned int8. The value to be written to the GPIO port.

Definition at line 360 of file gpio.c.

References GPIO_ALL, and GPIO_DATA.

◆ gpio_set()

void gpio_set ( uint32_t  gpioport,
uint8_t  gpios 
)

General Purpose Input/Outputs Set a Group of Pins Atomic.

Set one or more pins of the given GPIO port to 1 in an atomic operation.

Parameters
[in]gpioportGPIO block register address base GPIO Register Base Addresses
[in]gpiosPin identifiers GPIO Pin Identifiers. If multiple pins are to be changed, use bitwise OR '|' to separate them.

Definition at line 293 of file gpio.c.

References GPIO_DATA.

◆ gpio_set_af()

void gpio_set_af ( uint32_t  gpioport,
uint8_t  alt_func_num,
uint8_t  gpios 
)

General Purpose Input/Outputs Set Alternate Function Selection.

Mux the pin or group of pins to the given alternate function. Note that a number of pins may be set but only with a single AF number.

Because AF0 is not used on the MSP432E4, passing GPIO_AF_DISABLE as the alt_func_num parameter will disable the alternate function of the given pins.

Parameters
[in]gpioportGPIO block register address base GPIO Register Base Addresses
[in]alt_func_numPin alternate function number or GPIO_AF_DISABLE to disable the alternate function multiplexing.
[in]gpiosPin identifiers GPIO Pin Identifiers. If multiple pins are to be set, use bitwise OR '|' to separate them.

Definition at line 208 of file gpio.c.

References GPIO_AFSEL, GPIO_PCTL, and GPIO_PCTL_AF.

◆ gpio_set_output_options()

void gpio_set_output_options ( uint32_t  gpioport,
enum gpio_output_type  otype,
enum gpio_drive_strength  drive,
enum gpio_slew_ctl  slewctl,
uint8_t  gpios 
)

General Purpose Input/Outputs Set Output Options.

When the pin is set to output mode, this sets the configuration (open drain/push pull), drive strength, speed and slew rate control, for a set of GPIO pins on a given GPIO port.

Parameters
[in]gpioportGPIO block register address base GPIO Register Base Addresses
[in]otypeOutput driver configuration gpio_output_type
  • GPIO_OTYPE_PP – Configure pin driver as push-pull
  • GPIO_OTYPE_OD – Configure pin driver as open drain
[in]drivePin drive strength gpio_drive_strength
  • GPIO_DRIVE_2MA – 2mA drive
  • GPIO_DRIVE_4MA – 4mA drive
  • GPIO_DRIVE_6MA – 4mA drive
  • GPIO_DRIVE_8MA – 8mA drive
  • GPIO_DRIVE_10MA – 10mA drive
  • GPIO_DRIVE_12MA – 12mA drive
[in]slewctlPin slew rate control select gpio_slew_ctl
Note
Available only for 8, 10 and 12-ma drive strength.
  • GPIO_SLEW_CTL_ENABLE – Slew rate control enable
  • GPIO_SLEW_CTL_DISABLE – Slew rate control disable
Parameters
[in]gpiosPin identifiers GPIO Pin Identifiers. If multiple pins are to be set, use bitwise OR '|' to separate them.

Definition at line 126 of file gpio.c.

References GPIO_DR12R, GPIO_DR4R, GPIO_DR8R, GPIO_DRIVE_10MA, GPIO_DRIVE_12MA, GPIO_DRIVE_2MA, GPIO_DRIVE_4MA, GPIO_DRIVE_6MA, GPIO_DRIVE_8MA, GPIO_ODR, GPIO_OTYPE_OD, GPIO_PC, GPIO_PC_EDM, GPIO_PC_EDM_FULL_RANGE, GPIO_PP, GPIO_PP_EDE, GPIO_SLEW_CTL_ENABLE, and GPIO_SLR.

◆ gpio_toggle()

void gpio_toggle ( uint32_t  gpioport,
uint8_t  gpios 
)

General Purpose Input/Outputs Toggle a Group of Pins.

Toggle one or more pins of the given GPIO port. The non-toggled pins are not affected.

Parameters
[in]gpioportGPIO block register address base GPIO Register Base Addresses
[in]gpiosPin identifiers GPIO Pin Identifiers. If multiple pins are to be changed, use bitwise OR '|' to separate them.

Definition at line 334 of file gpio.c.

References GPIO_ALL, and GPIO_DATA.

◆ gpio_unlock_commit()

void gpio_unlock_commit ( uint32_t  gpioport,
uint8_t  gpios 
)

General Purpose Input/Outputs Unlock The Commit Control.

Unlocks the commit control of the given pin or group of pins. If a pin is a JTAG/SWD or NMI, the pin may then be reconfigured as a GPIO pin. If the pin is not locked by default, this has no effect.

Parameters
[in]gpioportGPIO block register address base GPIO Register Base Addresses
[in]gpiosPin identifiers GPIO Pin Identifiers. If multiple pins are to be unlock, use bitwise OR '|' to separate them.

Definition at line 409 of file gpio.c.

References GPIO_CR, GPIO_LOCK, and GPIO_LOCK_UNLOCK_CODE.