EFR32 Blue Gecko 12 Software Documentation  efr32bg12-doc-5.1.2
GPIO

Detailed Description

General Purpose Input/Output (GPIO) API.

This module contains functions to control the GPIO peripheral of Silicon Labs 32-bit MCUs and SoCs. The GPIO peripheral is used for pin configuration and direct pin manipulation and sensing as well as routing for peripheral pin connections.

Macros

#define gpioDriveStrengthStrong   gpioDriveStrengthStrongAlternateStrong
 
#define gpioDriveStrengthWeak   gpioDriveStrengthWeakAlternateWeak
 

Enumerations

enum  GPIO_DriveStrength_TypeDef {
  gpioDriveStrengthWeakAlternateWeak = GPIO_P_CTRL_DRIVESTRENGTH_WEAK | GPIO_P_CTRL_DRIVESTRENGTHALT_WEAK,
  gpioDriveStrengthWeakAlternateStrong = GPIO_P_CTRL_DRIVESTRENGTH_WEAK | GPIO_P_CTRL_DRIVESTRENGTHALT_STRONG,
  gpioDriveStrengthStrongAlternateWeak = GPIO_P_CTRL_DRIVESTRENGTH_STRONG | GPIO_P_CTRL_DRIVESTRENGTHALT_WEAK,
  gpioDriveStrengthStrongAlternateStrong = GPIO_P_CTRL_DRIVESTRENGTH_STRONG | GPIO_P_CTRL_DRIVESTRENGTHALT_STRONG
}
 
enum  GPIO_Mode_TypeDef {
  gpioModeDisabled = _GPIO_P_MODEL_MODE0_DISABLED,
  gpioModeInput = _GPIO_P_MODEL_MODE0_INPUT,
  gpioModeInputPull = _GPIO_P_MODEL_MODE0_INPUTPULL,
  gpioModeInputPullFilter = _GPIO_P_MODEL_MODE0_INPUTPULLFILTER,
  gpioModePushPull = _GPIO_P_MODEL_MODE0_PUSHPULL,
  gpioModePushPullAlternate = _GPIO_P_MODEL_MODE0_PUSHPULLALT,
  gpioModeWiredOr = _GPIO_P_MODEL_MODE0_WIREDOR,
  gpioModeWiredOrPullDown = _GPIO_P_MODEL_MODE0_WIREDORPULLDOWN,
  gpioModeWiredAnd = _GPIO_P_MODEL_MODE0_WIREDAND,
  gpioModeWiredAndFilter = _GPIO_P_MODEL_MODE0_WIREDANDFILTER,
  gpioModeWiredAndPullUp = _GPIO_P_MODEL_MODE0_WIREDANDPULLUP,
  gpioModeWiredAndPullUpFilter = _GPIO_P_MODEL_MODE0_WIREDANDPULLUPFILTER,
  gpioModeWiredAndAlternate = _GPIO_P_MODEL_MODE0_WIREDANDALT,
  gpioModeWiredAndAlternateFilter = _GPIO_P_MODEL_MODE0_WIREDANDALTFILTER,
  gpioModeWiredAndAlternatePullUp = _GPIO_P_MODEL_MODE0_WIREDANDALTPULLUP,
  gpioModeWiredAndAlternatePullUpFilter = _GPIO_P_MODEL_MODE0_WIREDANDALTPULLUPFILTER
}
 
enum  GPIO_Port_TypeDef
 

Functions

void GPIO_DbgLocationSet (unsigned int location)
 Sets the pin location of the debug pins (Serial Wire interface). More...
 
__STATIC_INLINE void GPIO_DbgSWDClkEnable (bool enable)
 Enable/disable serial wire clock pin. More...
 
__STATIC_INLINE void GPIO_DbgSWDIOEnable (bool enable)
 Enable/disable serial wire data I/O pin. More...
 
__STATIC_INLINE void GPIO_DbgSWOEnable (bool enable)
 Enable/Disable serial wire output pin. More...
 
