F29H85x-SDK  26.00.00
 
GPIO

Introduction

Functions

static bool GPIO_isPinValid (uint32_t pin)
 
static void GPIO_setInterruptType (GPIO_ExternalIntNum extIntNum, GPIO_IntType intType)
 
static GPIO_IntType GPIO_getInterruptType (GPIO_ExternalIntNum extIntNum)
 
static void GPIO_enableInterrupt (GPIO_ExternalIntNum extIntNum)
 
static void GPIO_disableInterrupt (GPIO_ExternalIntNum extIntNum)
 
static uint16_t GPIO_getInterruptCounter (GPIO_ExternalIntNum extIntNum)
 
static uint32_t GPIO_readPin (uint32_t pin)
 
static uint32_t GPIO_readPinDataRegister (uint32_t pin)
 
static void GPIO_writePin (uint32_t pin, uint32_t outVal)
 
static void GPIO_togglePin (uint32_t pin)
 
static uint32_t GPIO_readPortData (GPIO_Port port)
 
static uint32_t GPIO_readPortDataRegister (GPIO_Port port)
 
static void GPIO_writePortData (GPIO_Port port, uint32_t outVal)
 
static void GPIO_setPortPins (GPIO_Port port, uint32_t pinMask)
 
static void GPIO_clearPortPins (GPIO_Port port, uint32_t pinMask)
 
static void GPIO_togglePortPins (GPIO_Port port, uint32_t pinMask)
 
static void GPIO_lockPortConfig (GPIO_Port port, uint32_t pinMask)
 
static void GPIO_unlockPortConfig (GPIO_Port port, uint32_t pinMask)
 
static void GPIO_commitPortConfig (GPIO_Port port, uint32_t pinMask)
 
void GPIO_setDirectionMode (uint32_t pin, GPIO_Direction pinIO)
 
GPIO_Direction GPIO_getDirectionMode (uint32_t pin)
 
void GPIO_setInterruptPin (uint32_t pin, GPIO_ExternalIntNum extIntNum)
 
void GPIO_setPadConfig (uint32_t pin, uint32_t pinType)
 
uint32_t GPIO_getPadConfig (uint32_t pin)
 
void GPIO_setQualificationMode (uint32_t pin, GPIO_QualificationMode qualification)
 
GPIO_QualificationMode GPIO_getQualificationMode (uint32_t pin)
 
void GPIO_setQualificationPeriod (uint32_t pin, uint32_t divider)
 
void GPIO_setControllerCore (uint32_t pin, GPIO_CoreSelect core)
 
void GPIO_setAnalogMode (uint32_t pin, GPIO_AnalogMode mode)
 
void GPIO_setPinConfig (uint32_t pinConfig)
 

Enumerations

enum  GPIO_Direction { GPIO_DIR_MODE_IN , GPIO_DIR_MODE_OUT }
 
enum  GPIO_IntType { GPIO_INT_TYPE_FALLING_EDGE = 0x00 , GPIO_INT_TYPE_RISING_EDGE = 0x04 , GPIO_INT_TYPE_BOTH_EDGES = 0x0C }
 
enum  GPIO_QualificationMode { GPIO_QUAL_SYNC , GPIO_QUAL_3SAMPLE , GPIO_QUAL_6SAMPLE , GPIO_QUAL_ASYNC }
 
enum  GPIO_AnalogMode { GPIO_ANALOG_DISABLED , GPIO_ANALOG_ENABLED }
 Values that can be passed to GPIO_setAnalogMode() as the mode parameter. More...
 
enum  GPIO_CoreSelect { GPIO_CORE_CPU1 , GPIO_CORE_CPU2 , GPIO_CORE_CPU3 }
 
enum  GPIO_Port {
  GPIO_PORT_A = 0 , GPIO_PORT_B = 1 , GPIO_PORT_C = 2 , GPIO_PORT_D = 3 ,
  GPIO_PORT_E = 4 , GPIO_PORT_F = 5 , GPIO_PORT_G = 6 , GPIO_PORT_H = 7
}
 