void GPIO_DriveStrengthSet (GPIO_Port_TypeDef port, GPIO_DriveStrength_TypeDef strength)
 Sets the drive strength for a GPIO port. More...
 
__STATIC_INLINE void GPIO_EM4DisablePinWakeup (uint32_t pinmask)
 Disable GPIO pin wake-up from EM4. More...
 
void GPIO_EM4EnablePinWakeup (uint32_t pinmask, uint32_t polaritymask)
 Enable GPIO pin wake-up from EM4. When the function exits, EM4 mode can be safely entered. More...
 
__STATIC_INLINE uint32_t GPIO_EM4GetPinWakeupCause (void)
 Check which GPIO pin(s) that caused a wake-up from EM4. More...
 
__STATIC_INLINE void GPIO_EM4SetPinRetention (bool enable)
 Enable GPIO pin retention of output enable, output value, pull enable and pull direction in EM4. More...
 
void GPIO_ExtIntConfig (GPIO_Port_TypeDef port, unsigned int pin, unsigned int intNo, bool risingEdge, bool fallingEdge, bool enable)
 Configure GPIO external pin interrupt. More...
 
__STATIC_INLINE void GPIO_InputSenseSet (uint32_t val, uint32_t mask)
 Enable/disable input sensing. More...
 
__STATIC_INLINE void GPIO_IntClear (uint32_t flags)
 Clear one or more pending GPIO interrupts. More...
 
__STATIC_INLINE void GPIO_IntConfig (GPIO_Port_TypeDef port, unsigned int pin, bool risingEdge, bool fallingEdge, bool enable)
 Configure GPIO interrupt. More...
 
__STATIC_INLINE void GPIO_IntDisable (uint32_t flags)
 Disable one or more GPIO interrupts. More...
 
__STATIC_INLINE void GPIO_IntEnable (uint32_t flags)
 Enable one or more GPIO interrupts. More...
 
__STATIC_INLINE uint32_t GPIO_IntGet (void)
 Get pending GPIO interrupts. More...
 
__STATIC_INLINE uint32_t GPIO_IntGetEnabled (void)
 Get enabled and pending GPIO interrupt flags. Useful for handling more interrupt sources in the same interrupt handler. More...
 
__STATIC_INLINE void GPIO_IntSet (uint32_t flags)
 Set one or more pending GPIO interrupts from SW. More...
 
__STATIC_INLINE void GPIO_Lock (void)
 Locks the GPIO configuration.
 
__STATIC_INLINE unsigned int GPIO_PinInGet (GPIO_Port_TypeDef port, unsigned int pin)
 Read the pad value for a single pin in a GPIO port. More...
 
GPIO_Mode_TypeDef GPIO_PinModeGet (GPIO_Port_TypeDef port, unsigned int pin)
 Get the mode for a GPIO pin. More...
 
void GPIO_PinModeSet (GPIO_Port_TypeDef port, unsigned int pin, GPIO_Mode_TypeDef mode, unsigned int out)
 Set the mode for a GPIO pin. More...
 
__STATIC_INLINE void GPIO_PinOutClear (GPIO_Port_TypeDef port, unsigned int pin)
 Set a single pin in GPIO data out port register to 0. More...
 
__STATIC_INLINE unsigned int GPIO_PinOutGet (GPIO_Port_TypeDef port, unsigned int pin)
 Get current setting for a pin in a GPIO port data out register. More...
 
__STATIC_INLINE void GPIO_PinOutSet (GPIO_Port_TypeDef port, unsigned int pin)
 Set a single pin in GPIO data out register to 1. More...
 
__STATIC_INLINE void GPIO_PinOutToggle (GPIO_Port_TypeDef port, unsigned int pin)
 Toggle a single pin in GPIO port data out register. More...
 
__STATIC_INLINE uint32_t GPIO_PortInGet (GPIO_Port_TypeDef port)
 Read the pad values for GPIO port. More...
 