enum  GPIO_ExternalIntNum {
  GPIO_INT_XINT1 = 0 , GPIO_INT_XINT2 = 2 , GPIO_INT_XINT3 = 4 , GPIO_INT_XINT4 = 6 ,
  GPIO_INT_XINT5 = 8
}
 

Macros

#define GPIO_CTRL_REGS_STEP   ((GPIO_O_GPBCTRL - GPIO_O_GPACTRL) / 4U)
 
#define GPIO_DATA_REGS_STEP   ((GPIO_O_GPBDAT - GPIO_O_GPADAT) / 4U)
 
#define GPIO_DATA_READ_REGS_STEP   ((GPIO_O_GPBDAT_R - GPIO_O_GPADAT_R) / 4U)
 
#define GPIO_GPxCTRL_INDEX   (0U)
 
#define GPIO_GPxQSEL_INDEX   (1U)
 
#define GPIO_GPxMUX_INDEX   (3U)
 
#define GPIO_GPxPUD_INDEX   (6U)
 
#define GPIO_GPxINV_INDEX   (8U)
 
#define GPIO_GPxODR_INDEX   (9U)
 
#define GPIO_GPxAMSEL_INDEX   (10U)
 
#define GPIO_GPxGMUX_INDEX   (16U)
 
#define GPIO_GPxCSEL_INDEX   (20U)
 
#define GPIO_GPxLOCK_INDEX   (30U)
 
#define GPIO_GPxCR_INDEX   (31U)
 
#define GPIO_GPxDAT_INDEX   (0U)
 
#define GPIO_GPxSET_INDEX   (1U)
 
#define GPIO_GPxCLEAR_INDEX   (2U)
 
#define GPIO_GPxTOGGLE_INDEX   (3U)
 
#define GPIO_GPxDIR_INDEX   (4U)
 
#define GPIO_GPxDAT_R_INDEX   (0U)
 
#define GPIO_MUX_TO_GMUX   (GPIO_O_GPAGMUX1 - GPIO_O_GPAMUX1)
 
#define GPIO_PIN_TYPE_STD   0x0000U
 Push-pull output or floating input.
 
#define GPIO_PIN_TYPE_PULLUP   0x0001U
 Pull-up enable for input.
 
#define GPIO_PIN_TYPE_INVERT   0x0002U
 Invert polarity on input.
 
#define GPIO_PIN_TYPE_OD   0x0004U
 Open-drain on output.
 

Macro Definition Documentation

◆ GPIO_CTRL_REGS_STEP

#define GPIO_CTRL_REGS_STEP   ((GPIO_O_GPBCTRL - GPIO_O_GPACTRL) / 4U)

◆ GPIO_DATA_REGS_STEP

#define GPIO_DATA_REGS_STEP   ((GPIO_O_GPBDAT - GPIO_O_GPADAT) / 4U)

◆ GPIO_DATA_READ_REGS_STEP

#define GPIO_DATA_READ_REGS_STEP   ((GPIO_O_GPBDAT_R - GPIO_O_GPADAT_R) / 4U)

◆ GPIO_GPxCTRL_INDEX

#define GPIO_GPxCTRL_INDEX   (0U)

◆ GPIO_GPxQSEL_INDEX

#define GPIO_GPxQSEL_INDEX   (1U)

◆ GPIO_GPxMUX_INDEX

#define GPIO_GPxMUX_INDEX   (3U)

◆ GPIO_GPxPUD_INDEX

#define GPIO_GPxPUD_INDEX   (6U)

◆ GPIO_GPxINV_INDEX

#define GPIO_GPxINV_INDEX   (8U)

◆ GPIO_GPxODR_INDEX

#define GPIO_GPxODR_INDEX   (9U)

◆ GPIO_GPxAMSEL_INDEX

#define GPIO_GPxAMSEL_INDEX   (10U)

◆ GPIO_GPxGMUX_INDEX

#define GPIO_GPxGMUX_INDEX   (16U)

◆ GPIO_GPxCSEL_INDEX

#define GPIO_GPxCSEL_INDEX   (20U)

◆ GPIO_GPxLOCK_INDEX

#define GPIO_GPxLOCK_INDEX   (30U)

◆ GPIO_GPxCR_INDEX

#define GPIO_GPxCR_INDEX   (31U)

◆ GPIO_GPxDAT_INDEX

#define GPIO_GPxDAT_INDEX   (0U)

◆ GPIO_GPxSET_INDEX

#define GPIO_GPxSET_INDEX   (1U)

◆ GPIO_GPxCLEAR_INDEX

#define GPIO_GPxCLEAR_INDEX   (2U)

◆ GPIO_GPxTOGGLE_INDEX

#define GPIO_GPxTOGGLE_INDEX   (3U)

◆ GPIO_GPxDIR_INDEX

#define GPIO_GPxDIR_INDEX   (4U)

◆ GPIO_GPxDAT_R_INDEX

#define GPIO_GPxDAT_R_INDEX   (0U)

◆ GPIO_MUX_TO_GMUX

#define GPIO_MUX_TO_GMUX   (GPIO_O_GPAGMUX1 - GPIO_O_GPAMUX1)

◆ GPIO_PIN_TYPE_STD

#define GPIO_PIN_TYPE_STD   0x0000U

Push-pull output or floating input.

◆ GPIO_PIN_TYPE_PULLUP

#define GPIO_PIN_TYPE_PULLUP   0x0001U

Pull-up enable for input.

◆ GPIO_PIN_TYPE_INVERT

#define GPIO_PIN_TYPE_INVERT   0x0002U

Invert polarity on input.

◆ GPIO_PIN_TYPE_OD

#define GPIO_PIN_TYPE_OD   0x0004U

Open-drain on output.

Enumeration Type Documentation

◆ GPIO_Direction

Values that can be passed to GPIO_setDirectionMode() as the pinIO parameter and returned from GPIO_getDirectionMode().

Enumerator
GPIO_DIR_MODE_IN 

Pin is a GPIO input.

GPIO_DIR_MODE_OUT 

Pin is a GPIO output.

◆ GPIO_IntType

Values that can be passed to GPIO_setInterruptType() as the intType parameter and returned from GPIO_getInterruptType().

Enumerator
GPIO_INT_TYPE_FALLING_EDGE 

Interrupt on falling edge.

GPIO_INT_TYPE_RISING_EDGE 

Interrupt on rising edge.

GPIO_INT_TYPE_BOTH_EDGES 

Interrupt on both edges.

◆ GPIO_QualificationMode

Values that can be passed to GPIO_setQualificationMode() as the qualification parameter and returned by GPIO_getQualificationMode().

Enumerator
GPIO_QUAL_SYNC 

Synchronization to SYSCLK.

GPIO_QUAL_3SAMPLE 

Qualified with 3 samples.

GPIO_QUAL_6SAMPLE 

Qualified with 6 samples.

GPIO_QUAL_ASYNC 

No synchronization.

◆ GPIO_AnalogMode

Values that can be passed to GPIO_setAnalogMode() as the mode parameter.

Enumerator
GPIO_ANALOG_DISABLED 

Pin is in digital mode.

GPIO_ANALOG_ENABLED 

Pin is in analog mode.

◆ GPIO_CoreSelect

Values that can be passed to GPIO_setControllerCore() as the core parameter.

Enumerator
GPIO_CORE_CPU1 

CPU1 selected as controller core.

GPIO_CORE_CPU2 

CPU2 selected as controller core.

GPIO_CORE_CPU3 

CPU3 selected as controller core.

◆ GPIO_Port

enum GPIO_Port

Values that can be passed to GPIO_readPortData(), GPIO_setPortPins(), GPIO_clearPortPins(), and GPIO_togglePortPins() as the port parameter.

Enumerator
GPIO_PORT_A 

GPIO port A.

GPIO_PORT_B 

GPIO port B.

GPIO_PORT_C 

GPIO port C.

GPIO_PORT_D 

GPIO port D.

GPIO_PORT_E 

GPIO port E.

GPIO_PORT_F 

GPIO port F.