__STATIC_INLINE void GPIO_PortOutClear (GPIO_Port_TypeDef port, uint32_t pins)
 Set bits in DOUT register for a port to 0. More...
 
__STATIC_INLINE uint32_t GPIO_PortOutGet (GPIO_Port_TypeDef port)
 Get current setting for a GPIO port data out register. More...
 
__STATIC_INLINE void GPIO_PortOutSet (GPIO_Port_TypeDef port, uint32_t pins)
 Set bits GPIO data out register to 1. More...
 
__STATIC_INLINE void GPIO_PortOutSetVal (GPIO_Port_TypeDef port, uint32_t val, uint32_t mask)
 Set GPIO port data out register. More...
 
__STATIC_INLINE void GPIO_PortOutToggle (GPIO_Port_TypeDef port, uint32_t pins)
 Toggle pins in GPIO port data out register. More...
 
__STATIC_INLINE void GPIO_SlewrateSet (GPIO_Port_TypeDef port, uint32_t slewrate, uint32_t slewrateAlt)
 Set slewrate for pins on a GPIO port. More...
 
__STATIC_INLINE void GPIO_Unlock (void)
 Unlocks the GPIO configuration.
 

Enumeration Type Documentation

GPIO drive strength.

Enumerator
gpioDriveStrengthWeakAlternateWeak 

GPIO weak 1mA and alternate function weak 1mA

gpioDriveStrengthWeakAlternateStrong 

GPIO weak 1mA and alternate function strong 10mA

gpioDriveStrengthStrongAlternateWeak 

GPIO strong 10mA and alternate function weak 1mA

gpioDriveStrengthStrongAlternateStrong 

GPIO strong 10mA and alternate function strong 10mA

Definition at line 399 of file em_gpio.h.

Pin mode. For more details on each mode, please refer to the reference manual.

Enumerator
gpioModeDisabled 

Input disabled. Pullup if DOUT is set.

gpioModeInput 

Input enabled. Filter if DOUT is set

gpioModeInputPull 

Input enabled. DOUT determines pull direction

gpioModeInputPullFilter 

Input enabled with filter. DOUT determines pull direction

gpioModePushPull 

Push-pull output

gpioModePushPullAlternate 

Push-pull using alternate control

gpioModeWiredOr 

Wired-or output

gpioModeWiredOrPullDown 

Wired-or output with pull-down

gpioModeWiredAnd 

Open-drain output

gpioModeWiredAndFilter 

Open-drain output with filter

gpioModeWiredAndPullUp 

Open-drain output with pullup

gpioModeWiredAndPullUpFilter 

Open-drain output with filter and pullup

gpioModeWiredAndAlternate 

Open-drain output using alternate control

gpioModeWiredAndAlternateFilter 

Open-drain output using alternate control with filter

gpioModeWiredAndAlternatePullUp 

Open-drain output using alternate control with pullup

gpioModeWiredAndAlternatePullUpFilter 

Open-drain output uisng alternate control with filter and pullup

Definition at line 421 of file em_gpio.h.

GPIO ports ids.

Definition at line 345 of file em_gpio.h.

Function Documentation

void GPIO_DbgLocationSet ( unsigned int  location)

Sets the pin location of the debug pins (Serial Wire interface).

Note
Changing the pins used for debugging uncontrolled, may result in a lockout.
Parameters
[in]locationThe debug pin location to use (0-3).

Definition at line 83 of file em_gpio.c.

References GPIO.

Referenced by DBG_SWOEnable().

__STATIC_INLINE void GPIO_DbgSWDClkEnable ( bool  enable)

Enable/disable serial wire clock pin.

Note
Disabling SWDClk will disable the debug interface, which may result in a lockout if done early in startup (before debugger is able to halt core).
Parameters
[in]enable
  • false - disable serial wire clock.
  • true - enable serial wire clock (default after reset).

Definition at line 493 of file em_gpio.h.

References _GPIO_ROUTEPEN_SWCLKTCKPEN_SHIFT, BUS_RegBitWrite(), and GPIO.