GPIO_PORT_G 

GPIO port G.

GPIO_PORT_H 

GPIO port H.

◆ GPIO_ExternalIntNum

Values that can be passed to GPIO_setInterruptPin(), GPIO_setInterruptType(), GPIO_getInterruptType(), GPIO_enableInterrupt(), GPIO_disableInterrupt(), as the extIntNum parameter.

Enumerator
GPIO_INT_XINT1 

External Interrupt 1.

GPIO_INT_XINT2 

External Interrupt 2.

GPIO_INT_XINT3 

External Interrupt 3.

GPIO_INT_XINT4 

External Interrupt 4.

GPIO_INT_XINT5 

External Interrupt 5.

Function Documentation

◆ GPIO_isPinValid()

static bool GPIO_isPinValid ( uint32_t pin)
inlinestatic

◆ GPIO_setInterruptType()

static void GPIO_setInterruptType ( GPIO_ExternalIntNum extIntNum,
GPIO_IntType intType )
inlinestatic

Sets the interrupt type for the specified pin.

Parameters
extIntNumspecifies the external interrupt.
intTypespecifies the type of interrupt trigger mechanism.

This function sets up the various interrupt trigger mechanisms for the specified pin on the selected GPIO port.

The following defines can be used to specify the external interrupt for the extIntNum parameter:

  • GPIO_INT_XINT1
  • GPIO_INT_XINT2
  • GPIO_INT_XINT3
  • GPIO_INT_XINT4
  • GPIO_INT_XINT5

One of the following flags can be used to define the intType parameter:

  • GPIO_INT_TYPE_FALLING_EDGE sets detection to edge and trigger to falling
  • GPIO_INT_TYPE_RISING_EDGE sets detection to edge and trigger to rising
  • GPIO_INT_TYPE_BOTH_EDGES sets detection to both edges
Returns
None.

◆ GPIO_getInterruptType()

static GPIO_IntType GPIO_getInterruptType ( GPIO_ExternalIntNum extIntNum)
inlinestatic

Gets the interrupt type for a pin.

Parameters
extIntNumspecifies the external interrupt.

This function gets the interrupt type for a interrupt. The interrupt can be configured as a falling-edge, rising-edge, or both-edges detected interrupt.

The following defines can be used to specify the external interrupt for the extIntNum parameter:

  • GPIO_INT_XINT1
  • GPIO_INT_XINT2
  • GPIO_INT_XINT3
  • GPIO_INT_XINT4
  • GPIO_INT_XINT5
Returns
Returns one of the flags described for GPIO_setInterruptType().

◆ GPIO_enableInterrupt()

static void GPIO_enableInterrupt ( GPIO_ExternalIntNum extIntNum)
inlinestatic

Enables the specified external interrupt.

Parameters
extIntNumspecifies the external interrupt.

This function enables the indicated external interrupt sources. Only the sources that are enabled can be reflected to the processor interrupt. Disabled sources have no effect on the processor.

The following defines can be used to specify the external interrupt for the extIntNum parameter:

  • GPIO_INT_XINT1
  • GPIO_INT_XINT2
  • GPIO_INT_XINT3
  • GPIO_INT_XINT4
  • GPIO_INT_XINT5
Returns
None.

◆ GPIO_disableInterrupt()

static void GPIO_disableInterrupt ( GPIO_ExternalIntNum extIntNum)
inlinestatic

Disables the specified external interrupt.

Parameters
extIntNumspecifies the external interrupt.

This function disables the indicated external interrupt sources. Only the sources that are enabled can be reflected to the processor interrupt. Disabled sources have no effect on the processor.

The following defines can be used to specify the external interrupt for the extIntNum parameter:

  • GPIO_INT_XINT1
  • GPIO_INT_XINT2
  • GPIO_INT_XINT3
  • GPIO_INT_XINT4
  • GPIO_INT_XINT5
Returns
None.

◆ GPIO_getInterruptCounter()

static uint16_t GPIO_getInterruptCounter ( GPIO_ExternalIntNum extIntNum)
inlinestatic

Gets the value of the external interrupt counter.