__STATIC_INLINE void GPIO_DbgSWDIOEnable ( bool  enable)

Enable/disable serial wire data I/O pin.

Note
Disabling SWDClk will disable the debug interface, which may result in a lockout if done early in startup (before debugger is able to halt core).
Parameters
[in]enable
  • false - disable serial wire data pin.
  • true - enable serial wire data pin (default after reset).

Definition at line 516 of file em_gpio.h.

References _GPIO_ROUTEPEN_SWDIOTMSPEN_SHIFT, BUS_RegBitWrite(), and GPIO.

__STATIC_INLINE void GPIO_DbgSWOEnable ( bool  enable)

Enable/Disable serial wire output pin.

Note
Enabling this pin is not sufficient to fully enable serial wire output which is also dependent on issues outside the GPIO module. Please refer to DBG_SWOEnable().
Parameters
[in]enable
  • false - disable serial wire viewer pin (default after reset).
  • true - enable serial wire viewer pin.

Definition at line 541 of file em_gpio.h.

References _GPIO_ROUTEPEN_SWVPEN_SHIFT, BUS_RegBitWrite(), and GPIO.

Referenced by DBG_SWOEnable().

void GPIO_DriveStrengthSet ( GPIO_Port_TypeDef  port,
GPIO_DriveStrength_TypeDef  strength 
)

Sets the drive strength for a GPIO port.

Parameters
[in]portThe GPIO port to access.
[in]strengthDrive strength to use for port.

Definition at line 126 of file em_gpio.c.

References _GPIO_P_CTRL_DRIVESTRENGTH_MASK, _GPIO_P_CTRL_DRIVESTRENGTHALT_MASK, BUS_RegMaskedWrite(), and GPIO.

__STATIC_INLINE void GPIO_EM4DisablePinWakeup ( uint32_t  pinmask)

Disable GPIO pin wake-up from EM4.

Parameters
[in]pinmaskBitmask containing the bitwise logic OR of which GPIO pin(s) to disable. Refer to Reference Manuals for pinmask to GPIO port/pin mapping.

Definition at line 570 of file em_gpio.h.

References _GPIO_EM4WUEN_MASK, and GPIO.

void GPIO_EM4EnablePinWakeup ( uint32_t  pinmask,
uint32_t  polaritymask 
)

Enable GPIO pin wake-up from EM4. When the function exits, EM4 mode can be safely entered.

Note
It is assumed that the GPIO pin modes are set correctly. Valid modes are gpioModeInput and gpioModeInputPull.
Parameters
[in]pinmaskBitmask containing the bitwise logic OR of which GPIO pin(s) to enable. Refer to Reference Manuals for pinmask to GPIO port/pin mapping.
[in]polaritymaskBitmask containing the bitwise logic OR of GPIO pin(s) wake-up polarity. Refer to Reference Manuals for pinmask to GPIO port/pin mapping.

Definition at line 361 of file em_gpio.c.

References _GPIO_EM4WUEN_MASK, _GPIO_EXTILEVEL_MASK, GPIO, GPIO_EM4SetPinRetention(), and GPIO_IntClear().

Referenced by UTIL_shutdown().

__STATIC_INLINE uint32_t GPIO_EM4GetPinWakeupCause ( void  )

Check which GPIO pin(s) that caused a wake-up from EM4.

Returns
Bitmask containing the bitwise logic OR of which GPIO pin(s) caused the wake-up. Refer to Reference Manuals for pinmask to GPIO port/pin mapping.

Definition at line 591 of file em_gpio.h.

References _GPIO_IF_EM4WU_MASK, and GPIO.

__STATIC_INLINE void GPIO_EM4SetPinRetention ( bool  enable)

Enable GPIO pin retention of output enable, output value, pull enable and pull direction in EM4.

Note
For platform 2 parts, EMU_EM4Init() and EMU_UnlatchPinRetention() offers more pin retention features. This function implements the EM4EXIT retention mode on platform 2.
Parameters
[in]enable
  • true - enable EM4 pin retention.
  • false - disable EM4 pin retention.