Parameters
extIntNumspecifies the external interrupt.

The following defines can be used to specify the external interrupt for the extIntNum parameter:

  • GPIO_INT_XINT1
  • GPIO_INT_XINT2
  • GPIO_INT_XINT3

Note: The counter is clocked at the SYSCLKOUT rate.

Returns
Returns external interrupt counter value.

◆ GPIO_readPin()

static uint32_t GPIO_readPin ( uint32_t pin)
inlinestatic

Reads the value present on the specified pin.

Parameters
pinis the identifying GPIO number of the pin.

The value at the specified pin are read, as specified by pin. The value is returned for both input and output pins.

The pin is specified by its numerical value. For example, GPIO34 is specified by passing 34 as pin.

Returns
Returns the value in the data register for the specified pin.

◆ GPIO_readPinDataRegister()

static uint32_t GPIO_readPinDataRegister ( uint32_t pin)
inlinestatic

Reads the data register value for specified pin.

Parameters
pinis the identifying GPIO number of the pin.

The value available at the data register for the specified pin is read, as specified by pin. The value is returned for both input and output pins.

The pin is specified by its numerical value. For example, GPIO34 is specified by passing 34 as pin.

See also
GPIO_readPin()
Returns
Returns the value in the data register for the specified pin.

◆ GPIO_writePin()

static void GPIO_writePin ( uint32_t pin,
uint32_t outVal )
inlinestatic

Writes a value to the specified pin.

Parameters
pinis the identifying GPIO number of the pin.
outValis the value to write to the pin.

Writes the corresponding bit values to the output pin specified by pin. Writing to a pin configured as an input pin has no effect.

The pin is specified by its numerical value. For example, GPIO34 is specified by passing 34 as pin.

Returns
None.

◆ GPIO_togglePin()

static void GPIO_togglePin ( uint32_t pin)
inlinestatic

Toggles the specified pin.

Parameters
pinis the identifying GPIO number of the pin.

Writes the corresponding bit values to the output pin specified by pin. Writing to a pin configured as an input pin has no effect.

The pin is specified by its numerical value. For example, GPIO34 is specified by passing 34 as pin.

Returns
None.

◆ GPIO_readPortData()

static uint32_t GPIO_readPortData ( GPIO_Port port)
inlinestatic

Reads the data on the specified port.

Parameters
portis the GPIO port being accessed in the form of GPIO_PORT_X where X is the port letter.
Returns
Returns the value available on pin for the specified port. Each bit of the the return value represents a pin on the port, where bit 0 represents GPIO port pin 0, bit 1 represents GPIO port pin 1, and so on.

◆ GPIO_readPortDataRegister()

static uint32_t GPIO_readPortDataRegister ( GPIO_Port port)
inlinestatic

Reads the data written in GPIO Data Register.

Parameters
portis the GPIO port being accessed in the form of GPIO_PORT_X where X is the port letter.

Reads the data written in GPIO Data Register for the specified port. In previous devices, read of GPIO data registers resulted in read of corresponding pins. The function GPIO_readPortData() returns the value on pin.

See also
GPIO_readPortData()
Returns
Returns the value in the data register for the specified port. Each bit of the the return value represents a pin on the port, where bit 0 represents GPIO port pin 0, bit 1 represents GPIO port pin 1, and so on.

◆ GPIO_writePortData()

static void GPIO_writePortData ( GPIO_Port port,
uint32_t outVal )
inlinestatic

Writes a value to the specified port.

Parameters
portis the GPIO port being accessed.
outValis the value to write to the port.

This function writes the value outVal to the port specified by the port parameter which takes a value in the form of GPIO_PORT_X where X is the port letter. For example, use GPIO_PORT_A to affect port A (GPIOs 0-31).

The outVal is a bit-packed value, where each bit represents a bit on a GPIO port. Bit 0 represents GPIO port pin 0, bit 1 represents GPIO port pin 1, and so on.

Returns
None.

◆ GPIO_setPortPins()

static void GPIO_setPortPins ( GPIO_Port port,
uint32_t pinMask )
inlinestatic

Sets all of the specified pins on the specified port.

Parameters
portis the GPIO port being accessed.
pinMaskis a mask of which of the 32 pins on the port are affected.

This function sets all of the pins specified by the pinMask parameter on the port specified by the port parameter which takes a value in the form of GPIO_PORT_X where X is the port letter. For example, use GPIO_PORT_A to affect port A (GPIOs 0-31).

The pinMask is a bit-packed value, where each bit that is set identifies the pin to be set. Bit 0 represents GPIO port pin 0, bit 1 represents GPIO port pin 1, and so on.

Returns
None.

◆ GPIO_clearPortPins()

static void GPIO_clearPortPins ( GPIO_Port port,
uint32_t pinMask )
inlinestatic

Clears all of the specified pins on the specified port.

Parameters
portis the GPIO port being accessed.
pinMaskis a mask of which of the 32 pins on the port are affected.

This function clears all of the pins specified by the pinMask parameter on the port specified by the port parameter which takes a value in the form of GPIO_PORT_X where X is the port letter. For example, use GPIO_PORT_A to affect port A (GPIOs 0-31).

The pinMask is a bit-packed value, where each bit that is set identifies the pin to be cleared. Bit 0 represents GPIO port pin 0, bit 1 represents GPIO port pin 1, and so on.

Returns
None.

◆ GPIO_togglePortPins()

static void GPIO_togglePortPins ( GPIO_Port port,
uint32_t pinMask )
inlinestatic

Toggles all of the specified pins on the specified port.

Parameters
portis the GPIO port being accessed.
pinMaskis a mask of which of the 32 pins on the port are affected.

This function toggles all of the pins specified by the pinMask parameter on the port specified by the port parameter which takes a value in the form of GPIO_PORT_X where X is the port letter. For example, use GPIO_PORT_A to affect port A (GPIOs 0-31).

The pinMask is a bit-packed value, where each bit that is set identifies the pin to be toggled. Bit 0 represents GPIO port pin 0, bit 1 represents GPIO port pin 1, and so on.

Returns
None.

◆ GPIO_lockPortConfig()

static void GPIO_lockPortConfig ( GPIO_Port port,
uint32_t pinMask )
inlinestatic

Locks the configuration of the specified pins on the specified port.

Parameters
portis the GPIO port being accessed.
pinMaskis a mask of which of the 32 pins on the port are affected.

This function locks the configuration registers of the pins specified by the pinMask parameter on the port specified by the port parameter which takes a value in the form of GPIO_PORT_X where X is the port letter. For example, use GPIO_PORT_A to affect port A (GPIOs 0-31).

The pinMask is a bit-packed value, where each bit that is set identifies the pin to be locked. Bit 0 represents GPIO port pin 0, bit 1 represents GPIO port pin 1, 0xFFFFFFFF represents all pins on that port, and so on.

Note that this function is for locking the configuration of a pin such as the pin muxing, direction, open drain mode, and other settings. It does not affect the ability to change the value of the pin.

Returns
None.

◆ GPIO_unlockPortConfig()

static void GPIO_unlockPortConfig ( GPIO_Port port,
uint32_t pinMask )
inlinestatic

Unlocks the configuration of the specified pins on the specified port.

Parameters
portis the GPIO port being accessed.
pinMaskis a mask of which of the 32 pins on the port are affected.

This function unlocks the configuration registers of the pins specified by the pinMask parameter on the port specified by the port parameter which takes a value in the form of GPIO_PORT_X where X is the port letter. For example, use GPIO_PORT_A to affect port A (GPIOs 0-31).

The pinMask is a bit-packed value, where each bit that is set identifies the pin to be unlocked. Bit 0 represents GPIO port pin 0, bit 1 represents GPIO port pin 1, 0xFFFFFFFF represents all pins on that port, and so on.

Returns
None.

◆ GPIO_commitPortConfig()

static void GPIO_commitPortConfig ( GPIO_Port port,
uint32_t pinMask )
inlinestatic

Commits the lock configuration of the specified pins on the specified port.