Definition at line 616 of file em_gpio.h.

References _EMU_EM4CTRL_EM4IORETMODE_MASK, EMU, EMU_EM4CTRL_EM4IORETMODE_DISABLE, EMU_EM4CTRL_EM4IORETMODE_EM4EXIT, and GPIO.

Referenced by GPIO_EM4EnablePinWakeup().

void GPIO_ExtIntConfig ( GPIO_Port_TypeDef  port,
unsigned int  pin,
unsigned int  intNo,
bool  risingEdge,
bool  fallingEdge,
bool  enable 
)

Configure GPIO external pin interrupt.

If reconfiguring a GPIO interrupt that is already enabled, it is generally recommended to disable it first, see GPIO_Disable().

The actual GPIO interrupt handler must be in place before enabling the interrupt.

Notice that any pending interrupt for the selected interrupt is cleared by this function.

Note
On series 0 devices the pin number parameter is not used. The pin number used on these devices is hardwired to the interrupt with the same number.
On series 1 devices, pin number can be selected freely within a group. Interrupt numbers are divided into 4 groups (intNo / 4) and valid pin number within the interrupt groups are: 0: pins 0-3 1: pins 4-7 2: pins 8-11 3: pins 12-15
Parameters
[in]portThe port to associate with pin.
[in]pinThe pin number on the port.
[in]intNoThe interrupt number to trigger.
[in]risingEdgeSet to true if interrupts shall be enabled on rising edge, otherwise false.
[in]fallingEdgeSet to true if interrupts shall be enabled on falling edge, otherwise false.
[in]enableSet to true if interrupt shall be enabled after configuration completed, false to leave disabled. See GPIO_IntDisable() and GPIO_IntEnable().

Definition at line 181 of file em_gpio.c.

References _GPIO_EXTIPINSELH_EXTIPINSEL8_MASK, _GPIO_EXTIPINSELH_EXTIPINSEL9_SHIFT, _GPIO_EXTIPINSELL_EXTIPINSEL0_MASK, _GPIO_EXTIPINSELL_EXTIPINSEL1_SHIFT, _GPIO_EXTIPSELH_EXTIPSEL8_MASK, _GPIO_EXTIPSELH_EXTIPSEL9_SHIFT, _GPIO_EXTIPSELL_EXTIPSEL0_MASK, _GPIO_EXTIPSELL_EXTIPSEL1_SHIFT, BUS_RegBitWrite(), BUS_RegMaskedWrite(), and GPIO.

Referenced by GPIO_IntConfig().

__STATIC_INLINE void GPIO_InputSenseSet ( uint32_t  val,
uint32_t  mask 
)

Enable/disable input sensing.

Disabling input sensing if not used, can save some energy consumption.

Parameters
[in]valBitwise logic OR of one or more of:
  • GPIO_INSENSE_INT - interrupt input sensing.
  • GPIO_INSENSE_PRS - peripheral reflex system input sensing.
[in]maskMask containing bitwise logic OR of bits similar as for val used to indicate which input sense options to disable/enable.

Definition at line 662 of file em_gpio.h.

References GPIO.

Referenced by ezradio_hal_GpioInit().

__STATIC_INLINE void GPIO_IntClear ( uint32_t  flags)

Clear one or more pending GPIO interrupts.

Parameters
[in]flagsBitwise logic OR of GPIO interrupt sources to clear.

Definition at line 674 of file em_gpio.h.

References GPIO.

Referenced by BOARD_picGetFwRevision(), GPIO_EM4EnablePinWakeup(), and GPIOINT_CallbackRegister().

__STATIC_INLINE void GPIO_IntConfig ( GPIO_Port_TypeDef  port,
unsigned int  pin,
bool  risingEdge,
bool  fallingEdge,
bool  enable 
)

Configure GPIO interrupt.

If reconfiguring a GPIO interrupt that is already enabled, it is generally recommended to disable it first, see GPIO_Disable().