Parameters
portis the GPIO port being accessed.
pinMaskis a mask of which of the 32 pins on the port are affected.

This function commits the lock configuration registers of the pins specified by the pinMask parameter on the port specified by the port parameter which takes a value in the form of GPIO_PORT_X where X is the port letter. For example, use GPIO_PORT_A to affect port A (GPIOs 0-31).

The pinMask is a bit-packed value, where each bit that is set identifies the pin to be locked. Bit 0 represents GPIO port pin 0, bit 1 represents GPIO port pin 1, 0xFFFFFFFF represents all pins on that port, and so on.

Note that once this function is called, GPIO_lockPortConfig() and GPIO_unlockPortConfig() will no longer have any effect on the specified pins.

Returns
None.

◆ GPIO_setDirectionMode()

void GPIO_setDirectionMode ( uint32_t pin,
GPIO_Direction pinIO )
extern

Sets the direction and mode of the specified pin.

Parameters
pinis the identifying GPIO number of the pin.
pinIOis the pin direction mode.

This function configures the specified pin on the selected GPIO port as either input or output.

The parameter pinIO is an enumerated data type that can be one of the following values:

  • GPIO_DIR_MODE_IN
  • GPIO_DIR_MODE_OUT

where GPIO_DIR_MODE_IN specifies that the pin is programmed as an input and GPIO_DIR_MODE_OUT specifies that the pin is programmed as an output.

The pin is specified by its numerical value. For example, GPIO34 is specified by passing 34 as pin.

Returns
None.

◆ GPIO_getDirectionMode()

GPIO_Direction GPIO_getDirectionMode ( uint32_t pin)
extern

Gets the direction mode of a pin.

Parameters
pinis the identifying GPIO number of the pin.

This function gets the direction mode for a specified pin. The pin can be configured as either an input or output The type of direction is returned as an enumerated data type.

Returns
Returns one of the enumerated data types described for GPIO_setDirectionMode().

◆ GPIO_setInterruptPin()

void GPIO_setInterruptPin ( uint32_t pin,
GPIO_ExternalIntNum extIntNum )
extern

Sets the pin for the specified external interrupt.

Parameters
pinis the identifying GPIO number of the pin.
extIntNumspecifies the external interrupt.

This function sets which pin triggers the selected external interrupt.

The following defines can be used to specify the external interrupt for the extIntNum parameter:

  • GPIO_INT_XINT1
  • GPIO_INT_XINT2
  • GPIO_INT_XINT3
  • GPIO_INT_XINT4
  • GPIO_INT_XINT5

The pin is specified by its numerical value. For example, GPIO34 is specified by passing 34 as pin.

See also
XBAR_setInputPin()
Returns
None.

◆ GPIO_setPadConfig()

void GPIO_setPadConfig ( uint32_t pin,
uint32_t pinType )
extern

Sets the pad configuration for the specified pin.

Parameters
pinis the identifying GPIO number of the pin.
pinTypespecifies the pin type.

This function sets the pin type for the specified pin. The parameter pinType can be the following values:

  • GPIO_PIN_TYPE_STD specifies a push-pull output or a floating input
  • GPIO_PIN_TYPE_PULLUP specifies the pull-up is enabled for an input
  • GPIO_PIN_TYPE_OD specifies an open-drain output pin
  • GPIO_PIN_TYPE_INVERT specifies inverted polarity on an input

GPIO_PIN_TYPE_INVERT may be OR-ed with GPIO_PIN_TYPE_STD or GPIO_PIN_TYPE_PULLUP.

The pin is specified by its numerical value. For example, GPIO34 is specified by passing 34 as pin.

Returns
None.

◆ GPIO_getPadConfig()

uint32_t GPIO_getPadConfig ( uint32_t pin)
extern

Gets the pad configuration for a pin.

Parameters
pinis the identifying GPIO number of the pin.

This function returns the pin type for the specified pin. The value returned corresponds to the values used in GPIO_setPadConfig().

Returns
Returns a bit field of the values GPIO_PIN_TYPE_STD, GPIO_PIN_TYPE_PULLUP, GPIO_PIN_TYPE_OD, and GPIO_PIN_TYPE_INVERT.

◆ GPIO_setQualificationMode()

void GPIO_setQualificationMode ( uint32_t pin,
GPIO_QualificationMode qualification )
extern

Sets the qualification mode for the specified pin.

Parameters
pinis the identifying GPIO number of the pin.
qualificationspecifies the qualification mode of the pin.

This function sets the qualification mode for the specified pin. The parameter qualification can be one of the following values:

  • GPIO_QUAL_SYNC
  • GPIO_QUAL_3SAMPLE
  • GPIO_QUAL_6SAMPLE
  • GPIO_QUAL_ASYNC

To set the qualification sampling period, use GPIO_setQualificationPeriod().

Returns
None.

◆ GPIO_getQualificationMode()

GPIO_QualificationMode GPIO_getQualificationMode ( uint32_t pin)
extern

Gets the qualification type for the specified pin.

Parameters
pinis the identifying GPIO number of the pin.
Returns
Returns the qualification mode in the form of one of the values GPIO_QUAL_SYNC, GPIO_QUAL_3SAMPLE, GPIO_QUAL_6SAMPLE, or GPIO_QUAL_ASYNC.

◆ GPIO_setQualificationPeriod()

void GPIO_setQualificationPeriod ( uint32_t pin,
uint32_t divider )
extern

Sets the qualification period for a set of pins

Parameters
pinis the identifying GPIO number of the pin.
dividerspecifies the output drive strength.

This function sets the qualification period for a set of 8 pins, specified by the pin parameter. For instance, passing in 3 as the value of pin will set the qualification period for GPIO0 through GPIO7, and a value of 98 will set the qualification period for GPIO96 through GPIO103. This is because the register field that configures the divider is shared.

To think of this in terms of an equation, configuring pin as n will configure GPIO (n & ~(7)) through GPIO ((n & ~(7)) + 7).

divider is the value by which the frequency of SYSCLKOUT is divided. It can be 1 or an even value between 2 and 510 inclusive.

Returns
None.

◆ GPIO_setControllerCore()

void GPIO_setControllerCore ( uint32_t pin,
GPIO_CoreSelect core )
extern

Selects the controller core of a specified pin.

Parameters
pinis the identifying GPIO number of the pin.
coreis the core that is controller of the specified pin.

This function configures which core owns the specified pin's data registers (DATA, SET, CLEAR, and TOGGLE). The core parameter is an enumerated data type that specifies the core, such as GPIO_CORE_CPU1_CLA1 to make CPU1's CLA1 controller of the pin.

The pin is specified by its numerical value. For example, GPIO34 is specified by passing 34 as pin.

Returns
None.

◆ GPIO_setAnalogMode()

void GPIO_setAnalogMode ( uint32_t pin,
GPIO_AnalogMode mode )
extern

Sets the analog mode of the specified pin.

Parameters
pinis the identifying GPIO number of the pin.
modeis the selected analog mode.

This function configures the specified pin for either analog or digital mode. Not all GPIO pins have the ability to be switched to analog mode, so refer to the technical reference manual for details. This setting should be thought of as another level of muxing.

The parameter mode is an enumerated data type that can be one of the following values:

  • GPIO_ANALOG_DISABLED - Pin is in digital mode
  • GPIO_ANALOG_ENABLED - Pin is in analog mode

The pin is specified by its numerical value. For example, GPIO34 is specified by passing 34 as pin.

Returns
None.

◆ GPIO_setPinConfig()

void GPIO_setPinConfig ( uint32_t pinConfig)
extern

Configures the alternate function of a GPIO pin.

Parameters
pinConfigis the pin configuration value, specified as only one of the GPIO_::_???? values.

This function configures the pin mux that selects the peripheral function associated with a particular GPIO pin. Only one peripheral function at a time can be associated with a GPIO pin, and each peripheral function should only be associated with a single GPIO pin at a time (despite the fact that many of them can be associated with more than one GPIO pin).

The available mappings are supplied in pin_map.h.

Returns
None.