The actual GPIO interrupt handler must be in place before enabling the interrupt.

Notice that any pending interrupt for the selected pin is cleared by this function.

Deprecated:
Deprecated function. New code should use GPIO_ExtIntConfig().
Note
A certain pin number can only be associated with one port. Ie, if GPIO interrupt 1 is assigned to port A/pin 1, then it is not possible to use pin 1 from any other ports for interrupts. Please refer to the reference manual. On devices which implement GPIO_EXTIPINSEL registers a more flexible approach is possible, refer to GPIO_ExtIntConfig().
Parameters
[in]portThe port to associate with pin.
[in]pinThe pin number on the port ( == GPIO EXTI interrupt number).
[in]risingEdgeSet to true if interrupts shall be enabled on rising edge, otherwise false.
[in]fallingEdgeSet to true if interrupts shall be enabled on falling edge, otherwise false.
[in]enableSet to true if interrupt shall be enabled after configuration completed, false to leave disabled. See GPIO_IntDisable() and GPIO_IntEnable().

Definition at line 1104 of file em_gpio.h.

References GPIO_ExtIntConfig().

Referenced by BOARD_init(), BOARD_pushButtonEnableIRQ(), ezradio_hal_GpioInit(), SI7210_config(), and SI7210_deInit().

__STATIC_INLINE void GPIO_IntDisable ( uint32_t  flags)

Disable one or more GPIO interrupts.

Parameters
[in]flagsGPIO interrupt sources to disable.

Definition at line 686 of file em_gpio.h.

References GPIO.

Referenced by BOARD_picGetFwRevision().

__STATIC_INLINE void GPIO_IntEnable ( uint32_t  flags)

Enable one or more GPIO interrupts.

Note
Depending on the use, a pending interrupt may already be set prior to enabling the interrupt. Consider using GPIO_IntClear() prior to enabling if such a pending interrupt should be ignored.
Parameters
[in]flagsGPIO interrupt sources to enable.

Definition at line 703 of file em_gpio.h.

References GPIO.

Referenced by BOARD_picGetFwRevision().

__STATIC_INLINE uint32_t GPIO_IntGet ( void  )

Get pending GPIO interrupts.

Returns
GPIO interrupt sources pending.

Definition at line 715 of file em_gpio.h.

References GPIO.

__STATIC_INLINE uint32_t GPIO_IntGetEnabled ( void  )

Get enabled and pending GPIO interrupt flags. Useful for handling more interrupt sources in the same interrupt handler.

Note
Interrupt flags are not cleared by the use of this function.
Returns
Pending and enabled GPIO interrupt sources. The return value is the bitwise AND combination of
  • the OR combination of enabled interrupt sources in GPIO_IEN register and
  • the OR combination of valid interrupt flags in GPIO_IF register.

Definition at line 735 of file em_gpio.h.

References GPIO.

Referenced by GPIOINT_CallbackRegister().

__STATIC_INLINE void GPIO_IntSet ( uint32_t  flags)

Set one or more pending GPIO interrupts from SW.

Parameters
[in]flagsGPIO interrupt sources to set to pending.

Definition at line 754 of file em_gpio.h.

References GPIO.

__STATIC_INLINE unsigned int GPIO_PinInGet ( GPIO_Port_TypeDef  port,
unsigned int  pin 
)

Read the pad value for a single pin in a GPIO port.

Parameters
[in]portThe GPIO port to access.
[in]pinThe pin number to read.
Returns
The pin value, 0 or 1.

Definition at line 781 of file em_gpio.h.

References BUS_RegBitRead(), and GPIO.

Referenced by ADC0_IRQHandler(), BSP_McuBoard_UsbVbusOcFlagGet(), ezradio_hal_NirqLevel(), IMU_isDataReadyFlag(), and TOUCH_IsBusy().

GPIO_Mode_TypeDef GPIO_PinModeGet ( GPIO_Port_TypeDef  port,
unsigned int  pin 
)

Get the mode for a GPIO pin.

Parameters
[in]portThe GPIO port to access.
[in]pinThe pin number in the port.
Returns
The pin mode.

Definition at line 329 of file em_gpio.c.

References GPIO.

void GPIO_PinModeSet ( GPIO_Port_TypeDef  port,
unsigned int  pin,
GPIO_Mode_TypeDef  mode,
unsigned int  out 
)

Set the mode for a GPIO pin.

Parameters
[in]portThe GPIO port to access.
[in]pinThe pin number in the port.
[in]modeThe desired pin mode.
[in]outValue to set for pin in DOUT register. The DOUT setting is important for even some input mode configurations, determining pull-up/down direction.

Definition at line 269 of file em_gpio.c.

References GPIO, GPIO_PinOutClear(), GPIO_PinOutSet(), and gpioModeDisabled.

Referenced by ADC0_IRQHandler(), BOARD_flashDeepPowerDown(), BOARD_init(), BSP_BccPinsEnable(), BSP_BusControlModeSet(), BSP_EbiInit(), BSP_McuBoard_DeInit(), BSP_McuBoard_Init(), BSP_McuBoard_UsbVbusPowerEnable(), CAPLESENSE_setupGPIO(), DBG_SWOEnable(), ezradio_hal_GpioInit(), I2CSPM_Init(), ICM20648_spiInit(), KSZ8851SNL_SPI_Init(), MICROSD_Deinit(), MICROSD_Init(), MSDD_Init(), RETARGET_SerialInit(), setupI2C(), SI7210_deInit(), SI7210_init(), SPI_TFT_Init(), TFT_DirectGPIOConfig(), and UTIL_shutdown().

__STATIC_INLINE void GPIO_PinOutClear ( GPIO_Port_TypeDef  port,
unsigned int  pin 
)

Set a single pin in GPIO data out port register to 0.

Note
In order for the setting to take effect on the output pad, the pin must have been configured properly. If not, it will take effect whenever the pin has been properly configured.
Parameters
[in]portThe GPIO port to access.
[in]pinThe pin to set.

Definition at line 811 of file em_gpio.h.

References BUS_RegBitWrite(), and GPIO.

Referenced by BOARD_flashDeepPowerDown(), BOARD_ledSet(), BOARD_picGetFwRevision(), BSP_McuBoard_UsbStatusLedEnable(), ezradio_hal_ClearNsel(), ezradio_hal_DeassertShutdown(), GPIO_PinModeSet(), I2CSPM_Init(), KSZ8851SNL_SPI_SetChipSelect(), and SPI_TFT_WriteRegister().

__STATIC_INLINE unsigned int GPIO_PinOutGet ( GPIO_Port_TypeDef  port,
unsigned int  pin 
)

Get current setting for a pin in a GPIO port data out register.

Parameters
[in]portThe GPIO port to access.
[in]pinThe pin to get setting for.
Returns
The DOUT setting for the requested pin, 0 or 1.

Definition at line 834 of file em_gpio.h.

References BUS_RegBitRead(), and GPIO.

__STATIC_INLINE void GPIO_PinOutSet ( GPIO_Port_TypeDef  port,
unsigned int  pin 
)

Set a single pin in GPIO data out register to 1.

Note
In order for the setting to take effect on the output pad, the pin must have been configured properly. If not, it will take effect whenever the pin has been properly configured.
Parameters
[in]portThe GPIO port to access.
[in]pinThe pin to set.

Definition at line 856 of file em_gpio.h.

References BUS_RegBitWrite(), and GPIO.

Referenced by BOARD_flashDeepPowerDown(), BOARD_ledSet(), BOARD_picGetFwRevision(), BSP_McuBoard_UsbStatusLedEnable(), ezradio_hal_AssertShutdown(), ezradio_hal_SetNsel(), GPIO_PinModeSet(), I2CSPM_Init(), KSZ8851SNL_SPI_SetChipSelect(), and SPI_TFT_WriteRegister().

__STATIC_INLINE void GPIO_PinOutToggle ( GPIO_Port_TypeDef  port,
unsigned int  pin 
)

Toggle a single pin in GPIO port data out register.

Note
In order for the setting to take effect on the output pad, the pin must have been configured properly. If not, it will take effect whenever the pin has been properly configured.
Parameters
[in]portThe GPIO port to access.
[in]pinThe pin to toggle.

Definition at line 881 of file em_gpio.h.

References GPIO.

__STATIC_INLINE uint32_t GPIO_PortInGet ( GPIO_Port_TypeDef  port)

Read the pad values for GPIO port.

Parameters
[in]portThe GPIO port to access.

Definition at line 895 of file em_gpio.h.

References GPIO.

Referenced by BOARD_pushButtonGetState().

__STATIC_INLINE void GPIO_PortOutClear ( GPIO_Port_TypeDef  port,
uint32_t  pins 
)

Set bits in DOUT register for a port to 0.

Note
In order for the setting to take effect on the output pad, the pin must have been configured properly. If not, it will take effect whenever the pin has been properly configured.
Parameters
[in]portThe GPIO port to access.
[in]pinsBit mask for bits to clear in DOUT register.

Definition at line 917 of file em_gpio.h.

References BUS_RegMaskedClear(), and GPIO.

__STATIC_INLINE uint32_t GPIO_PortOutGet ( GPIO_Port_TypeDef  port)

Get current setting for a GPIO port data out register.

Parameters
[in]portThe GPIO port to access.
Returns
The data out setting for the requested port.

Definition at line 937 of file em_gpio.h.

References GPIO.

__STATIC_INLINE void GPIO_PortOutSet ( GPIO_Port_TypeDef  port,
uint32_t  pins 
)

Set bits GPIO data out register to 1.

Note
In order for the setting to take effect on the respective output pads, the pins must have been configured properly. If not, it will take effect whenever the pin has been properly configured.
Parameters
[in]portThe GPIO port to access.
[in]pinsBit mask for bits to set to 1 in DOUT register.

Definition at line 959 of file em_gpio.h.

References BUS_RegMaskedSet(), and GPIO.

__STATIC_INLINE void GPIO_PortOutSetVal ( GPIO_Port_TypeDef  port,
uint32_t  val,
uint32_t  mask 
)

Set GPIO port data out register.

Note
In order for the setting to take effect on the respective output pads, the pins must have been configured properly. If not, it will take effect whenever the pin has been properly configured.
Parameters
[in]portThe GPIO port to access.
[in]valValue to write to port data out register.
[in]maskMask indicating which bits to modify.

Definition at line 987 of file em_gpio.h.

References GPIO.

__STATIC_INLINE void GPIO_PortOutToggle ( GPIO_Port_TypeDef  port,
uint32_t  pins 
)

Toggle pins in GPIO port data out register.

Note
In order for the setting to take effect on the output pad, the pin must have been configured properly. If not, it will take effect whenever the pin has been properly configured.
Parameters
[in]portThe GPIO port to access.
[in]pinsBitmask with pins to toggle.

Definition at line 1011 of file em_gpio.h.

References GPIO.

__STATIC_INLINE void GPIO_SlewrateSet ( GPIO_Port_TypeDef  port,
uint32_t  slewrate,
uint32_t  slewrateAlt 
)

Set slewrate for pins on a GPIO port.

Parameters
[in]portThe GPIO port to configure.
[in]slewrateThe slewrate to configure for pins on this GPIO port.
[in]slewrateAltThe slewrate to configure for pins using alternate modes on this GPIO port.

Definition at line 1032 of file em_gpio.h.

References _GPIO_P_CTRL_SLEWRATE_MASK, _GPIO_P_CTRL_SLEWRATE_SHIFT, _GPIO_P_CTRL_SLEWRATEALT_MASK, _GPIO_P_CTRL_SLEWRATEALT_SHIFT, and GPIO.