EE445M RTOS
Taken at the University of Texas Spring 2015
Gpio_api

Functions

static uint32_t _GPIOIntNumberGet (uint32_t ui32Port)
 
void GPIODirModeSet (uint32_t ui32Port, uint8_t ui8Pins, uint32_t ui32PinIO)
 
uint32_t GPIODirModeGet (uint32_t ui32Port, uint8_t ui8Pin)
 
void GPIOIntTypeSet (uint32_t ui32Port, uint8_t ui8Pins, uint32_t ui32IntType)
 
uint32_t GPIOIntTypeGet (uint32_t ui32Port, uint8_t ui8Pin)
 
void GPIOPadConfigSet (uint32_t ui32Port, uint8_t ui8Pins, uint32_t ui32Strength, uint32_t ui32PinType)
 
void GPIOPadConfigGet (uint32_t ui32Port, uint8_t ui8Pin, uint32_t *pui32Strength, uint32_t *pui32PinType)
 
void GPIOIntEnable (uint32_t ui32Port, uint32_t ui32IntFlags)
 
void GPIOIntDisable (uint32_t ui32Port, uint32_t ui32IntFlags)
 
uint32_t GPIOIntStatus (uint32_t ui32Port, bool bMasked)
 
void GPIOIntClear (uint32_t ui32Port, uint32_t ui32IntFlags)
 
void GPIOIntRegister (uint32_t ui32Port, void(*pfnIntHandler)(void))
 
void GPIOIntUnregister (uint32_t ui32Port)
 
int32_t GPIOPinRead (uint32_t ui32Port, uint8_t ui8Pins)
 
void GPIOPinWrite (uint32_t ui32Port, uint8_t ui8Pins, uint8_t ui8Val)
 
void GPIOPinTypeADC (uint32_t ui32Port, uint8_t ui8Pins)
 
void GPIOPinTypeCAN (uint32_t ui32Port, uint8_t ui8Pins)
 
void GPIOPinTypeComparator (uint32_t ui32Port, uint8_t ui8Pins)
 
void GPIOPinTypeEPI (uint32_t ui32Port, uint8_t ui8Pins)
 
void GPIOPinTypeEthernetLED (uint32_t ui32Port, uint8_t ui8Pins)
 
void GPIOPinTypeEthernetMII (uint32_t ui32Port, uint8_t ui8Pins)
 
void GPIOPinTypeGPIOInput (uint32_t ui32Port, uint8_t ui8Pins)
 
void GPIOPinTypeGPIOOutput (uint32_t ui32Port, uint8_t ui8Pins)
 
void GPIOPinTypeGPIOOutputOD (uint32_t ui32Port, uint8_t ui8Pins)
 
void GPIOPinTypeI2C (uint32_t ui32Port, uint8_t ui8Pins)
 
void GPIOPinTypeI2CSCL (uint32_t ui32Port, uint8_t ui8Pins)
 
void GPIOPinTypeLCD (uint32_t ui32Port, uint8_t ui8Pins)
 
void GPIOPinTypeLPC (uint32_t ui32Port, uint8_t ui8Pins)
 
void GPIOPinTypePECIRx (uint32_t ui32Port, uint8_t ui8Pins)
 
void GPIOPinTypePECITx (uint32_t ui32Port, uint8_t ui8Pins)
 
void GPIOPinTypePWM (uint32_t ui32Port, uint8_t ui8Pins)
 
void GPIOPinTypeQEI (uint32_t ui32Port, uint8_t ui8Pins)
 
void GPIOPinTypeSSI (uint32_t ui32Port, uint8_t ui8Pins)
 
void GPIOPinTypeTimer (uint32_t ui32Port, uint8_t ui8Pins)
 
void GPIOPinTypeUART (uint32_t ui32Port, uint8_t ui8Pins)
 
void GPIOPinTypeUSBAnalog (uint32_t ui32Port, uint8_t ui8Pins)
 
void GPIOPinTypeUSBDigital (uint32_t ui32Port, uint8_t ui8Pins)
 
void GPIOPinTypeWakeHigh (uint32_t ui32Port, uint8_t ui8Pins)
 
void GPIOPinTypeWakeLow (uint32_t ui32Port, uint8_t ui8Pins)
 
void GPIOPinTypeKBRow (uint32_t ui32Port, uint8_t ui8Pins)
 
void GPIOPinTypeKBColumn (uint32_t ui32Port, uint8_t ui8Pins)
 
void GPIOPinTypeLEDSeq (uint32_t ui32Port, uint8_t ui8Pins)
 
void GPIOPinTypeCIR (uint32_t ui32Port, uint8_t ui8Pins)
 
uint32_t GPIOPinWakeStatus (uint32_t ui32Port)
 
void GPIOPinConfigure (uint32_t ui32PinConfig)
 
void GPIODMATriggerEnable (uint32_t ui32Port, uint8_t ui8Pins)
 
void GPIODMATriggerDisable (uint32_t ui32Port, uint8_t ui8Pins)
 
void GPIOADCTriggerEnable (uint32_t ui32Port, uint8_t ui8Pins)
 
void GPIOADCTriggerDisable (uint32_t ui32Port, uint8_t ui8Pins)
 

Variables

static const uint32_t g_ppui32GPIOIntMapBlizzard [][2]
 
static const uint_fast32_t g_ui32GPIOIntMapBlizzardRows
 
static const uint32_t g_ppui32GPIOIntMapSnowflake [][2]
 
static const uint_fast32_t g_ui32GPIOIntMapSnowflakeRows
 
static const uint32_t g_pui32GPIOBaseAddrs []
 

Detailed Description

Function Documentation

static uint32_t _GPIOIntNumberGet ( uint32_t  ui32Port)
static

Gets the GPIO interrupt number.

Parameters
ui32Portis the base address of the GPIO port.

Given a GPIO base address, this function returns the corresponding interrupt number.

Returns
Returns a GPIO interrupt number, or 0 if ui32Port is invalid.

Definition at line 212 of file gpio.c.

References ASSERT, CLASS_IS_TM4C129, g_ppui32GPIOIntMapBlizzard, g_ppui32GPIOIntMapSnowflake, g_ui32GPIOIntMapBlizzardRows, and g_ui32GPIOIntMapSnowflakeRows.

Referenced by GPIOIntRegister(), and GPIOIntUnregister().

213 {
214  uint_fast32_t ui32Idx, ui32Rows;
215  const uint32_t (*ppui32GPIOIntMap)[2];
216 
217  //
218  // Check the arguments.
219  //
220  ASSERT(_GPIOBaseValid(ui32Port));
221 
222  ppui32GPIOIntMap = g_ppui32GPIOIntMapBlizzard;
223  ui32Rows = g_ui32GPIOIntMapBlizzardRows;
224 
225  if(CLASS_IS_TM4C129)
226  {
227  ppui32GPIOIntMap = g_ppui32GPIOIntMapSnowflake;
229  }
230 
231  //
232  // Loop through the table that maps I2C base addresses to interrupt
233  // numbers.
234  //
235  for(ui32Idx = 0; ui32Idx < ui32Rows; ui32Idx++)
236  {
237  //
238  // See if this base address matches.
239  //
240  if(ppui32GPIOIntMap[ui32Idx][0] == ui32Port)
241  {
242  //
243  // Return the corresponding interrupt number.
244  //
245  return(ppui32GPIOIntMap[ui32Idx][1]);
246  }
247  }
248 
249  //
250  // The base address could not be found, so return an error.
251  //
252  return(0);
253 }
static const uint_fast32_t g_ui32GPIOIntMapSnowflakeRows
Definition: gpio.c:120
#define ASSERT(expr)
Definition: debug.h:67
static const uint32_t g_ppui32GPIOIntMapBlizzard[][2]
Definition: gpio.c:63
static const uint_fast32_t g_ui32GPIOIntMapBlizzardRows
Definition: gpio.c:90
#define CLASS_IS_TM4C129
Definition: hw_types.h:99
static const uint32_t g_ppui32GPIOIntMapSnowflake[][2]
Definition: gpio.c:93

Here is the caller graph for this function:

void GPIOADCTriggerDisable ( uint32_t  ui32Port,
uint8_t  ui8Pins 
)

Disable a GPIO pin as a trigger to start an ADC capture.

Parameters
ui32Portis the base address of the GPIO port.
ui8Pinsis the bit-packed representation of the pin(s).

This function disables a GPIO pin to be used as a trigger to start an ADC sequence. This function can be used to disable this feature if it was enabled via a call to GPIOADCTriggerEnable().

Returns
None.

Definition at line 2653 of file gpio.c.

References ASSERT, GPIO_O_ADCCTL, and HWREG.

2654 {
2655  //
2656  // Check the arguments.
2657  //
2658  ASSERT(_GPIOBaseValid(ui32Port));
2659 
2660  //
2661  // Set the pin as a DMA trigger.
2662  //
2663  HWREG(ui32Port + GPIO_O_ADCCTL) &= (~ui8Pins);
2664 }
#define HWREG(x)
Definition: hw_types.h:48
#define ASSERT(expr)
Definition: debug.h:67
#define GPIO_O_ADCCTL
Definition: hw_gpio.h:70
void GPIOADCTriggerEnable ( uint32_t  ui32Port,
uint8_t  ui8Pins 
)

Enables a GPIO pin as a trigger to start an ADC capture.

Parameters
ui32Portis the base address of the GPIO port.
ui8Pinsis the bit-packed representation of the pin(s).

This function enables a GPIO pin to be used as a trigger to start an ADC sequence. Any GPIO pin can be configured to be an external trigger for an ADC sequence. The GPIO pin still generates interrupts if the interrupt is enabled for the selected pin. To enable the use of a GPIO pin to trigger the ADC module, the ADCSequenceConfigure() function must be called with the ADC_TRIGGER_EXTERNAL parameter.

Returns
None.

Definition at line 2625 of file gpio.c.

References ASSERT, GPIO_O_ADCCTL, and HWREG.

2626 {
2627  //
2628  // Check the arguments.
2629  //
2630  ASSERT(_GPIOBaseValid(ui32Port));
2631 
2632  //
2633  // Set the pin as a DMA trigger.
2634  //
2635  HWREG(ui32Port + GPIO_O_ADCCTL) |= ui8Pins;
2636 }
#define HWREG(x)
Definition: hw_types.h:48
#define ASSERT(expr)
Definition: debug.h:67
#define GPIO_O_ADCCTL
Definition: hw_gpio.h:70
uint32_t GPIODirModeGet ( uint32_t  ui32Port,
uint8_t  ui8Pin 
)

Gets the direction and mode of a pin.

Parameters
ui32Portis the base address of the GPIO port.
ui8Pinis the pin number.

This function gets the direction and control mode for a specified pin on the selected GPIO port. The pin can be configured as either an input or output under software control, or it can be under hardware control. The type of control and direction are returned as an enumerated data type.

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

Definition at line 338 of file gpio.c.

References ASSERT, GPIO_O_AFSEL, GPIO_O_DIR, and HWREG.

339 {
340  uint32_t ui32Dir, ui32AFSEL;
341 
342  //
343  // Check the arguments.
344  //
345  ASSERT(_GPIOBaseValid(ui32Port));
346  ASSERT(ui8Pin < 8);
347 
348  //
349  // Convert from a pin number to a bit position.
350  //
351  ui8Pin = 1 << ui8Pin;
352 
353  //
354  // Return the pin direction and mode.
355  //
356  ui32Dir = HWREG(ui32Port + GPIO_O_DIR);
357  ui32AFSEL = HWREG(ui32Port + GPIO_O_AFSEL);
358  return(((ui32Dir & ui8Pin) ? 1 : 0) | ((ui32AFSEL & ui8Pin) ? 2 : 0));
359 }
#define GPIO_O_DIR
Definition: hw_gpio.h:49
#define HWREG(x)
Definition: hw_types.h:48
#define ASSERT(expr)
Definition: debug.h:67
#define GPIO_O_AFSEL
Definition: hw_gpio.h:57
void GPIODirModeSet ( uint32_t  ui32Port,
uint8_t  ui8Pins,
uint32_t  ui32PinIO 
)

Sets the direction and mode of the specified pin(s).

Parameters
ui32Portis the base address of the GPIO port
ui8Pinsis the bit-packed representation of the pin(s).
ui32PinIOis the pin direction and/or mode.

This function configures the specified pin(s) on the selected GPIO port as either input or output under software control, or it configures the pin to be under hardware control.

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

  • GPIO_DIR_MODE_IN
  • GPIO_DIR_MODE_OUT
  • GPIO_DIR_MODE_HW

where GPIO_DIR_MODE_IN specifies that the pin is programmed as a software controlled input, GPIO_DIR_MODE_OUT specifies that the pin is programmed as a software controlled output, and GPIO_DIR_MODE_HW specifies that the pin is placed under hardware control.

The pin(s) are specified using a bit-packed byte, where each bit that is set identifies the pin to be accessed, and where bit 0 of the byte represents GPIO port pin 0, bit 1 represents GPIO port pin 1, and so on.

Note
GPIOPadConfigSet() must also be used to configure the corresponding pad(s) in order for them to propagate the signal to/from the GPIO.
A subset of GPIO pins on Tiva devices, notably those used by the JTAG/SWD interface and any pin capable of acting as an NMI input, are locked against inadvertent reconfiguration. These pins must be unlocked using direct register writes to the relevant GPIO_O_LOCK and GPIO_O_CR registers before this function can be called. Please see the ``gpio_jtag'' example application for the mechanism required and consult your part datasheet for information on affected pins.
Returns
None.

Definition at line 298 of file gpio.c.

References ASSERT, GPIO_DIR_MODE_HW, GPIO_DIR_MODE_IN, GPIO_DIR_MODE_OUT, GPIO_O_AFSEL, GPIO_O_DIR, and HWREG.

Referenced by button_init(), GPIOPinTypeADC(), GPIOPinTypeCAN(), GPIOPinTypeCIR(), GPIOPinTypeComparator(), GPIOPinTypeEPI(), GPIOPinTypeEthernetLED(), GPIOPinTypeEthernetMII(), GPIOPinTypeGPIOInput(), GPIOPinTypeGPIOOutput(), GPIOPinTypeGPIOOutputOD(), GPIOPinTypeI2C(), GPIOPinTypeI2CSCL(), GPIOPinTypeKBColumn(), GPIOPinTypeKBRow(), GPIOPinTypeLCD(), GPIOPinTypeLEDSeq(), GPIOPinTypeLPC(), GPIOPinTypePECIRx(), GPIOPinTypePECITx(), GPIOPinTypePWM(), GPIOPinTypeQEI(), GPIOPinTypeSSI(), GPIOPinTypeTimer(), GPIOPinTypeUART(), GPIOPinTypeUSBAnalog(), GPIOPinTypeUSBDigital(), GPIOPinTypeWakeHigh(), and GPIOPinTypeWakeLow().

299 {
300  //
301  // Check the arguments.
302  //
303  ASSERT(_GPIOBaseValid(ui32Port));
304  ASSERT((ui32PinIO == GPIO_DIR_MODE_IN) ||
305  (ui32PinIO == GPIO_DIR_MODE_OUT) ||
306  (ui32PinIO == GPIO_DIR_MODE_HW));
307 
308  //
309  // Set the pin direction and mode.
310  //
311  HWREG(ui32Port + GPIO_O_DIR) = ((ui32PinIO & 1) ?
312  (HWREG(ui32Port + GPIO_O_DIR) | ui8Pins) :
313  (HWREG(ui32Port + GPIO_O_DIR) & ~(ui8Pins)));
314  HWREG(ui32Port + GPIO_O_AFSEL) = ((ui32PinIO & 2) ?
315  (HWREG(ui32Port + GPIO_O_AFSEL) |
316  ui8Pins) :
317  (HWREG(ui32Port + GPIO_O_AFSEL) &
318  ~(ui8Pins)));
319 }
#define GPIO_O_DIR
Definition: hw_gpio.h:49
#define GPIO_DIR_MODE_HW
Definition: gpio.h:77
#define HWREG(x)
Definition: hw_types.h:48
#define ASSERT(expr)
Definition: debug.h:67
#define GPIO_DIR_MODE_OUT
Definition: gpio.h:76
#define GPIO_O_AFSEL
Definition: hw_gpio.h:57
#define GPIO_DIR_MODE_IN
Definition: gpio.h:75

Here is the caller graph for this function:

void GPIODMATriggerDisable ( uint32_t  ui32Port,
uint8_t  ui8Pins 
)

Disables a GPIO pin as a trigger to start a DMA transaction.

Parameters
ui32Portis the base address of the GPIO port.
ui8Pinsis the bit-packed representation of the pin(s).

This function disables a GPIO pin from being used as a trigger to start a uDMA transaction. This function can be used to disable this feature if it was enabled via a call to GPIODMATriggerEnable().

Returns
None.

Definition at line 2594 of file gpio.c.

References ASSERT, GPIO_O_DMACTL, and HWREG.

2595 {
2596  //
2597  // Check the arguments.
2598  //
2599  ASSERT(_GPIOBaseValid(ui32Port));
2600 
2601  //
2602  // Set the pin as a DMA trigger.
2603  //
2604  HWREG(ui32Port + GPIO_O_DMACTL) &= (~ui8Pins);
2605 }
#define GPIO_O_DMACTL
Definition: hw_gpio.h:71
#define HWREG(x)
Definition: hw_types.h:48
#define ASSERT(expr)
Definition: debug.h:67
void GPIODMATriggerEnable ( uint32_t  ui32Port,
uint8_t  ui8Pins 
)

Enables a GPIO pin as a trigger to start a DMA transaction.

Parameters
ui32Portis the base address of the GPIO port.
ui8Pinsis the bit-packed representation of the pin(s).

This function enables a GPIO pin to be used as a trigger to start a uDMA transaction. Any GPIO pin can be configured to be an external trigger for the uDMA. The GPIO pin still generates interrupts if the interrupt is enabled for the selected pin.

Returns
None.

Definition at line 2566 of file gpio.c.

References ASSERT, GPIO_O_DMACTL, and HWREG.

2567 {
2568  //
2569  // Check the arguments.
2570  //
2571  ASSERT(_GPIOBaseValid(ui32Port));
2572 
2573  //
2574  // Set the pin as a DMA trigger.
2575  //
2576  HWREG(ui32Port + GPIO_O_DMACTL) |= ui8Pins;
2577 }
#define GPIO_O_DMACTL
Definition: hw_gpio.h:71
#define HWREG(x)
Definition: hw_types.h:48
#define ASSERT(expr)
Definition: debug.h:67
void GPIOIntClear ( uint32_t  ui32Port,
uint32_t  ui32IntFlags 
)

Clears the specified interrupt sources.

Parameters
ui32Portis the base address of the GPIO port.
ui32IntFlagsis the bit mask of the interrupt sources to disable.

Clears the interrupt for the specified interrupt source(s).

The ui32IntFlags parameter is the logical OR of the GPIO_INT_* values.

Note
Because there is a write buffer in the Cortex-M processor, it may take several clock cycles before the interrupt source is actually cleared. Therefore, it is recommended that the interrupt source be cleared early in the interrupt handler (as opposed to the very last action) to avoid returning from the interrupt handler before the interrupt source is actually cleared. Failure to do so may result in the interrupt handler being immediately reentered (because the interrupt controller still sees the interrupt source asserted).
Returns
None.

Definition at line 878 of file gpio.c.

References ASSERT, GPIO_O_ICR, and HWREG.

Referenced by GPIOPortF_Handler().

879 {
880  //
881  // Check the arguments.
882  //
883  ASSERT(_GPIOBaseValid(ui32Port));
884 
885  //
886  // Clear the interrupts.
887  //
888  HWREG(ui32Port + GPIO_O_ICR) = ui32IntFlags;
889 }
#define HWREG(x)
Definition: hw_types.h:48
#define ASSERT(expr)
Definition: debug.h:67
#define GPIO_O_ICR
Definition: hw_gpio.h:56

Here is the caller graph for this function:

void GPIOIntDisable ( uint32_t  ui32Port,
uint32_t  ui32IntFlags 
)

Disables the specified GPIO interrupts.

Parameters
ui32Portis the base address of the GPIO port.
ui32IntFlagsis the bit mask of the interrupt sources to disable.

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

The ui32IntFlags parameter is the logical OR of any of the following:

  • GPIO_INT_PIN_0 - interrupt due to activity on Pin 0.
  • GPIO_INT_PIN_1 - interrupt due to activity on Pin 1.
  • GPIO_INT_PIN_2 - interrupt due to activity on Pin 2.
  • GPIO_INT_PIN_3 - interrupt due to activity on Pin 3.
  • GPIO_INT_PIN_4 - interrupt due to activity on Pin 4.
  • GPIO_INT_PIN_5 - interrupt due to activity on Pin 5.
  • GPIO_INT_PIN_6 - interrupt due to activity on Pin 6.
  • GPIO_INT_PIN_7 - interrupt due to activity on Pin 7.
  • GPIO_INT_DMA - interrupt due to DMA activity on this GPIO module.
Returns
None.

Definition at line 803 of file gpio.c.

References ASSERT, GPIO_O_IM, and HWREG.

804 {
805  //
806  // Check the arguments.
807  //
808  ASSERT(_GPIOBaseValid(ui32Port));
809 
810  //
811  // Disable the interrupts.
812  //
813  HWREG(ui32Port + GPIO_O_IM) &= ~(ui32IntFlags);
814 }
#define HWREG(x)
Definition: hw_types.h:48
#define ASSERT(expr)
Definition: debug.h:67
#define GPIO_O_IM
Definition: hw_gpio.h:53
void GPIOIntEnable ( uint32_t  ui32Port,
uint32_t  ui32IntFlags 
)

Enables the specified GPIO interrupts.

Parameters
ui32Portis the base address of the GPIO port.
ui32IntFlagsis the bit mask of the interrupt sources to enable.

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

The ui32IntFlags parameter is the logical OR of any of the following:

  • GPIO_INT_PIN_0 - interrupt due to activity on Pin 0.
  • GPIO_INT_PIN_1 - interrupt due to activity on Pin 1.
  • GPIO_INT_PIN_2 - interrupt due to activity on Pin 2.
  • GPIO_INT_PIN_3 - interrupt due to activity on Pin 3.
  • GPIO_INT_PIN_4 - interrupt due to activity on Pin 4.
  • GPIO_INT_PIN_5 - interrupt due to activity on Pin 5.
  • GPIO_INT_PIN_6 - interrupt due to activity on Pin 6.
  • GPIO_INT_PIN_7 - interrupt due to activity on Pin 7.
  • GPIO_INT_DMA - interrupt due to DMA activity on this GPIO module.
Note
If this call is being used to enable summary interrupts on GPIO port P or Q (GPIOIntTypeSet() with GPIO_DISCRETE_INT not enabled), then all individual interrupts for these ports must be enabled in the GPIO module using GPIOIntEnable() and all but the interrupt for pin 0 must be disabled in the NVIC using the IntDisable() function. The summary interrupts for the ports are routed to the INT_GPIOP0 or INT_GPIOQ0 which must be enabled to handle the interrupt. If this is not done then any individual GPIO pin interrupts that are left enabled also trigger the individual interrupts.
Returns
None.

Definition at line 763 of file gpio.c.

References ASSERT, GPIO_O_IM, and HWREG.

Referenced by button_init().

764 {
765  //
766  // Check the arguments.
767  //
768  ASSERT(_GPIOBaseValid(ui32Port));
769 
770  //
771  // Enable the interrupts.
772  //
773  HWREG(ui32Port + GPIO_O_IM) |= ui32IntFlags;
774 }
#define HWREG(x)
Definition: hw_types.h:48
#define ASSERT(expr)
Definition: debug.h:67
#define GPIO_O_IM
Definition: hw_gpio.h:53

Here is the caller graph for this function:

void GPIOIntRegister ( uint32_t  ui32Port,
void(*)(void)  pfnIntHandler 
)

Registers an interrupt handler for a GPIO port.

Parameters
ui32Portis the base address of the GPIO port.
pfnIntHandleris a pointer to the GPIO port interrupt handling function.

This function ensures that the interrupt handler specified by pfnIntHandler is called when an interrupt is detected from the selected GPIO port. This function also enables the corresponding GPIO interrupt in the interrupt controller; individual pin interrupts and interrupt sources must be enabled with GPIOIntEnable().

See also
IntRegister() for important information about registering interrupt handlers.
Returns
None.

Definition at line 912 of file gpio.c.

References _GPIOIntNumberGet(), ASSERT, IntEnable(), and IntRegister().

913 {
914  uint32_t ui32Int;
915 
916  //
917  // Check the arguments.
918  //
919  ASSERT(_GPIOBaseValid(ui32Port));
920 
921  //
922  // Get the interrupt number associated with the specified GPIO.
923  //
924  ui32Int = _GPIOIntNumberGet(ui32Port);
925 
926  ASSERT(ui32Int != 0);
927 
928  //
929  // Register the interrupt handler.
930  //
931  IntRegister(ui32Int, pfnIntHandler);
932 
933  //
934  // Enable the GPIO interrupt.
935  //
936  IntEnable(ui32Int);
937 }
static uint32_t _GPIOIntNumberGet(uint32_t ui32Port)
Definition: gpio.c:212
#define ASSERT(expr)
Definition: debug.h:67
void IntRegister(uint32_t ui32Interrupt, void(*pfnHandler)(void))
Definition: interrupt.c:309
void IntEnable(uint32_t ui32Interrupt)
Definition: interrupt.c:610

Here is the call graph for this function:

uint32_t GPIOIntStatus ( uint32_t  ui32Port,
bool  bMasked 
)

Gets interrupt status for the specified GPIO port.

Parameters
ui32Portis the base address of the GPIO port.
bMaskedspecifies whether masked or raw interrupt status is returned.

If bMasked is set as true, then the masked interrupt status is returned; otherwise, the raw interrupt status is returned.

Returns
Returns the current interrupt status for the specified GPIO module. The value returned is the logical OR of the GPIO_INT_* values that are currently active.

Definition at line 833 of file gpio.c.

References ASSERT, GPIO_O_MIS, GPIO_O_RIS, and HWREG.

834 {
835  //
836  // Check the arguments.
837  //
838  ASSERT(_GPIOBaseValid(ui32Port));
839 
840  //
841  // Return the interrupt status.
842  //
843  if(bMasked)
844  {
845  return(HWREG(ui32Port + GPIO_O_MIS));
846  }
847  else
848  {
849  return(HWREG(ui32Port + GPIO_O_RIS));
850  }
851 }
#define GPIO_O_RIS
Definition: hw_gpio.h:54
#define HWREG(x)
Definition: hw_types.h:48
#define ASSERT(expr)
Definition: debug.h:67
#define GPIO_O_MIS
Definition: hw_gpio.h:55
uint32_t GPIOIntTypeGet ( uint32_t  ui32Port,
uint8_t  ui8Pin 
)

Gets the interrupt type for a pin.

Parameters
ui32Portis the base address of the GPIO port.
ui8Pinis the pin number.

This function gets the interrupt type for a specified pin on the selected GPIO port. The pin can be configured as a falling-edge, rising-edge, or both-edges detected interrupt, or it can be configured as a low-level or high-level detected interrupt. The type of interrupt detection mechanism is returned and can include the GPIO_DISCRETE_INT flag.

Returns
Returns one of the flags described for GPIOIntTypeSet().

Definition at line 454 of file gpio.c.

References ASSERT, GPIO_O_IBE, GPIO_O_IEV, GPIO_O_IS, GPIO_O_SI, and HWREG.

455 {
456  uint32_t ui32IBE, ui32IS, ui32IEV, ui32SI;
457 
458  //
459  // Check the arguments.
460  //
461  ASSERT(_GPIOBaseValid(ui32Port));
462  ASSERT(ui8Pin < 8);
463 
464  //
465  // Convert from a pin number to a bit position.
466  //
467  ui8Pin = 1 << ui8Pin;
468 
469  //
470  // Return the pin interrupt type.
471  //
472  ui32IBE = HWREG(ui32Port + GPIO_O_IBE);
473  ui32IS = HWREG(ui32Port + GPIO_O_IS);
474  ui32IEV = HWREG(ui32Port + GPIO_O_IEV);
475  ui32SI = HWREG(ui32Port + GPIO_O_SI);
476  return(((ui32IBE & ui8Pin) ? 1 : 0) | ((ui32IS & ui8Pin) ? 2 : 0) |
477  ((ui32IEV & ui8Pin) ? 4 : 0) | (ui32SI & 0x01) ? 0x10000 : 0);
478 }
#define GPIO_O_IS
Definition: hw_gpio.h:50
#define HWREG(x)
Definition: hw_types.h:48
#define GPIO_O_SI
Definition: hw_gpio.h:72
#define GPIO_O_IBE
Definition: hw_gpio.h:51
#define ASSERT(expr)
Definition: debug.h:67
#define GPIO_O_IEV
Definition: hw_gpio.h:52
void GPIOIntTypeSet ( uint32_t  ui32Port,
uint8_t  ui8Pins,
uint32_t  ui32IntType 
)

Sets the interrupt type for the specified pin(s).

Parameters
ui32Portis the base address of the GPIO port.
ui8Pinsis the bit-packed representation of the pin(s).
ui32IntTypespecifies the type of interrupt trigger mechanism.

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

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

  • GPIO_FALLING_EDGE sets detection to edge and trigger to falling
  • GPIO_RISING_EDGE sets detection to edge and trigger to rising
  • GPIO_BOTH_EDGES sets detection to both edges
  • GPIO_LOW_LEVEL sets detection to low level
  • GPIO_HIGH_LEVEL sets detection to high level

In addition to the above flags, the following flag can be OR'd in to the ui32IntType parameter:

  • GPIO_DISCRETE_INT sets discrete interrupts for each pin on a GPIO port.

The GPIO_DISCRETE_INT is not available on all devices or all GPIO ports, consult the data sheet to ensure that the device and the GPIO port supports discrete interrupts.

The pin(s) are specified using a bit-packed byte, where each bit that is set identifies the pin to be accessed, and where bit 0 of the byte represents GPIO port pin 0, bit 1 represents GPIO port pin 1, and so on.

Note
In order to avoid any spurious interrupts, the user must ensure that the GPIO inputs remain stable for the duration of this function.
Returns
None.

Definition at line 402 of file gpio.c.

References ASSERT, GPIO_BOTH_EDGES, GPIO_FALLING_EDGE, GPIO_HIGH_LEVEL, GPIO_LOW_LEVEL, GPIO_O_IBE, GPIO_O_IEV, GPIO_O_IS, GPIO_O_SI, GPIO_RISING_EDGE, and HWREG.

Referenced by button_set_interrupt().

404 {
405  //
406  // Check the arguments.
407  //
408  ASSERT(_GPIOBaseValid(ui32Port));
409  ASSERT((ui32IntType == GPIO_FALLING_EDGE) ||
410  (ui32IntType == GPIO_RISING_EDGE) ||
411  (ui32IntType == GPIO_BOTH_EDGES) ||
412  (ui32IntType == GPIO_LOW_LEVEL) ||
413  (ui32IntType == GPIO_HIGH_LEVEL));
414 
415  //
416  // Set the pin interrupt type.
417  //
418  HWREG(ui32Port + GPIO_O_IBE) = ((ui32IntType & 1) ?
419  (HWREG(ui32Port + GPIO_O_IBE) | ui8Pins) :
420  (HWREG(ui32Port + GPIO_O_IBE) & ~(ui8Pins)));
421  HWREG(ui32Port + GPIO_O_IS) = ((ui32IntType & 2) ?
422  (HWREG(ui32Port + GPIO_O_IS) | ui8Pins) :
423  (HWREG(ui32Port + GPIO_O_IS) & ~(ui8Pins)));
424  HWREG(ui32Port + GPIO_O_IEV) = ((ui32IntType & 4) ?
425  (HWREG(ui32Port + GPIO_O_IEV) | ui8Pins) :
426  (HWREG(ui32Port + GPIO_O_IEV) & ~(ui8Pins)));
427 
428  //
429  // Set or clear the discrete interrupt feature. This is not available
430  // on all parts or ports but is safe to write in all cases.
431  //
432  HWREG(ui32Port + GPIO_O_SI) = ((ui32IntType & 0x10000) ?
433  (HWREG(ui32Port + GPIO_O_SI) | 0x01) :
434  (HWREG(ui32Port + GPIO_O_SI) & ~(0x01)));
435 }
#define GPIO_O_IS
Definition: hw_gpio.h:50
#define GPIO_RISING_EDGE
Definition: gpio.h:86
#define HWREG(x)
Definition: hw_types.h:48
#define GPIO_O_SI
Definition: hw_gpio.h:72
#define GPIO_FALLING_EDGE
Definition: gpio.h:85
#define GPIO_BOTH_EDGES
Definition: gpio.h:87
#define GPIO_O_IBE
Definition: hw_gpio.h:51
#define ASSERT(expr)
Definition: debug.h:67
#define GPIO_LOW_LEVEL
Definition: gpio.h:88
#define GPIO_O_IEV
Definition: hw_gpio.h:52
#define GPIO_HIGH_LEVEL
Definition: gpio.h:89

Here is the caller graph for this function:

void GPIOIntUnregister ( uint32_t  ui32Port)

Removes an interrupt handler for a GPIO port.

Parameters
ui32Portis the base address of the GPIO port.

This function unregisters the interrupt handler for the specified GPIO port. This function also disables the corresponding GPIO port interrupt in the interrupt controller; individual GPIO interrupts and interrupt sources must be disabled with GPIOIntDisable().

See also
IntRegister() for important information about registering interrupt handlers.
Returns
None.

Definition at line 957 of file gpio.c.

References _GPIOIntNumberGet(), ASSERT, IntDisable(), and IntUnregister().

958 {
959  uint32_t ui32Int;
960 
961  //
962  // Check the arguments.
963  //
964  ASSERT(_GPIOBaseValid(ui32Port));
965 
966  //
967  // Get the interrupt number associated with the specified GPIO.
968  //
969  ui32Int = _GPIOIntNumberGet(ui32Port);
970 
971  ASSERT(ui32Int != 0);
972 
973  //
974  // Disable the GPIO interrupt.
975  //
976  IntDisable(ui32Int);
977 
978  //
979  // Unregister the interrupt handler.
980  //
981  IntUnregister(ui32Int);
982 }
static uint32_t _GPIOIntNumberGet(uint32_t ui32Port)
Definition: gpio.c:212
#define ASSERT(expr)
Definition: debug.h:67
void IntUnregister(uint32_t ui32Interrupt)
Definition: interrupt.c:381
void IntDisable(uint32_t ui32Interrupt)
Definition: interrupt.c:684

Here is the call graph for this function:

void GPIOPadConfigGet ( uint32_t  ui32Port,
uint8_t  ui8Pin,
uint32_t *  pui32Strength,
uint32_t *  pui32PinType 
)

Gets the pad configuration for a pin.

Parameters
ui32Portis the base address of the GPIO port.
ui8Pinis the pin number.
pui32Strengthis a pointer to storage for the output drive strength.
pui32PinTypeis a pointer to storage for the output drive type.

This function gets the pad configuration for a specified pin on the selected GPIO port. The values returned in pui32Strength and pui32PinType correspond to the values used in GPIOPadConfigSet(). This function also works for pin(s) configured as input pin(s); however, the only meaningful data returned is whether the pin is terminated with a pull-up or down resistor.

Returns
None

Definition at line 684 of file gpio.c.

References ASSERT, GPIO_O_DEN, GPIO_O_DR12R, GPIO_O_DR2R, GPIO_O_DR4R, GPIO_O_DR8R, GPIO_O_ODR, GPIO_O_PC, GPIO_O_PDR, GPIO_O_PUR, GPIO_O_SLR, GPIO_O_WAKELVL, GPIO_O_WAKEPEN, and HWREG.

686 {
687  uint32_t ui32PinType, ui32Strength;
688 
689  //
690  // Check the arguments.
691  //
692  ASSERT(_GPIOBaseValid(ui32Port));
693  ASSERT(ui8Pin < 8);
694 
695  //
696  // Convert from a pin number to a bit position.
697  //
698  ui8Pin = (1 << ui8Pin);
699 
700  //
701  // Get the drive strength for this pin.
702  //
703  ui32Strength = ((HWREG(ui32Port + GPIO_O_DR2R) & ui8Pin) ? 1 : 0);
704  ui32Strength |= ((HWREG(ui32Port + GPIO_O_DR4R) & ui8Pin) ? 2 : 0);
705  ui32Strength |= ((HWREG(ui32Port + GPIO_O_DR8R) & ui8Pin) ? 4 : 0);
706  ui32Strength |= ((HWREG(ui32Port + GPIO_O_SLR) & ui8Pin) ? 8 : 0);
707  ui32Strength |= ((HWREG(ui32Port + GPIO_O_DR12R) & ui8Pin) ? 0x10 : 0);
708  ui32Strength |= (((HWREG(ui32Port + GPIO_O_PC) >>
709  (2 * ui8Pin)) & 0x3) << 5);
710  *pui32Strength = ui32Strength;
711 
712  //
713  // Get the pin type.
714  //
715  ui32PinType = ((HWREG(ui32Port + GPIO_O_ODR) & ui8Pin) ? 1 : 0);
716  ui32PinType |= ((HWREG(ui32Port + GPIO_O_PUR) & ui8Pin) ? 2 : 0);
717  ui32PinType |= ((HWREG(ui32Port + GPIO_O_PDR) & ui8Pin) ? 4 : 0);
718  ui32PinType |= ((HWREG(ui32Port + GPIO_O_DEN) & ui8Pin) ? 8 : 0);
719  if(HWREG(ui32Port + GPIO_O_WAKEPEN) & ui8Pin)
720  {
721  ui32PinType |= ((HWREG(ui32Port + GPIO_O_WAKELVL) & ui8Pin) ?
722  0x200 : 0x100);
723  }
724  *pui32PinType = ui32PinType;
725 }
#define HWREG(x)
Definition: hw_types.h:48
#define ASSERT(expr)
Definition: debug.h:67
#define GPIO_O_SLR
Definition: hw_gpio.h:64
#define GPIO_O_DR8R
Definition: hw_gpio.h:60
#define GPIO_O_ODR
Definition: hw_gpio.h:61
#define GPIO_O_PUR
Definition: hw_gpio.h:62
#define GPIO_O_DR2R
Definition: hw_gpio.h:58
#define GPIO_O_DEN
Definition: hw_gpio.h:65
#define GPIO_O_WAKELVL
Definition: hw_gpio.h:75
#define GPIO_O_WAKEPEN
Definition: hw_gpio.h:74
#define GPIO_O_PDR
Definition: hw_gpio.h:63
#define GPIO_O_DR4R
Definition: hw_gpio.h:59
#define GPIO_O_DR12R
Definition: hw_gpio.h:73
#define GPIO_O_PC
Definition: hw_gpio.h:78
void GPIOPadConfigSet ( uint32_t  ui32Port,
uint8_t  ui8Pins,
uint32_t  ui32Strength,
uint32_t  ui32PinType 
)

Sets the pad configuration for the specified pin(s).

Parameters
ui32Portis the base address of the GPIO port.
ui8Pinsis the bit-packed representation of the pin(s).
ui32Strengthspecifies the output drive strength.
ui32PinTypespecifies the pin type.

This function sets the drive strength and type for the specified pin(s) on the selected GPIO port. For pin(s) configured as input ports, the pad is configured as requested, but the only real effect on the input is the configuration of the pull-up or pull-down termination.

The parameter ui32Strength can be one of the following values:

  • GPIO_STRENGTH_2MA
  • GPIO_STRENGTH_4MA
  • GPIO_STRENGTH_8MA
  • GPIO_STRENGTH_8MA_SC
  • GPIO_STRENGTH_6MA
  • GPIO_STRENGTH_10MA
  • GPIO_STRENGTH_12MA

where GPIO_STRENGTH_xMA specifies either 2, 4, or 8 mA output drive strength, and GPIO_OUT_STRENGTH_8MA_SC specifies 8 mA output drive with slew control.

Some Tiva devices also support output drive strengths of 6, 10, and 12 mA.

The parameter ui32PinType can be one of the following values:

  • GPIO_PIN_TYPE_STD
  • GPIO_PIN_TYPE_STD_WPU
  • GPIO_PIN_TYPE_STD_WPD
  • GPIO_PIN_TYPE_OD
  • GPIO_PIN_TYPE_ANALOG
  • GPIO_PIN_TYPE_WAKE_HIGH
  • GPIO_PIN_TYPE_WAKE_LOW

where GPIO_PIN_TYPE_STD* specifies a push-pull pin, GPIO_PIN_TYPE_OD* specifies an open-drain pin, *_WPU specifies a weak pull-up, *_WPD specifies a weak pull-down, and GPIO_PIN_TYPE_ANALOG specifies an analog input.

The GPIO_PIN_TYPE_WAKE_* settings specify the pin to be used as a hibernation wake source. The pin sense level can be high or low. These settings are only available on some Tiva devices.

The pin(s) are specified using a bit-packed byte, where each bit that is set identifies the pin to be accessed, and where bit 0 of the byte represents GPIO port pin 0, bit 1 represents GPIO port pin 1, and so on.

Note
A subset of GPIO pins on Tiva devices, notably those used by the JTAG/SWD interface and any pin capable of acting as an NMI input, are locked against inadvertent reconfiguration. These pins must be unlocked using direct register writes to the relevant GPIO_O_LOCK and GPIO_O_CR registers before this function can be called. Please see the ``gpio_jtag'' example application for the mechanism required and consult your part datasheet for information on affected pins.
Returns
None.

Definition at line 546 of file gpio.c.

References ASSERT, GPIO_O_AMSEL, GPIO_O_DEN, GPIO_O_DR12R, GPIO_O_DR2R, GPIO_O_DR4R, GPIO_O_DR8R, GPIO_O_ODR, GPIO_O_PC, GPIO_O_PDR, GPIO_O_PUR, GPIO_O_SLR, GPIO_O_WAKELVL, GPIO_O_WAKEPEN, GPIO_PIN_TYPE_ANALOG, GPIO_PIN_TYPE_OD, GPIO_PIN_TYPE_STD, GPIO_PIN_TYPE_STD_WPD, GPIO_PIN_TYPE_STD_WPU, GPIO_PIN_TYPE_WAKE_HIGH, GPIO_PIN_TYPE_WAKE_LOW, GPIO_STRENGTH_10MA, GPIO_STRENGTH_12MA, GPIO_STRENGTH_2MA, GPIO_STRENGTH_4MA, GPIO_STRENGTH_6MA, GPIO_STRENGTH_8MA, GPIO_STRENGTH_8MA_SC, and HWREG.

Referenced by button_init(), GPIOPinTypeADC(), GPIOPinTypeCAN(), GPIOPinTypeCIR(), GPIOPinTypeComparator(), GPIOPinTypeEPI(), GPIOPinTypeEthernetLED(), GPIOPinTypeEthernetMII(), GPIOPinTypeGPIOInput(), GPIOPinTypeGPIOOutput(), GPIOPinTypeGPIOOutputOD(), GPIOPinTypeI2C(), GPIOPinTypeI2CSCL(), GPIOPinTypeKBColumn(), GPIOPinTypeKBRow(), GPIOPinTypeLCD(), GPIOPinTypeLEDSeq(), GPIOPinTypeLPC(), GPIOPinTypePECIRx(), GPIOPinTypePECITx(), GPIOPinTypePWM(), GPIOPinTypeQEI(), GPIOPinTypeSSI(), GPIOPinTypeTimer(), GPIOPinTypeUART(), GPIOPinTypeUSBAnalog(), GPIOPinTypeUSBDigital(), GPIOPinTypeWakeHigh(), and GPIOPinTypeWakeLow().

548 {
549  uint8_t ui8Bit;
550 
551  //
552  // Check the arguments.
553  //
554  ASSERT(_GPIOBaseValid(ui32Port));
555  ASSERT((ui32Strength == GPIO_STRENGTH_2MA) ||
556  (ui32Strength == GPIO_STRENGTH_4MA) ||
557  (ui32Strength == GPIO_STRENGTH_6MA) ||
558  (ui32Strength == GPIO_STRENGTH_8MA) ||
559  (ui32Strength == GPIO_STRENGTH_8MA_SC) ||
560  (ui32Strength == GPIO_STRENGTH_10MA) ||
561  (ui32Strength == GPIO_STRENGTH_12MA));
562  ASSERT((ui32PinType == GPIO_PIN_TYPE_STD) ||
563  (ui32PinType == GPIO_PIN_TYPE_STD_WPU) ||
564  (ui32PinType == GPIO_PIN_TYPE_STD_WPD) ||
565  (ui32PinType == GPIO_PIN_TYPE_OD) ||
566  (ui32PinType == GPIO_PIN_TYPE_WAKE_LOW) ||
567  (ui32PinType == GPIO_PIN_TYPE_WAKE_HIGH) ||
568  (ui32PinType == GPIO_PIN_TYPE_ANALOG));
569 
570 
571  //
572  // Set the GPIO peripheral configuration register first as required. This
573  // register only appears in TM4E111 and later device classes, but is a
574  // harmless write on older devices. Walk pins 0-7 and clear or set the
575  // provided PC[EDMn] encoding.
576  //
577  for(ui8Bit = 0; ui8Bit < 8; ui8Bit++)
578  {
579  if(ui8Pins & (1 << ui8Bit))
580  {
581  HWREG(ui32Port + GPIO_O_PC) = (HWREG(ui32Port + GPIO_O_PC) &
582  ~(0x3 << (2 * ui8Bit)));
583  HWREG(ui32Port + GPIO_O_PC) |= (((ui32Strength >> 5) & 0x3) <<
584  (2 * ui8Bit));
585  }
586  }
587 
588  //
589  // Set the output drive strength.
590  //
591  HWREG(ui32Port + GPIO_O_DR2R) = ((ui32Strength & 1) ?
592  (HWREG(ui32Port + GPIO_O_DR2R) |
593  ui8Pins) :
594  (HWREG(ui32Port + GPIO_O_DR2R) &
595  ~(ui8Pins)));
596  HWREG(ui32Port + GPIO_O_DR4R) = ((ui32Strength & 2) ?
597  (HWREG(ui32Port + GPIO_O_DR4R) |
598  ui8Pins) :
599  (HWREG(ui32Port + GPIO_O_DR4R) &
600  ~(ui8Pins)));
601  HWREG(ui32Port + GPIO_O_DR8R) = ((ui32Strength & 4) ?
602  (HWREG(ui32Port + GPIO_O_DR8R) |
603  ui8Pins) :
604  (HWREG(ui32Port + GPIO_O_DR8R) &
605  ~(ui8Pins)));
606  HWREG(ui32Port + GPIO_O_SLR) = ((ui32Strength & 8) ?
607  (HWREG(ui32Port + GPIO_O_SLR) |
608  ui8Pins) :
609  (HWREG(ui32Port + GPIO_O_SLR) &
610  ~(ui8Pins)));
611 
612  //
613  // Set the 12-mA drive select register. This register only appears in
614  // TM4E111 and later device classes, but is a harmless write on older
615  // devices.
616  //
617  HWREG(ui32Port + GPIO_O_DR12R) = ((ui32Strength & 0x10) ?
618  (HWREG(ui32Port + GPIO_O_DR12R) |
619  ui8Pins) :
620  (HWREG(ui32Port + GPIO_O_DR12R) &
621  ~(ui8Pins)));
622 
623  //
624  // Set the pin type.
625  //
626  HWREG(ui32Port + GPIO_O_ODR) = ((ui32PinType & 1) ?
627  (HWREG(ui32Port + GPIO_O_ODR) | ui8Pins) :
628  (HWREG(ui32Port + GPIO_O_ODR) & ~(ui8Pins)));
629  HWREG(ui32Port + GPIO_O_PUR) = ((ui32PinType & 2) ?
630  (HWREG(ui32Port + GPIO_O_PUR) | ui8Pins) :
631  (HWREG(ui32Port + GPIO_O_PUR) & ~(ui8Pins)));
632  HWREG(ui32Port + GPIO_O_PDR) = ((ui32PinType & 4) ?
633  (HWREG(ui32Port + GPIO_O_PDR) | ui8Pins) :
634  (HWREG(ui32Port + GPIO_O_PDR) & ~(ui8Pins)));
635  HWREG(ui32Port + GPIO_O_DEN) = ((ui32PinType & 8) ?
636  (HWREG(ui32Port + GPIO_O_DEN) | ui8Pins) :
637  (HWREG(ui32Port + GPIO_O_DEN) & ~(ui8Pins)));
638 
639  //
640  // Set the wake pin enable register and the wake level register. These
641  // registers only appear in TM4E111 and later device classes, but are
642  // harmless writes on older devices.
643  //
644  HWREG(ui32Port + GPIO_O_WAKELVL) = ((ui32PinType & 0x200) ?
645  (HWREG(ui32Port + GPIO_O_WAKELVL) |
646  ui8Pins) :
647  (HWREG(ui32Port + GPIO_O_WAKELVL) &
648  ~(ui8Pins)));
649  HWREG(ui32Port + GPIO_O_WAKEPEN) = ((ui32PinType & 0x300) ?
650  (HWREG(ui32Port + GPIO_O_WAKEPEN) |
651  ui8Pins) :
652  (HWREG(ui32Port + GPIO_O_WAKEPEN) &
653  ~(ui8Pins)));
654 
655  //
656  // Set the analog mode select register.
657  //
658  HWREG(ui32Port + GPIO_O_AMSEL) =
659  ((ui32PinType == GPIO_PIN_TYPE_ANALOG) ?
660  (HWREG(ui32Port + GPIO_O_AMSEL) | ui8Pins) :
661  (HWREG(ui32Port + GPIO_O_AMSEL) & ~(ui8Pins)));
662 }
#define GPIO_STRENGTH_4MA
Definition: gpio.h:99
#define GPIO_PIN_TYPE_STD
Definition: gpio.h:112
#define HWREG(x)
Definition: hw_types.h:48
#define GPIO_PIN_TYPE_STD_WPU
Definition: gpio.h:113
#define GPIO_PIN_TYPE_OD
Definition: gpio.h:115
#define GPIO_O_AMSEL
Definition: hw_gpio.h:68
#define ASSERT(expr)
Definition: debug.h:67
#define GPIO_PIN_TYPE_WAKE_HIGH
Definition: gpio.h:117
#define GPIO_PIN_TYPE_WAKE_LOW
Definition: gpio.h:118
#define GPIO_PIN_TYPE_STD_WPD
Definition: gpio.h:114
#define GPIO_O_SLR
Definition: hw_gpio.h:64
#define GPIO_STRENGTH_8MA
Definition: gpio.h:101
#define GPIO_O_DR8R
Definition: hw_gpio.h:60
#define GPIO_STRENGTH_2MA
Definition: gpio.h:98
#define GPIO_STRENGTH_12MA
Definition: gpio.h:104
#define GPIO_O_ODR
Definition: hw_gpio.h:61
#define GPIO_O_PUR
Definition: hw_gpio.h:62
#define GPIO_O_DR2R
Definition: hw_gpio.h:58
#define GPIO_O_DEN
Definition: hw_gpio.h:65
#define GPIO_STRENGTH_6MA
Definition: gpio.h:100
#define GPIO_O_WAKELVL
Definition: hw_gpio.h:75
#define GPIO_STRENGTH_10MA
Definition: gpio.h:103
#define GPIO_O_WAKEPEN
Definition: hw_gpio.h:74
#define GPIO_O_PDR
Definition: hw_gpio.h:63
#define GPIO_STRENGTH_8MA_SC
Definition: gpio.h:102
#define GPIO_O_DR4R
Definition: hw_gpio.h:59
#define GPIO_O_DR12R
Definition: hw_gpio.h:73
#define GPIO_PIN_TYPE_ANALOG
Definition: gpio.h:116
#define GPIO_O_PC
Definition: hw_gpio.h:78

Here is the caller graph for this function:

void GPIOPinConfigure ( uint32_t  ui32PinConfig)

Configures the alternate function of a GPIO pin.

Parameters
ui32PinConfigis the pin configuration value, specified as only one of the GPIO_P??_??? 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). To fully configure a pin, a GPIOPinType*() function should also be called.

The available mappings are supplied on a per-device basis in pin_map.h. The PART_<partno> defines controls which set of defines are included so that they match the device that is being used. For example, PART_TM4C129XNCZAD must be defined in order to get the correct pin mappings for the TM4C129XNCZAD device.

Note
If the same signal is assigned to two different GPIO port pins, the signal is assigned to the port with the lowest letter and the assignment to the higher letter port is ignored.
Returns
None.

Definition at line 2509 of file gpio.c.

References ASSERT, GPIO_O_PCTL, HWREG, and SYSCTL_GPIOHBCTL.

Referenced by main(), and uart_init().

2510 {
2511  uint32_t ui32Base, ui32Shift;
2512 
2513  //
2514  // Check the argument.
2515  //
2516  ASSERT(((ui32PinConfig >> 16) & 0xff) < 15);
2517  ASSERT(((ui32PinConfig >> 8) & 0xe3) == 0);
2518 
2519  //
2520  // Extract the base address index from the input value.
2521  //
2522  ui32Base = (ui32PinConfig >> 16) & 0xff;
2523 
2524  //
2525  // Get the base address of the GPIO module, selecting either the APB or the
2526  // AHB aperture as appropriate.
2527  //
2528  if(HWREG(SYSCTL_GPIOHBCTL) & (1 << ui32Base))
2529  {
2530  ui32Base = g_pui32GPIOBaseAddrs[(ui32Base << 1) + 1];
2531  }
2532  else
2533  {
2534  ui32Base = g_pui32GPIOBaseAddrs[ui32Base << 1];
2535  }
2536 
2537  //
2538  // Extract the shift from the input value.
2539  //
2540  ui32Shift = (ui32PinConfig >> 8) & 0xff;
2541 
2542  //
2543  // Write the requested pin muxing value for this GPIO pin.
2544  //
2545  HWREG(ui32Base + GPIO_O_PCTL) = ((HWREG(ui32Base + GPIO_O_PCTL) &
2546  ~(0xf << ui32Shift)) |
2547  ((ui32PinConfig & 0xf) << ui32Shift));
2548 }
#define HWREG(x)
Definition: hw_types.h:48
#define ASSERT(expr)
Definition: debug.h:67
#define SYSCTL_GPIOHBCTL
Definition: hw_sysctl.h:72
#define GPIO_O_PCTL
Definition: hw_gpio.h:69
static const uint32_t g_pui32GPIOBaseAddrs[]
Definition: gpio.c:130

Here is the caller graph for this function:

int32_t GPIOPinRead ( uint32_t  ui32Port,
uint8_t  ui8Pins 
)

Reads the values present of the specified pin(s).

Parameters
ui32Portis the base address of the GPIO port.
ui8Pinsis the bit-packed representation of the pin(s).

The values at the specified pin(s) are read, as specified by ui8Pins. Values are returned for both input and output pin(s), and the value for pin(s) that are not specified by ui8Pins are set to 0.

The pin(s) are specified using a bit-packed byte, where each bit that is set identifies the pin to be accessed, and where bit 0 of the byte represents GPIO port pin 0, bit 1 represents GPIO port pin 1, and so on.

Returns
Returns a bit-packed byte providing the state of the specified pin, where bit 0 of the byte represents GPIO port pin 0, bit 1 represents GPIO port pin 1, and so on. Any bit that is not specified by ui8Pins is returned as a 0. Bits 31:8 should be ignored.

Definition at line 1006 of file gpio.c.

References ASSERT, GPIO_O_DATA, and HWREG.

Referenced by button_debounce_end(), button_debounce_start(), GPIOPortF_Handler(), heart_status(), led_blink_blue(), led_blink_green(), led_blink_red(), led_single_blink_blue(), led_single_blink_green(), led_single_blink_red(), postpone_suicide(), Thread1(), Thread2(), and uart_consumer().

1007 {
1008  //
1009  // Check the arguments.
1010  //
1011  ASSERT(_GPIOBaseValid(ui32Port));
1012 
1013  //
1014  // Return the pin value(s).
1015  //
1016  return(HWREG(ui32Port + (GPIO_O_DATA + (ui8Pins << 2))));
1017 }
#define HWREG(x)
Definition: hw_types.h:48
#define ASSERT(expr)
Definition: debug.h:67
#define GPIO_O_DATA
Definition: hw_gpio.h:48

Here is the caller graph for this function:

void GPIOPinTypeADC ( uint32_t  ui32Port,
uint8_t  ui8Pins 
)

Configures pin(s) for use as analog-to-digital converter inputs.

Parameters
ui32Portis the base address of the GPIO port.
ui8Pinsis the bit-packed representation of the pin(s).

The analog-to-digital converter input pins must be properly configured for the analog-to-digital peripheral to function correctly. This function provides the proper configuration for those pin(s).

The pin(s) are specified using a bit-packed byte, where each bit that is set identifies the pin to be accessed, and where bit 0 of the byte represents GPIO port pin 0, bit 1 represents GPIO port pin 1, and so on.

Note
This function cannot be used to turn any pin into an ADC input; it only configures an ADC input pin for proper operation.
A subset of GPIO pins on Tiva devices, notably those used by the JTAG/SWD interface and any pin capable of acting as an NMI input, are locked against inadvertent reconfiguration. These pins must be unlocked using direct register writes to the relevant GPIO_O_LOCK and GPIO_O_CR registers before this function can be called. Please see the ``gpio_jtag'' example application for the mechanism required and consult your part datasheet for information on affected pins.
Returns
None.

Definition at line 1081 of file gpio.c.

References ASSERT, GPIO_DIR_MODE_IN, GPIO_PIN_TYPE_ANALOG, GPIO_STRENGTH_2MA, GPIODirModeSet(), and GPIOPadConfigSet().

Referenced by adc_init().

1082 {
1083  //
1084  // Check the arguments.
1085  //
1086  ASSERT(_GPIOBaseValid(ui32Port));
1087 
1088  //
1089  // Make the pin(s) be inputs.
1090  //
1091  GPIODirModeSet(ui32Port, ui8Pins, GPIO_DIR_MODE_IN);
1092 
1093  //
1094  // Set the pad(s) for analog operation.
1095  //
1096  GPIOPadConfigSet(ui32Port, ui8Pins, GPIO_STRENGTH_2MA,
1098 }
#define ASSERT(expr)
Definition: debug.h:67
void GPIOPadConfigSet(uint32_t ui32Port, uint8_t ui8Pins, uint32_t ui32Strength, uint32_t ui32PinType)
Definition: gpio.c:546
#define GPIO_STRENGTH_2MA
Definition: gpio.h:98
#define GPIO_DIR_MODE_IN
Definition: gpio.h:75
void GPIODirModeSet(uint32_t ui32Port, uint8_t ui8Pins, uint32_t ui32PinIO)
Definition: gpio.c:298
#define GPIO_PIN_TYPE_ANALOG
Definition: gpio.h:116

Here is the call graph for this function:

Here is the caller graph for this function:

void GPIOPinTypeCAN ( uint32_t  ui32Port,
uint8_t  ui8Pins 
)

Configures pin(s) for use as a CAN device.

Parameters
ui32Portis the base address of the GPIO port.
ui8Pinsis the bit-packed representation of the pin(s).

The CAN pins must be properly configured for the CAN peripherals to function correctly. This function provides a typical configuration for those pin(s); other configurations may work as well depending upon the board setup (for example, using the on-chip pull-ups).

The pin(s) are specified using a bit-packed byte, where each bit that is set identifies the pin to be accessed, and where bit 0 of the byte represents GPIO port pin 0, bit 1 represents GPIO port pin 1, and so on.

Note
This function cannot be used to turn any pin into a CAN pin; it only configures a CAN pin for proper operation. Note that a GPIOPinConfigure() function call is also required to properly configure a pin for the CAN function.
A subset of GPIO pins on Tiva devices, notably those used by the JTAG/SWD interface and any pin capable of acting as an NMI input, are locked against inadvertent reconfiguration. These pins must be unlocked using direct register writes to the relevant GPIO_O_LOCK and GPIO_O_CR registers before this function can be called. Please see the ``gpio_jtag'' example application for the mechanism required and consult your part datasheet for information on affected pins.
Returns
None.

Definition at line 1133 of file gpio.c.

References ASSERT, GPIO_DIR_MODE_HW, GPIO_PIN_TYPE_STD, GPIO_STRENGTH_8MA, GPIODirModeSet(), and GPIOPadConfigSet().

1134 {
1135  //
1136  // Check the arguments.
1137  //
1138  ASSERT(_GPIOBaseValid(ui32Port));
1139 
1140  //
1141  // Make the pin(s) be inputs.
1142  //
1143  GPIODirModeSet(ui32Port, ui8Pins, GPIO_DIR_MODE_HW);
1144 
1145  //
1146  // Set the pad(s) for standard push-pull operation.
1147  //
1149 }
#define GPIO_DIR_MODE_HW
Definition: gpio.h:77
#define GPIO_PIN_TYPE_STD
Definition: gpio.h:112
#define ASSERT(expr)
Definition: debug.h:67
void GPIOPadConfigSet(uint32_t ui32Port, uint8_t ui8Pins, uint32_t ui32Strength, uint32_t ui32PinType)
Definition: gpio.c:546
#define GPIO_STRENGTH_8MA
Definition: gpio.h:101
void GPIODirModeSet(uint32_t ui32Port, uint8_t ui8Pins, uint32_t ui32PinIO)
Definition: gpio.c:298

Here is the call graph for this function:

void GPIOPinTypeCIR ( uint32_t  ui32Port,
uint8_t  ui8Pins 
)

Configures pin(s) for use as Consumer Infrared inputs or outputs.

Parameters
ui32Portis the base address of the GPIO port.
ui8Pinsis the bit-packed representation of the pin(s).

The GPIO pins must be properly configured in order to function correctly as Consumer Infrared pins. This function provides the proper configuration for those pin(s).

The pin(s) are specified using a bit-packed byte, where each bit that is set identifies the pin to be accessed, and where bit 0 of the byte represents GPIO port pin 0, bit 1 represents GPIO port pin 1, and so on.

Note
This function cannot be used to turn any pin into a CIR pin; it only configures a CIR pin for proper operation. Note that a GPIOPinConfigure() function call is also required to properly configure a pin for the Consumer Infrared function.
A subset of GPIO pins on Tiva devices, notably those used by the JTAG/SWD interface and any pin capable of acting as an NMI input, are locked against inadvertent reconfiguration. These pins must be unlocked using direct register writes to the relevant GPIO_O_LOCK and GPIO_O_CR registers before this function can be called. Please see the ``gpio_jtag'' example application for the mechanism required and consult your part datasheet for information on affected pins.
Returns
None.

Definition at line 2434 of file gpio.c.

References ASSERT, GPIO_DIR_MODE_HW, GPIO_PIN_TYPE_STD, GPIO_STRENGTH_2MA, GPIODirModeSet(), and GPIOPadConfigSet().

2435 {
2436  //
2437  // Check the arguments.
2438  //
2439  ASSERT(_GPIOBaseValid(ui32Port));
2440 
2441  //
2442  // Make the pin(s) be peripheral controlled.
2443  //
2444  GPIODirModeSet(ui32Port, ui8Pins, GPIO_DIR_MODE_HW);
2445 
2446  //
2447  // Set the pad(s) for standard push-pull operation.
2448  //
2450 }
#define GPIO_DIR_MODE_HW
Definition: gpio.h:77
#define GPIO_PIN_TYPE_STD
Definition: gpio.h:112
#define ASSERT(expr)
Definition: debug.h:67
void GPIOPadConfigSet(uint32_t ui32Port, uint8_t ui8Pins, uint32_t ui32Strength, uint32_t ui32PinType)
Definition: gpio.c:546
#define GPIO_STRENGTH_2MA
Definition: gpio.h:98
void GPIODirModeSet(uint32_t ui32Port, uint8_t ui8Pins, uint32_t ui32PinIO)
Definition: gpio.c:298

Here is the call graph for this function:

void GPIOPinTypeComparator ( uint32_t  ui32Port,
uint8_t  ui8Pins 
)

Configures pin(s) for use as an analog comparator input.

Parameters
ui32Portis the base address of the GPIO port.
ui8Pinsis the bit-packed representation of the pin(s).

The analog comparator input pins must be properly configured for the analog comparator to function correctly. This function provides the proper configuration for those pin(s).

The pin(s) are specified using a bit-packed byte, where each bit that is set identifies the pin to be accessed, and where bit 0 of the byte represents GPIO port pin 0, bit 1 represents GPIO port pin 1, and so on.

Note
This function cannot be used to turn any pin into an analog comparator input; it only configures an analog comparator pin for proper operation. Note that a GPIOPinConfigure() function call is also required to properly configure a pin for the analog comparator function.
A subset of GPIO pins on Tiva devices, notably those used by the JTAG/SWD interface and any pin capable of acting as an NMI input, are locked against inadvertent reconfiguration. These pins must be unlocked using direct register writes to the relevant GPIO_O_LOCK and GPIO_O_CR registers before this function can be called. Please see the ``gpio_jtag'' example application for the mechanism required and consult your part datasheet for information on affected pins.
Returns
None.

Definition at line 1183 of file gpio.c.

References ASSERT, GPIO_DIR_MODE_IN, GPIO_PIN_TYPE_ANALOG, GPIO_STRENGTH_2MA, GPIODirModeSet(), and GPIOPadConfigSet().

1184 {
1185  //
1186  // Check the arguments.
1187  //
1188  ASSERT(_GPIOBaseValid(ui32Port));
1189 
1190  //
1191  // Make the pin(s) be inputs.
1192  //
1193  GPIODirModeSet(ui32Port, ui8Pins, GPIO_DIR_MODE_IN);
1194 
1195  //
1196  // Set the pad(s) for analog operation.
1197  //
1198  GPIOPadConfigSet(ui32Port, ui8Pins, GPIO_STRENGTH_2MA,
1200 }
#define ASSERT(expr)
Definition: debug.h:67
void GPIOPadConfigSet(uint32_t ui32Port, uint8_t ui8Pins, uint32_t ui32Strength, uint32_t ui32PinType)
Definition: gpio.c:546
#define GPIO_STRENGTH_2MA
Definition: gpio.h:98
#define GPIO_DIR_MODE_IN
Definition: gpio.h:75
void GPIODirModeSet(uint32_t ui32Port, uint8_t ui8Pins, uint32_t ui32PinIO)
Definition: gpio.c:298
#define GPIO_PIN_TYPE_ANALOG
Definition: gpio.h:116

Here is the call graph for this function:

void GPIOPinTypeEPI ( uint32_t  ui32Port,
uint8_t  ui8Pins 
)

Configures pin(s) for use by the external peripheral interface.

Parameters
ui32Portis the base address of the GPIO port.
ui8Pinsis the bit-packed representation of the pin(s).

The external peripheral interface pins must be properly configured for the external peripheral interface to function correctly. This function provides a typical configuration for those pin(s); other configurations may work as well depending upon the board setup (for example, using the on-chip pull-ups).

The pin(s) are specified using a bit-packed byte, where each bit that is set identifies the pin to be accessed, and where bit 0 of the byte represents GPIO port pin 0, bit 1 represents GPIO port pin 1, and so on.

Note
This function cannot be used to turn any pin into an external peripheral interface pin; it only configures an external peripheral interface pin for proper operation. Note that a GPIOPinConfigure() function call is also required to properly configure a pin for the external peripheral interface function.
A subset of GPIO pins on Tiva devices, notably those used by the JTAG/SWD interface and any pin capable of acting as an NMI input, are locked against inadvertent reconfiguration. These pins must be unlocked using direct register writes to the relevant GPIO_O_LOCK and GPIO_O_CR registers before this function can be called. Please see the ``gpio_jtag'' example application for the mechanism required and consult your part datasheet for information on affected pins.
Returns
None.

Definition at line 1237 of file gpio.c.

References ASSERT, GPIO_DIR_MODE_HW, GPIO_PIN_TYPE_STD, GPIO_STRENGTH_8MA, GPIODirModeSet(), and GPIOPadConfigSet().

1238 {
1239  //
1240  // Check the arguments.
1241  //
1242  ASSERT(_GPIOBaseValid(ui32Port));
1243 
1244  //
1245  // Make the pin(s) be peripheral controlled.
1246  //
1247  GPIODirModeSet(ui32Port, ui8Pins, GPIO_DIR_MODE_HW);
1248 
1249  //
1250  // Set the pad(s) for standard push-pull operation.
1251  //
1253 }
#define GPIO_DIR_MODE_HW
Definition: gpio.h:77
#define GPIO_PIN_TYPE_STD
Definition: gpio.h:112
#define ASSERT(expr)
Definition: debug.h:67
void GPIOPadConfigSet(uint32_t ui32Port, uint8_t ui8Pins, uint32_t ui32Strength, uint32_t ui32PinType)
Definition: gpio.c:546
#define GPIO_STRENGTH_8MA
Definition: gpio.h:101
void GPIODirModeSet(uint32_t ui32Port, uint8_t ui8Pins, uint32_t ui32PinIO)
Definition: gpio.c:298

Here is the call graph for this function:

void GPIOPinTypeEthernetLED ( uint32_t  ui32Port,
uint8_t  ui8Pins 
)

Configures pin(s) for use by the Ethernet peripheral as LED signals.

Parameters
ui32Portis the base address of the GPIO port.
ui8Pinsis the bit-packed representation of the pin(s).

The Ethernet peripheral provides four signals that can be used to drive an LED (for example, for link status/activity). This function provides a typical configuration for the pins.

The pin(s) are specified using a bit-packed byte, where each bit that is set identifies the pin to be accessed, and where bit 0 of the byte represents GPIO port pin 0, bit 1 represents GPIO port pin 1, and so on.

Note
This function cannot be used to turn any pin into an Ethernet LED pin; it only configures an Ethernet LED pin for proper operation. Note that a GPIOPinConfigure() function call is also required to properly configure the pin for the Ethernet LED function.
A subset of GPIO pins on Tiva devices, notably those used by the JTAG/SWD interface and any pin capable of acting as an NMI input, are locked against inadvertent reconfiguration. These pins must be unlocked using direct register writes to the relevant GPIO_O_LOCK and GPIO_O_CR registers before this function can be called. Please see the ``gpio_jtag'' example application for the mechanism required and consult your part datasheet for information on affected pins.
Returns
None.

Definition at line 1287 of file gpio.c.

References ASSERT, GPIO_DIR_MODE_HW, GPIO_PIN_TYPE_STD, GPIO_STRENGTH_8MA, GPIODirModeSet(), and GPIOPadConfigSet().

1288 {
1289  //
1290  // Check the arguments.
1291  //
1292  ASSERT(_GPIOBaseValid(ui32Port));
1293 
1294  //
1295  // Make the pin(s) be peripheral controlled.
1296  //
1297  GPIODirModeSet(ui32Port, ui8Pins, GPIO_DIR_MODE_HW);
1298 
1299  //
1300  // Set the pad(s) for standard push-pull operation.
1301  //
1303 }
#define GPIO_DIR_MODE_HW
Definition: gpio.h:77
#define GPIO_PIN_TYPE_STD
Definition: gpio.h:112
#define ASSERT(expr)
Definition: debug.h:67
void GPIOPadConfigSet(uint32_t ui32Port, uint8_t ui8Pins, uint32_t ui32Strength, uint32_t ui32PinType)
Definition: gpio.c:546
#define GPIO_STRENGTH_8MA
Definition: gpio.h:101
void GPIODirModeSet(uint32_t ui32Port, uint8_t ui8Pins, uint32_t ui32PinIO)
Definition: gpio.c:298

Here is the call graph for this function:

void GPIOPinTypeEthernetMII ( uint32_t  ui32Port,
uint8_t  ui8Pins 
)

Configures pin(s) for use by the Ethernet peripheral as MII signals.

Parameters
ui32Portis the base address of the GPIO port.
ui8Pinsis the bit-packed representation of the pin(s).

The Ethernet peripheral on some parts provides a set of MII signals that are used to connect to an external PHY. This function provides a typical configuration for the pins.

The pin(s) are specified using a bit-packed byte, where each bit that is set identifies the pin to be accessed, and where bit 0 of the byte represents GPIO port pin 0, bit 1 represents GPIO port pin 1, and so on.

Note
This function cannot be used to turn any pin into an Ethernet MII pin; it only configures an Ethernet MII pin for proper operation. Note that a GPIOPinConfigure() function call is also required to properly configure the pin for the Ethernet MII function.
A subset of GPIO pins on Tiva devices, notably those used by the JTAG/SWD interface and any pin capable of acting as an NMI input, are locked against inadvertent reconfiguration. These pins must be unlocked using direct register writes to the relevant GPIO_O_LOCK and GPIO_O_CR registers before this function can be called. Please see the ``gpio_jtag'' example application for the mechanism required and consult your part datasheet for information on affected pins.
Returns
None.

Definition at line 1337 of file gpio.c.

References ASSERT, GPIO_DIR_MODE_HW, GPIO_PIN_TYPE_STD, GPIO_STRENGTH_8MA, GPIODirModeSet(), and GPIOPadConfigSet().

1338 {
1339  //
1340  // Check the arguments.
1341  //
1342  ASSERT(_GPIOBaseValid(ui32Port));
1343 
1344  //
1345  // Make the pin(s) be peripheral controlled.
1346  //
1347  GPIODirModeSet(ui32Port, ui8Pins, GPIO_DIR_MODE_HW);
1348 
1349  //
1350  // Set the pad(s) for standard push-pull operation.
1351  //
1353 }
#define GPIO_DIR_MODE_HW
Definition: gpio.h:77
#define GPIO_PIN_TYPE_STD
Definition: gpio.h:112
#define ASSERT(expr)
Definition: debug.h:67
void GPIOPadConfigSet(uint32_t ui32Port, uint8_t ui8Pins, uint32_t ui32Strength, uint32_t ui32PinType)
Definition: gpio.c:546
#define GPIO_STRENGTH_8MA
Definition: gpio.h:101
void GPIODirModeSet(uint32_t ui32Port, uint8_t ui8Pins, uint32_t ui32PinIO)
Definition: gpio.c:298

Here is the call graph for this function:

void GPIOPinTypeGPIOInput ( uint32_t  ui32Port,
uint8_t  ui8Pins 
)

Configures pin(s) for use as GPIO inputs.

Parameters
ui32Portis the base address of the GPIO port.
ui8Pinsis the bit-packed representation of the pin(s).

The GPIO pins must be properly configured in order to function correctly as GPIO inputs. This function provides the proper configuration for those pin(s).

The pin(s) are specified using a bit-packed byte, where each bit that is set identifies the pin to be accessed, and where bit 0 of the byte represents GPIO port pin 0, bit 1 represents GPIO port pin 1, and so on.

Note
A subset of GPIO pins on Tiva devices, notably those used by the JTAG/SWD interface and any pin capable of acting as an NMI input, are locked against inadvertent reconfiguration. These pins must be unlocked using direct register writes to the relevant GPIO_O_LOCK and GPIO_O_CR registers before this function can be called. Please see the ``gpio_jtag'' example application for the mechanism required and consult your part datasheet for information on affected pins.
Returns
None.

Definition at line 1382 of file gpio.c.

References ASSERT, GPIO_DIR_MODE_IN, GPIO_PIN_TYPE_STD, GPIO_STRENGTH_2MA, GPIODirModeSet(), and GPIOPadConfigSet().

1383 {
1384  //
1385  // Check the arguments.
1386  //
1387  ASSERT(_GPIOBaseValid(ui32Port));
1388 
1389  //
1390  // Make the pin(s) be inputs.
1391  //
1392  GPIODirModeSet(ui32Port, ui8Pins, GPIO_DIR_MODE_IN);
1393 
1394  //
1395  // Set the pad(s) for standard push-pull operation.
1396  //
1398 }
#define GPIO_PIN_TYPE_STD
Definition: gpio.h:112
#define ASSERT(expr)
Definition: debug.h:67
void GPIOPadConfigSet(uint32_t ui32Port, uint8_t ui8Pins, uint32_t ui32Strength, uint32_t ui32PinType)
Definition: gpio.c:546
#define GPIO_STRENGTH_2MA
Definition: gpio.h:98
#define GPIO_DIR_MODE_IN
Definition: gpio.h:75
void GPIODirModeSet(uint32_t ui32Port, uint8_t ui8Pins, uint32_t ui32PinIO)
Definition: gpio.c:298

Here is the call graph for this function:

void GPIOPinTypeGPIOOutput ( uint32_t  ui32Port,
uint8_t  ui8Pins 
)

Configures pin(s) for use as GPIO outputs.

Parameters
ui32Portis the base address of the GPIO port.
ui8Pinsis the bit-packed representation of the pin(s).

The GPIO pins must be properly configured in order to function correctly as GPIO outputs. This function provides the proper configuration for those pin(s).

The pin(s) are specified using a bit-packed byte, where each bit that is set identifies the pin to be accessed, and where bit 0 of the byte represents GPIO port pin 0, bit 1 represents GPIO port pin 1, and so on.

Note
A subset of GPIO pins on Tiva devices, notably those used by the JTAG/SWD interface and any pin capable of acting as an NMI input, are locked against inadvertent reconfiguration. These pins must be unlocked using direct register writes to the relevant GPIO_O_LOCK and GPIO_O_CR registers before this function can be called. Please see the ``gpio_jtag'' example application for the mechanism required and consult your part datasheet for information on affected pins.
Returns
None.

Definition at line 1427 of file gpio.c.

References ASSERT, GPIO_DIR_MODE_OUT, GPIO_PIN_TYPE_STD, GPIO_STRENGTH_2MA, GPIODirModeSet(), and GPIOPadConfigSet().

Referenced by heart_init(), and main().

1428 {
1429  //
1430  // Check the arguments.
1431  //
1432  ASSERT(_GPIOBaseValid(ui32Port));
1433 
1434  //
1435  // Set the pad(s) for standard push-pull operation.
1436  //
1438 
1439  //
1440  // Make the pin(s) be outputs.
1441  //
1442  GPIODirModeSet(ui32Port, ui8Pins, GPIO_DIR_MODE_OUT);
1443 }
#define GPIO_PIN_TYPE_STD
Definition: gpio.h:112
#define ASSERT(expr)
Definition: debug.h:67
void GPIOPadConfigSet(uint32_t ui32Port, uint8_t ui8Pins, uint32_t ui32Strength, uint32_t ui32PinType)
Definition: gpio.c:546
#define GPIO_DIR_MODE_OUT
Definition: gpio.h:76
#define GPIO_STRENGTH_2MA
Definition: gpio.h:98
void GPIODirModeSet(uint32_t ui32Port, uint8_t ui8Pins, uint32_t ui32PinIO)
Definition: gpio.c:298

Here is the call graph for this function:

Here is the caller graph for this function:

void GPIOPinTypeGPIOOutputOD ( uint32_t  ui32Port,
uint8_t  ui8Pins 
)

Configures pin(s) for use as GPIO open drain outputs.

Parameters
ui32Portis the base address of the GPIO port.
ui8Pinsis the bit-packed representation of the pin(s).

The GPIO pins must be properly configured in order to function correctly as GPIO outputs. This function provides the proper configuration for those pin(s).

The pin(s) are specified using a bit-packed byte, where each bit that is set identifies the pin to be accessed, and where bit 0 of the byte represents GPIO port pin 0, bit 1 represents GPIO port pin 1, and so on.

Note
A subset of GPIO pins on Tiva devices, notably those used by the JTAG/SWD interface and any pin capable of acting as an NMI input, are locked against inadvertent reconfiguration. These pins must be unlocked using direct register writes to the relevant GPIO_O_LOCK and GPIO_O_CR registers before this function can be called. Please see the ``gpio_jtag'' example application for the mechanism required and consult your part datasheet for information on affected pins.
Returns
None.

Definition at line 1472 of file gpio.c.

References ASSERT, GPIO_DIR_MODE_OUT, GPIO_PIN_TYPE_OD, GPIO_STRENGTH_2MA, GPIODirModeSet(), and GPIOPadConfigSet().

1473 {
1474  //
1475  // Check the arguments.
1476  //
1477  ASSERT(_GPIOBaseValid(ui32Port));
1478 
1479  //
1480  // Set the pad(s) for standard push-pull operation.
1481  //
1483 
1484  //
1485  // Make the pin(s) be outputs.
1486  //
1487  GPIODirModeSet(ui32Port, ui8Pins, GPIO_DIR_MODE_OUT);
1488 }
#define GPIO_PIN_TYPE_OD
Definition: gpio.h:115
#define ASSERT(expr)
Definition: debug.h:67
void GPIOPadConfigSet(uint32_t ui32Port, uint8_t ui8Pins, uint32_t ui32Strength, uint32_t ui32PinType)
Definition: gpio.c:546
#define GPIO_DIR_MODE_OUT
Definition: gpio.h:76
#define GPIO_STRENGTH_2MA
Definition: gpio.h:98
void GPIODirModeSet(uint32_t ui32Port, uint8_t ui8Pins, uint32_t ui32PinIO)
Definition: gpio.c:298

Here is the call graph for this function:

void GPIOPinTypeI2C ( uint32_t  ui32Port,
uint8_t  ui8Pins 
)

Configures pin for use as SDA by the I2C peripheral.

Parameters
ui32Portis the base address of the GPIO port.
ui8Pinsis the bit-packed representation of the pin.

The I2C pins must be properly configured for the I2C peripheral to function correctly. This function provides the proper configuration for the SDA pin.

The pin is specified using a bit-packed byte, where each bit that is set identifies the pin to be accessed, and where bit 0 of the byte represents GPIO port pin 0, bit 1 represents GPIO port pin 1, and so on.

Note
This function cannot be used to turn any pin into an I2C SDA pin; it only configures an I2C SDA pin for proper operation. Note that a GPIOPinConfigure() function call is also required to properly configure a pin for the I2C SDA function.
A subset of GPIO pins on Tiva devices, notably those used by the JTAG/SWD interface and any pin capable of acting as an NMI input, are locked against inadvertent reconfiguration. These pins must be unlocked using direct register writes to the relevant GPIO_O_LOCK and GPIO_O_CR registers before this function can be called. Please see the ``gpio_jtag'' example application for the mechanism required and consult your part datasheet for information on affected pins.
Returns
None.

Definition at line 1522 of file gpio.c.

References ASSERT, GPIO_DIR_MODE_HW, GPIO_PIN_TYPE_OD, GPIO_STRENGTH_2MA, GPIODirModeSet(), and GPIOPadConfigSet().

1523 {
1524  //
1525  // Check the arguments.
1526  //
1527  ASSERT(_GPIOBaseValid(ui32Port));
1528 
1529  //
1530  // Make the pin(s) be peripheral controlled.
1531  //
1532  GPIODirModeSet(ui32Port, ui8Pins, GPIO_DIR_MODE_HW);
1533 
1534  //
1535  // Set the pad(s) for open-drain operation with a weak pull-up.
1536  //
1538 }
#define GPIO_DIR_MODE_HW
Definition: gpio.h:77
#define GPIO_PIN_TYPE_OD
Definition: gpio.h:115
#define ASSERT(expr)
Definition: debug.h:67
void GPIOPadConfigSet(uint32_t ui32Port, uint8_t ui8Pins, uint32_t ui32Strength, uint32_t ui32PinType)
Definition: gpio.c:546
#define GPIO_STRENGTH_2MA
Definition: gpio.h:98
void GPIODirModeSet(uint32_t ui32Port, uint8_t ui8Pins, uint32_t ui32PinIO)
Definition: gpio.c:298

Here is the call graph for this function:

void GPIOPinTypeI2CSCL ( uint32_t  ui32Port,
uint8_t  ui8Pins 
)

Configures pin for use as SCL by the I2C peripheral.

Parameters
ui32Portis the base address of the GPIO port.
ui8Pinsis the bit-packed representation of the pin.

The I2C pins must be properly configured for the I2C peripheral to function correctly. This function provides the proper configuration for the SCL pin.

The pin is specified using a bit-packed byte, where each bit that is set identifies the pin to be accessed, and where bit 0 of the byte represents GPIO port pin 0, bit 1 represents GPIO port pin 1, and so on.

Note
This function cannot be used to turn any pin into an I2C SCL pin; it only configures an I2C SCL pin for proper operation. Note that a GPIOPinConfigure() function call is also required to properly configure a pin for the I2C SCL function.
A subset of GPIO pins on Tiva devices, notably those used by the JTAG/SWD interface and any pin capable of acting as an NMI input, are locked against inadvertent reconfiguration. These pins must be unlocked using direct register writes to the relevant GPIO_O_LOCK and GPIO_O_CR registers before this function can be called. Please see the ``gpio_jtag'' example application for the mechanism required and consult your part datasheet for information on affected pins.
Returns
None.

Definition at line 1572 of file gpio.c.

References ASSERT, GPIO_DIR_MODE_HW, GPIO_PIN_TYPE_STD, GPIO_STRENGTH_2MA, GPIODirModeSet(), and GPIOPadConfigSet().

1573 {
1574  //
1575  // Check the arguments.
1576  //
1577  ASSERT(_GPIOBaseValid(ui32Port));
1578 
1579  //
1580  // Make the pin(s) be peripheral controlled.
1581  //
1582  GPIODirModeSet(ui32Port, ui8Pins, GPIO_DIR_MODE_HW);
1583 
1584  //
1585  // Set the pad(s) for push-pull operation.
1586  //
1588 }
#define GPIO_DIR_MODE_HW
Definition: gpio.h:77
#define GPIO_PIN_TYPE_STD
Definition: gpio.h:112
#define ASSERT(expr)
Definition: debug.h:67
void GPIOPadConfigSet(uint32_t ui32Port, uint8_t ui8Pins, uint32_t ui32Strength, uint32_t ui32PinType)
Definition: gpio.c:546
#define GPIO_STRENGTH_2MA
Definition: gpio.h:98
void GPIODirModeSet(uint32_t ui32Port, uint8_t ui8Pins, uint32_t ui32PinIO)
Definition: gpio.c:298

Here is the call graph for this function:

void GPIOPinTypeKBColumn ( uint32_t  ui32Port,
uint8_t  ui8Pins 
)

Configures pin(s) for use as scan matrix keyboard columns (inputs).

Parameters
ui32Portis the base address of the GPIO port.
ui8Pinsis the bit-packed representation of the pin(s).

The GPIO pins must be properly configured in order to function correctly as scan matrix keyboard inputs. This function provides the proper configuration for those pin(s).

The pin(s) are specified using a bit-packed byte, where each bit that is set identifies the pin to be accessed, and where bit 0 of the byte represents GPIO port pin 0, bit 1 represents GPIO port pin 1, and so on.

Note
This function cannot be used to turn any pin into a scan matrix keyboard column pin; it only configures a scan matrix keyboard column pin for proper operation. Note that a GPIOPinConfigure() function call is also required to properly configure a pin for the scan matrix keyboard function.
A subset of GPIO pins on Tiva devices, notably those used by the JTAG/SWD interface and any pin capable of acting as an NMI input, are locked against inadvertent reconfiguration. These pins must be unlocked using direct register writes to the relevant GPIO_O_LOCK and GPIO_O_CR registers before this function can be called. Please see the ``gpio_jtag'' example application for the mechanism required and consult your part datasheet for information on affected pins.
Returns
None.

Definition at line 2331 of file gpio.c.

References ASSERT, GPIO_DIR_MODE_HW, GPIO_PIN_TYPE_STD_WPU, GPIO_STRENGTH_2MA, GPIODirModeSet(), and GPIOPadConfigSet().

2332 {
2333  //
2334  // Check the arguments.
2335  //
2336  ASSERT(_GPIOBaseValid(ui32Port));
2337 
2338  //
2339  // Make the pin(s) be peripheral controlled.
2340  //
2341  GPIODirModeSet(ui32Port, ui8Pins, GPIO_DIR_MODE_HW);
2342 
2343  //
2344  // Set the pad(s) for standard push-pull operation.
2345  //
2346  GPIOPadConfigSet(ui32Port, ui8Pins, GPIO_STRENGTH_2MA,
2348 }
#define GPIO_DIR_MODE_HW
Definition: gpio.h:77
#define GPIO_PIN_TYPE_STD_WPU
Definition: gpio.h:113
#define ASSERT(expr)
Definition: debug.h:67
void GPIOPadConfigSet(uint32_t ui32Port, uint8_t ui8Pins, uint32_t ui32Strength, uint32_t ui32PinType)
Definition: gpio.c:546
#define GPIO_STRENGTH_2MA
Definition: gpio.h:98
void GPIODirModeSet(uint32_t ui32Port, uint8_t ui8Pins, uint32_t ui32PinIO)
Definition: gpio.c:298

Here is the call graph for this function:

void GPIOPinTypeKBRow ( uint32_t  ui32Port,
uint8_t  ui8Pins 
)

Configures pin(s) for use as scan matrix keyboard rows (outputs).

Parameters
ui32Portis the base address of the GPIO port.
ui8Pinsis the bit-packed representation of the pin(s).

The GPIO pins must be properly configured in order to function correctly as scan matrix keyboard outputs. This function provides the proper configuration for those pin(s).

The pin(s) are specified using a bit-packed byte, where each bit that is set identifies the pin to be accessed, and where bit 0 of the byte represents GPIO port pin 0, bit 1 represents GPIO port pin 1, and so on.

Note
This function cannot be used to turn any pin into a scan matrix keyboard row pin; it only configures a scan matrix keyboard row pin for proper operation. Note that a GPIOPinConfigure() function call is also required to properly configure a pin for the scan matrix keyboard function.
A subset of GPIO pins on Tiva devices, notably those used by the JTAG/SWD interface and any pin capable of acting as an NMI input, are locked against inadvertent reconfiguration. These pins must be unlocked using direct register writes to the relevant GPIO_O_LOCK and GPIO_O_CR registers before this function can be called. Please see the ``gpio_jtag'' example application for the mechanism required and consult your part datasheet for information on affected pins.
Returns
None.

Definition at line 2280 of file gpio.c.

References ASSERT, GPIO_DIR_MODE_HW, GPIO_PIN_TYPE_STD, GPIO_STRENGTH_2MA, GPIODirModeSet(), and GPIOPadConfigSet().

2281 {
2282  //
2283  // Check the arguments.
2284  //
2285  ASSERT(_GPIOBaseValid(ui32Port));
2286 
2287  //
2288  // Make the pin(s) be peripheral controlled.
2289  //
2290  GPIODirModeSet(ui32Port, ui8Pins, GPIO_DIR_MODE_HW);
2291 
2292  //
2293  // Set the pad(s) for push/pull operation.
2294  //
2296 }
#define GPIO_DIR_MODE_HW
Definition: gpio.h:77
#define GPIO_PIN_TYPE_STD
Definition: gpio.h:112
#define ASSERT(expr)
Definition: debug.h:67
void GPIOPadConfigSet(uint32_t ui32Port, uint8_t ui8Pins, uint32_t ui32Strength, uint32_t ui32PinType)
Definition: gpio.c:546
#define GPIO_STRENGTH_2MA
Definition: gpio.h:98
void GPIODirModeSet(uint32_t ui32Port, uint8_t ui8Pins, uint32_t ui32PinIO)
Definition: gpio.c:298

Here is the call graph for this function:

void GPIOPinTypeLCD ( uint32_t  ui32Port,
uint8_t  ui8Pins 
)

Configures pin(s) for use by the LCD Controller.

Parameters
ui32Portis the base address of the GPIO port.
ui8Pinsis the bit-packed representation of the pin(s).

The LCD controller pins must be properly configured for the LCD controller to function correctly. This function provides a typical configuration for those pin(s); other configurations may work as well depending upon the board setup (for example, using the on-chip pull-ups).

The pin(s) are specified using a bit-packed byte, where each bit that is set identifies the pin to be accessed, and where bit 0 of the byte represents GPIO port pin 0, bit 1 represents GPIO port pin 1, and so on.

Note
This function cannot be used to turn any pin into an LCD pin; it only configures an LCD pin for proper operation. Note that a GPIOPinConfigure() function call is also required to properly configure a pin for the LCD controller function.
A subset of GPIO pins on Tiva devices, notably those used by the JTAG/SWD interface and any pin capable of acting as an NMI input, are locked against inadvertent reconfiguration. These pins must be unlocked using direct register writes to the relevant GPIO_O_LOCK and GPIO_O_CR registers before this function can be called. Please see the ``gpio_jtag'' example application for the mechanism required and consult your part datasheet for information on affected pins.
Returns
None.

Definition at line 1623 of file gpio.c.

References ASSERT, GPIO_DIR_MODE_HW, GPIO_PIN_TYPE_STD, GPIO_STRENGTH_8MA, GPIODirModeSet(), and GPIOPadConfigSet().

1624 {
1625  //
1626  // Check the arguments.
1627  //
1628  ASSERT(_GPIOBaseValid(ui32Port));
1629 
1630  //
1631  // Make the pin(s) be peripheral controlled.
1632  //
1633  GPIODirModeSet(ui32Port, ui8Pins, GPIO_DIR_MODE_HW);
1634 
1635  //
1636  // Set the pad(s) for standard push-pull operation and beefed up drive.
1637  //
1639 }
#define GPIO_DIR_MODE_HW
Definition: gpio.h:77
#define GPIO_PIN_TYPE_STD
Definition: gpio.h:112
#define ASSERT(expr)
Definition: debug.h:67
void GPIOPadConfigSet(uint32_t ui32Port, uint8_t ui8Pins, uint32_t ui32Strength, uint32_t ui32PinType)
Definition: gpio.c:546
#define GPIO_STRENGTH_8MA
Definition: gpio.h:101
void GPIODirModeSet(uint32_t ui32Port, uint8_t ui8Pins, uint32_t ui32PinIO)
Definition: gpio.c:298

Here is the call graph for this function:

void GPIOPinTypeLEDSeq ( uint32_t  ui32Port,
uint8_t  ui8Pins 
)

Configures pin(s) for use as an LED sequencer output.

Parameters
ui32Portis the base address of the GPIO port.
ui8Pinsis the bit-packed representation of the pin(s).

The GPIO pins must be properly configured in order to function correctly as LED sequencers. This function provides the proper configuration for those pin(s).

The pin(s) are specified using a bit-packed byte, where each bit that is set identifies the pin to be accessed, and where bit 0 of the byte represents GPIO port pin 0, bit 1 represents GPIO port pin 1, and so on.

Note
This function cannot be used to turn any pin into an LED sequencer output pin; it only configures an LED sequencer output pin for proper operation. Note that a GPIOPinConfigure() function call is also required to properly configure a pin for the LED sequencer function.
A subset of GPIO pins on Tiva devices, notably those used by the JTAG/SWD interface and any pin capable of acting as an NMI input, are locked against inadvertent reconfiguration. These pins must be unlocked using direct register writes to the relevant GPIO_O_LOCK and GPIO_O_CR registers before this function can be called. Please see the ``gpio_jtag'' example application for the mechanism required and consult your part datasheet for information on affected pins.
Returns
None.

Definition at line 2382 of file gpio.c.

References ASSERT, GPIO_DIR_MODE_HW, GPIO_PIN_TYPE_STD, GPIO_STRENGTH_8MA, GPIODirModeSet(), and GPIOPadConfigSet().

2383 {
2384  //
2385  // Check the arguments.
2386  //
2387  ASSERT(_GPIOBaseValid(ui32Port));
2388 
2389  //
2390  // Make the pin(s) be peripheral controlled.
2391  //
2392  GPIODirModeSet(ui32Port, ui8Pins, GPIO_DIR_MODE_HW);
2393 
2394  //
2395  // Set the pad(s) for push/pull operation and 8mA strength. The external
2396  // hardware should be set up such that we sink current when the LED is
2397  // turned on, hence the 8mA configuration choice.
2398  //
2400 }
#define GPIO_DIR_MODE_HW
Definition: gpio.h:77
#define GPIO_PIN_TYPE_STD
Definition: gpio.h:112
#define ASSERT(expr)
Definition: debug.h:67
void GPIOPadConfigSet(uint32_t ui32Port, uint8_t ui8Pins, uint32_t ui32Strength, uint32_t ui32PinType)
Definition: gpio.c:546
#define GPIO_STRENGTH_8MA
Definition: gpio.h:101
void GPIODirModeSet(uint32_t ui32Port, uint8_t ui8Pins, uint32_t ui32PinIO)
Definition: gpio.c:298

Here is the call graph for this function:

void GPIOPinTypeLPC ( uint32_t  ui32Port,
uint8_t  ui8Pins 
)

Configures pin(s) for use by the LPC module.

Parameters
ui32Portis the base address of the GPIO port.
ui8Pinsis the bit-packed representation of the pin(s).

The LPC pins must be properly configured for the LPC module to function correctly. This function provides a typical configuration for those pin(s); other configurations may work as well depending upon the board setup (for example, using the on-chip pull-ups).

The pin(s) are specified using a bit-packed byte, where each bit that is set identifies the pin to be accessed, and where bit 0 of the byte represents GPIO port pin 0, bit 1 represents GPIO port pin 1, and so on.

Note
This function cannot be used to turn any pin into an LPC pin; it only configures an LPC pin for proper operation. Note that a GPIOPinConfigure() function call is also required to properly configure a pin for the LPC function.
A subset of GPIO pins on Tiva devices, notably those used by the JTAG/SWD interface and any pin capable of acting as an NMI input, are locked against inadvertent reconfiguration. These pins must be unlocked using direct register writes to the relevant GPIO_O_LOCK and GPIO_O_CR registers before this function can be called. Please see the ``gpio_jtag'' example application for the mechanism required and consult your part datasheet for information on affected pins.
Returns
None.

Definition at line 1674 of file gpio.c.

References ASSERT, GPIO_DIR_MODE_HW, GPIO_PIN_TYPE_STD, GPIO_STRENGTH_8MA, GPIODirModeSet(), and GPIOPadConfigSet().

1675 {
1676  //
1677  // Check the arguments.
1678  //
1679  ASSERT(_GPIOBaseValid(ui32Port));
1680 
1681  //
1682  // Make the pin(s) be peripheral controlled.
1683  //
1684  GPIODirModeSet(ui32Port, ui8Pins, GPIO_DIR_MODE_HW);
1685 
1686  //
1687  // Set the pad(s) for standard push-pull operation.
1688  //
1690 }
#define GPIO_DIR_MODE_HW
Definition: gpio.h:77
#define GPIO_PIN_TYPE_STD
Definition: gpio.h:112
#define ASSERT(expr)
Definition: debug.h:67
void GPIOPadConfigSet(uint32_t ui32Port, uint8_t ui8Pins, uint32_t ui32Strength, uint32_t ui32PinType)
Definition: gpio.c:546
#define GPIO_STRENGTH_8MA
Definition: gpio.h:101
void GPIODirModeSet(uint32_t ui32Port, uint8_t ui8Pins, uint32_t ui32PinIO)
Definition: gpio.c:298

Here is the call graph for this function:

void GPIOPinTypePECIRx ( uint32_t  ui32Port,
uint8_t  ui8Pins 
)

Configures a pin for receive use by the PECI module.

Parameters
ui32Portis the base address of the GPIO port.
ui8Pinsis the bit-packed representation of the pin(s).

The PECI receive pin must be properly configured for the PECI module to function correctly. This function provides a typical configuration for that pin.

The pin is specified using a bit-packed byte, where each bit that is set identifies the pin to be accessed, and where bit 0 of the byte represents GPIO port pin 0, bit 1 represents GPIO port pin 1, and so on.

Note
This function cannot be used to turn any pin into a PECI receive pin; it only configures a PECI receive pin for proper operation. Note that a GPIOPinConfigure() function call is also required to properly configure a pin for the PECI receive function.
A subset of GPIO pins on Tiva devices, notably those used by the JTAG/SWD interface and any pin capable of acting as an NMI input, are locked against inadvertent reconfiguration. These pins must be unlocked using direct register writes to the relevant GPIO_O_LOCK and GPIO_O_CR registers before this function can be called. Please see the ``gpio_jtag'' example application for the mechanism required and consult your part datasheet for information on affected pins.
Returns
None.

Definition at line 1724 of file gpio.c.

References ASSERT, GPIO_DIR_MODE_IN, GPIO_PIN_TYPE_ANALOG, GPIO_STRENGTH_2MA, GPIODirModeSet(), and GPIOPadConfigSet().

1725 {
1726  //
1727  // Check the arguments.
1728  //
1729  ASSERT(_GPIOBaseValid(ui32Port));
1730 
1731  //
1732  // Make the pin(s) be inputs.
1733  //
1734  GPIODirModeSet(ui32Port, ui8Pins, GPIO_DIR_MODE_IN);
1735 
1736  //
1737  // Set the pad(s) for analog operation.
1738  //
1739  GPIOPadConfigSet(ui32Port, ui8Pins, GPIO_STRENGTH_2MA,
1741 }
#define ASSERT(expr)
Definition: debug.h:67
void GPIOPadConfigSet(uint32_t ui32Port, uint8_t ui8Pins, uint32_t ui32Strength, uint32_t ui32PinType)
Definition: gpio.c:546
#define GPIO_STRENGTH_2MA
Definition: gpio.h:98
#define GPIO_DIR_MODE_IN
Definition: gpio.h:75
void GPIODirModeSet(uint32_t ui32Port, uint8_t ui8Pins, uint32_t ui32PinIO)
Definition: gpio.c:298
#define GPIO_PIN_TYPE_ANALOG
Definition: gpio.h:116

Here is the call graph for this function:

void GPIOPinTypePECITx ( uint32_t  ui32Port,
uint8_t  ui8Pins 
)

Configures a pin for transmit use by the PECI module.

Parameters
ui32Portis the base address of the GPIO port.
ui8Pinsis the bit-packed representation of the pin(s).

The PECI transmit pin must be properly configured for the PECI module to function correctly. This function provides a typical configuration for that pin.

The pin is specified using a bit-packed byte, where each bit that is set identifies the pin to be accessed, and where bit 0 of the byte represents GPIO port pin 0, bit 1 represents GPIO port pin 1, and so on.

Note
This function cannot be used to turn any pin into a PECI transmit pin; it only configures a PECI transmit pin for proper operation. Note that a GPIOPinConfigure() function call is also required to properly configure the pin for the PECI transmit function.
A subset of GPIO pins on Tiva devices, notably those used by the JTAG/SWD interface and any pin capable of acting as an NMI input, are locked against inadvertent reconfiguration. These pins must be unlocked using direct register writes to the relevant GPIO_O_LOCK and GPIO_O_CR registers before this function can be called. Please see the ``gpio_jtag'' example application for the mechanism required and consult your part datasheet for information on affected pins.
Returns
None.

Definition at line 1775 of file gpio.c.

References ASSERT, GPIO_DIR_MODE_HW, GPIO_PIN_TYPE_STD, GPIO_STRENGTH_2MA, GPIODirModeSet(), and GPIOPadConfigSet().

1776 {
1777  //
1778  // Check the arguments.
1779  //
1780  ASSERT(_GPIOBaseValid(ui32Port));
1781 
1782  //
1783  // Make the pin(s) be inputs.
1784  //
1785  GPIODirModeSet(ui32Port, ui8Pins, GPIO_DIR_MODE_HW);
1786 
1787  //
1788  // Set the pad(s) for analog operation.
1789  //
1791 }
#define GPIO_DIR_MODE_HW
Definition: gpio.h:77
#define GPIO_PIN_TYPE_STD
Definition: gpio.h:112
#define ASSERT(expr)
Definition: debug.h:67
void GPIOPadConfigSet(uint32_t ui32Port, uint8_t ui8Pins, uint32_t ui32Strength, uint32_t ui32PinType)
Definition: gpio.c:546
#define GPIO_STRENGTH_2MA
Definition: gpio.h:98
void GPIODirModeSet(uint32_t ui32Port, uint8_t ui8Pins, uint32_t ui32PinIO)
Definition: gpio.c:298

Here is the call graph for this function:

void GPIOPinTypePWM ( uint32_t  ui32Port,
uint8_t  ui8Pins 
)

Configures pin(s) for use by the PWM peripheral.

Parameters
ui32Portis the base address of the GPIO port.
ui8Pinsis the bit-packed representation of the pin(s).

The PWM pins must be properly configured for the PWM peripheral to function correctly. This function provides a typical configuration for those pin(s); other configurations may work as well depending upon the board setup (for example, using the on-chip pull-ups).

The pin(s) are specified using a bit-packed byte, where each bit that is set identifies the pin to be accessed, and where bit 0 of the byte represents GPIO port pin 0, bit 1 represents GPIO port pin 1, and so on.

Note
This function cannot be used to turn any pin into a PWM pin; it only configures a PWM pin for proper operation. Note that a GPIOPinConfigure() function call is also required to properly configure a pin for the PWM function.
A subset of GPIO pins on Tiva devices, notably those used by the JTAG/SWD interface and any pin capable of acting as an NMI input, are locked against inadvertent reconfiguration. These pins must be unlocked using direct register writes to the relevant GPIO_O_LOCK and GPIO_O_CR registers before this function can be called. Please see the ``gpio_jtag'' example application for the mechanism required and consult your part datasheet for information on affected pins.
Returns
None.

Definition at line 1826 of file gpio.c.

References ASSERT, GPIO_DIR_MODE_HW, GPIO_PIN_TYPE_STD, GPIO_STRENGTH_2MA, GPIODirModeSet(), and GPIOPadConfigSet().

1827 {
1828  //
1829  // Check the arguments.
1830  //
1831  ASSERT(_GPIOBaseValid(ui32Port));
1832 
1833  //
1834  // Make the pin(s) be peripheral controlled.
1835  //
1836  GPIODirModeSet(ui32Port, ui8Pins, GPIO_DIR_MODE_HW);
1837 
1838  //
1839  // Set the pad(s) for standard push-pull operation.
1840  //
1842 }
#define GPIO_DIR_MODE_HW
Definition: gpio.h:77
#define GPIO_PIN_TYPE_STD
Definition: gpio.h:112
#define ASSERT(expr)
Definition: debug.h:67
void GPIOPadConfigSet(uint32_t ui32Port, uint8_t ui8Pins, uint32_t ui32Strength, uint32_t ui32PinType)
Definition: gpio.c:546
#define GPIO_STRENGTH_2MA
Definition: gpio.h:98
void GPIODirModeSet(uint32_t ui32Port, uint8_t ui8Pins, uint32_t ui32PinIO)
Definition: gpio.c:298

Here is the call graph for this function:

void GPIOPinTypeQEI ( uint32_t  ui32Port,
uint8_t  ui8Pins 
)

Configures pin(s) for use by the QEI peripheral.

Parameters
ui32Portis the base address of the GPIO port.
ui8Pinsis the bit-packed representation of the pin(s).

The QEI pins must be properly configured for the QEI peripheral to function correctly. This function provides a typical configuration for those pin(s); other configurations may work as well depending upon the board setup (for example, not using the on-chip pull-ups).

The pin(s) are specified using a bit-packed byte, where each bit that is set identifies the pin to be accessed, and where bit 0 of the byte represents GPIO port pin 0, bit 1 represents GPIO port pin 1, and so on.

Note
This function cannot be used to turn any pin into a QEI pin; it only configures a QEI pin for proper operation. Note that a GPIOPinConfigure() function call is also required to properly configure a pin for the QEI function.
A subset of GPIO pins on Tiva devices, notably those used by the JTAG/SWD interface and any pin capable of acting as an NMI input, are locked against inadvertent reconfiguration. These pins must be unlocked using direct register writes to the relevant GPIO_O_LOCK and GPIO_O_CR registers before this function can be called. Please see the ``gpio_jtag'' example application for the mechanism required and consult your part datasheet for information on affected pins.
Returns
None.

Definition at line 1877 of file gpio.c.

References ASSERT, GPIO_DIR_MODE_HW, GPIO_PIN_TYPE_STD_WPU, GPIO_STRENGTH_2MA, GPIODirModeSet(), and GPIOPadConfigSet().

1878 {
1879  //
1880  // Check the arguments.
1881  //
1882  ASSERT(_GPIOBaseValid(ui32Port));
1883 
1884  //
1885  // Make the pin(s) be peripheral controlled.
1886  //
1887  GPIODirModeSet(ui32Port, ui8Pins, GPIO_DIR_MODE_HW);
1888 
1889  //
1890  // Set the pad(s) for standard push-pull operation with a weak pull-up.
1891  //
1892  GPIOPadConfigSet(ui32Port, ui8Pins, GPIO_STRENGTH_2MA,
1894 }
#define GPIO_DIR_MODE_HW
Definition: gpio.h:77
#define GPIO_PIN_TYPE_STD_WPU
Definition: gpio.h:113
#define ASSERT(expr)
Definition: debug.h:67
void GPIOPadConfigSet(uint32_t ui32Port, uint8_t ui8Pins, uint32_t ui32Strength, uint32_t ui32PinType)
Definition: gpio.c:546
#define GPIO_STRENGTH_2MA
Definition: gpio.h:98
void GPIODirModeSet(uint32_t ui32Port, uint8_t ui8Pins, uint32_t ui32PinIO)
Definition: gpio.c:298

Here is the call graph for this function:

void GPIOPinTypeSSI ( uint32_t  ui32Port,
uint8_t  ui8Pins 
)

Configures pin(s) for use by the SSI peripheral.

Parameters
ui32Portis the base address of the GPIO port.
ui8Pinsis the bit-packed representation of the pin(s).

The SSI pins must be properly configured for the SSI peripheral to function correctly. This function provides a typical configuration for those pin(s); other configurations may work as well depending upon the board setup (for example, using the on-chip pull-ups).

The pin(s) are specified using a bit-packed byte, where each bit that is set identifies the pin to be accessed, and where bit 0 of the byte represents GPIO port pin 0, bit 1 represents GPIO port pin 1, and so on.

Note
This function cannot be used to turn any pin into a SSI pin; it only configures a SSI pin for proper operation. Note that a GPIOPinConfigure() function call is also required to properly configure a pin for the SSI function.
A subset of GPIO pins on Tiva devices, notably those used by the JTAG/SWD interface and any pin capable of acting as an NMI input, are locked against inadvertent reconfiguration. These pins must be unlocked using direct register writes to the relevant GPIO_O_LOCK and GPIO_O_CR registers before this function can be called. Please see the ``gpio_jtag'' example application for the mechanism required and consult your part datasheet for information on affected pins.
Returns
None.

Definition at line 1929 of file gpio.c.

References ASSERT, GPIO_DIR_MODE_HW, GPIO_PIN_TYPE_STD, GPIO_STRENGTH_2MA, GPIODirModeSet(), and GPIOPadConfigSet().

1930 {
1931  //
1932  // Check the arguments.
1933  //
1934  ASSERT(_GPIOBaseValid(ui32Port));
1935 
1936  //
1937  // Make the pin(s) be peripheral controlled.
1938  //
1939  GPIODirModeSet(ui32Port, ui8Pins, GPIO_DIR_MODE_HW);
1940 
1941  //
1942  // Set the pad(s) for standard push-pull operation.
1943  //
1945 }
#define GPIO_DIR_MODE_HW
Definition: gpio.h:77
#define GPIO_PIN_TYPE_STD
Definition: gpio.h:112
#define ASSERT(expr)
Definition: debug.h:67
void GPIOPadConfigSet(uint32_t ui32Port, uint8_t ui8Pins, uint32_t ui32Strength, uint32_t ui32PinType)
Definition: gpio.c:546
#define GPIO_STRENGTH_2MA
Definition: gpio.h:98
void GPIODirModeSet(uint32_t ui32Port, uint8_t ui8Pins, uint32_t ui32PinIO)
Definition: gpio.c:298

Here is the call graph for this function:

void GPIOPinTypeTimer ( uint32_t  ui32Port,
uint8_t  ui8Pins 
)

Configures pin(s) for use by the Timer peripheral.

Parameters
ui32Portis the base address of the GPIO port.
ui8Pinsis the bit-packed representation of the pin(s).

The CCP pins must be properly configured for the timer peripheral to function correctly. This function provides a typical configuration for those pin(s); other configurations may work as well depending upon the board setup (for example, using the on-chip pull-ups).

The pin(s) are specified using a bit-packed byte, where each bit that is set identifies the pin to be accessed, and where bit 0 of the byte represents GPIO port pin 0, bit 1 represents GPIO port pin 1, and so on.

Note
This function cannot be used to turn any pin into a timer pin; it only configures a timer pin for proper operation. Note that a GPIOPinConfigure() function call is also required to properly configure a pin for the CCP function.
A subset of GPIO pins on Tiva devices, notably those used by the JTAG/SWD interface and any pin capable of acting as an NMI input, are locked against inadvertent reconfiguration. These pins must be unlocked using direct register writes to the relevant GPIO_O_LOCK and GPIO_O_CR registers before this function can be called. Please see the ``gpio_jtag'' example application for the mechanism required and consult your part datasheet for information on affected pins.
Returns
None.

Definition at line 1980 of file gpio.c.

References ASSERT, GPIO_DIR_MODE_HW, GPIO_PIN_TYPE_STD, GPIO_STRENGTH_2MA, GPIODirModeSet(), and GPIOPadConfigSet().

1981 {
1982  //
1983  // Check the arguments.
1984  //
1985  ASSERT(_GPIOBaseValid(ui32Port));
1986 
1987  //
1988  // Make the pin(s) be peripheral controlled.
1989  //
1990  GPIODirModeSet(ui32Port, ui8Pins, GPIO_DIR_MODE_HW);
1991 
1992  //
1993  // Set the pad(s) for standard push-pull operation.
1994  //
1996 }
#define GPIO_DIR_MODE_HW
Definition: gpio.h:77
#define GPIO_PIN_TYPE_STD
Definition: gpio.h:112
#define ASSERT(expr)
Definition: debug.h:67
void GPIOPadConfigSet(uint32_t ui32Port, uint8_t ui8Pins, uint32_t ui32Strength, uint32_t ui32PinType)
Definition: gpio.c:546
#define GPIO_STRENGTH_2MA
Definition: gpio.h:98
void GPIODirModeSet(uint32_t ui32Port, uint8_t ui8Pins, uint32_t ui32PinIO)
Definition: gpio.c:298

Here is the call graph for this function:

void GPIOPinTypeUART ( uint32_t  ui32Port,
uint8_t  ui8Pins 
)

Configures pin(s) for use by the UART peripheral.

Parameters
ui32Portis the base address of the GPIO port.
ui8Pinsis the bit-packed representation of the pin(s).

The UART pins must be properly configured for the UART peripheral to function correctly. This function provides a typical configuration for those pin(s); other configurations may work as well depending upon the board setup (for example, using the on-chip pull-ups).

The pin(s) are specified using a bit-packed byte, where each bit that is set identifies the pin to be accessed, and where bit 0 of the byte represents GPIO port pin 0, bit 1 represents GPIO port pin 1, and so on.

Note
This function cannot be used to turn any pin into a UART pin; it only configures a UART pin for proper operation. Note that a GPIOPinConfigure() function call is also required to properly configure a pin for the UART function.
A subset of GPIO pins on Tiva devices, notably those used by the JTAG/SWD interface and any pin capable of acting as an NMI input, are locked against inadvertent reconfiguration. These pins must be unlocked using direct register writes to the relevant GPIO_O_LOCK and GPIO_O_CR registers before this function can be called. Please see the ``gpio_jtag'' example application for the mechanism required and consult your part datasheet for information on affected pins.
Returns
None.

Definition at line 2031 of file gpio.c.

References ASSERT, GPIO_DIR_MODE_HW, GPIO_PIN_TYPE_STD, GPIO_STRENGTH_2MA, GPIODirModeSet(), and GPIOPadConfigSet().

Referenced by main(), and uart_init().

2032 {
2033  //
2034  // Check the arguments.
2035  //
2036  ASSERT(_GPIOBaseValid(ui32Port));
2037 
2038  //
2039  // Make the pin(s) be peripheral controlled.
2040  //
2041  GPIODirModeSet(ui32Port, ui8Pins, GPIO_DIR_MODE_HW);
2042 
2043  //
2044  // Set the pad(s) for standard push-pull operation.
2045  //
2047 }
#define GPIO_DIR_MODE_HW
Definition: gpio.h:77
#define GPIO_PIN_TYPE_STD
Definition: gpio.h:112
#define ASSERT(expr)
Definition: debug.h:67
void GPIOPadConfigSet(uint32_t ui32Port, uint8_t ui8Pins, uint32_t ui32Strength, uint32_t ui32PinType)
Definition: gpio.c:546
#define GPIO_STRENGTH_2MA
Definition: gpio.h:98
void GPIODirModeSet(uint32_t ui32Port, uint8_t ui8Pins, uint32_t ui32PinIO)
Definition: gpio.c:298

Here is the call graph for this function:

Here is the caller graph for this function:

void GPIOPinTypeUSBAnalog ( uint32_t  ui32Port,
uint8_t  ui8Pins 
)

Configures pin(s) for use by the USB peripheral.

Parameters
ui32Portis the base address of the GPIO port.
ui8Pinsis the bit-packed representation of the pin(s).

USB analog pins must be properly configured for the USB peripheral to function correctly. This function provides the proper configuration for any USB analog pin(s).

The pin(s) are specified using a bit-packed byte, where each bit that is set identifies the pin to be accessed, and where bit 0 of the byte represents GPIO port pin 0, bit 1 represents GPIO port pin 1, and so on.

Note
This function cannot be used to turn any pin into a USB pin; it only configures a USB pin for proper operation. Note that a GPIOPinConfigure() function call is also required to properly configure a pin for the USB function.
A subset of GPIO pins on Tiva devices, notably those used by the JTAG/SWD interface and any pin capable of acting as an NMI input, are locked against inadvertent reconfiguration. These pins must be unlocked using direct register writes to the relevant GPIO_O_LOCK and GPIO_O_CR registers before this function can be called. Please see the ``gpio_jtag'' example application for the mechanism required and consult your part datasheet for information on affected pins.
Returns
None.

Definition at line 2081 of file gpio.c.

References ASSERT, GPIO_DIR_MODE_IN, GPIO_PIN_TYPE_ANALOG, GPIO_STRENGTH_2MA, GPIODirModeSet(), and GPIOPadConfigSet().

2082 {
2083  //
2084  // Check the arguments.
2085  //
2086  ASSERT(_GPIOBaseValid(ui32Port));
2087 
2088  //
2089  // Make the pin(s) be inputs.
2090  //
2091  GPIODirModeSet(ui32Port, ui8Pins, GPIO_DIR_MODE_IN);
2092 
2093  //
2094  // Set the pad(s) for analog operation.
2095  //
2096  GPIOPadConfigSet(ui32Port, ui8Pins, GPIO_STRENGTH_2MA,
2098 }
#define ASSERT(expr)
Definition: debug.h:67
void GPIOPadConfigSet(uint32_t ui32Port, uint8_t ui8Pins, uint32_t ui32Strength, uint32_t ui32PinType)
Definition: gpio.c:546
#define GPIO_STRENGTH_2MA
Definition: gpio.h:98
#define GPIO_DIR_MODE_IN
Definition: gpio.h:75
void GPIODirModeSet(uint32_t ui32Port, uint8_t ui8Pins, uint32_t ui32PinIO)
Definition: gpio.c:298
#define GPIO_PIN_TYPE_ANALOG
Definition: gpio.h:116

Here is the call graph for this function:

void GPIOPinTypeUSBDigital ( uint32_t  ui32Port,
uint8_t  ui8Pins 
)

Configures pin(s) for use by the USB peripheral.

Parameters
ui32Portis the base address of the GPIO port.
ui8Pinsis the bit-packed representation of the pin(s).

USB digital pins must be properly configured for the USB peripheral to function correctly. This function provides a typical configuration for the digital USB pin(s); other configurations may work as well depending upon the board setup (for example, using the on-chip pull-ups).

This function should only be used with EPEN and PFAULT pins as all other USB pins are analog in nature or are not used in devices without OTG functionality.

The pin(s) are specified using a bit-packed byte, where each bit that is set identifies the pin to be accessed, and where bit 0 of the byte represents GPIO port pin 0, bit 1 represents GPIO port pin 1, and so on.

Note
This function cannot be used to turn any pin into a USB pin; it only configures a USB pin for proper operation. Note that a GPIOPinConfigure() function call is also required to properly configure a pin for the USB function.
A subset of GPIO pins on Tiva devices, notably those used by the JTAG/SWD interface and any pin capable of acting as an NMI input, are locked against inadvertent reconfiguration. These pins must be unlocked using direct register writes to the relevant GPIO_O_LOCK and GPIO_O_CR registers before this function can be called. Please see the ``gpio_jtag'' example application for the mechanism required and consult your part datasheet for information on affected pins.
Returns
None.

Definition at line 2137 of file gpio.c.

References ASSERT, GPIO_DIR_MODE_HW, GPIO_PIN_TYPE_STD, GPIO_STRENGTH_2MA, GPIODirModeSet(), and GPIOPadConfigSet().

2138 {
2139  //
2140  // Check the arguments.
2141  //
2142  ASSERT(_GPIOBaseValid(ui32Port));
2143 
2144  //
2145  // Make the pin(s) be peripheral controlled.
2146  //
2147  GPIODirModeSet(ui32Port, ui8Pins, GPIO_DIR_MODE_HW);
2148 
2149  //
2150  // Set the pad(s) for standard push-pull operation.
2151  //
2153 }
#define GPIO_DIR_MODE_HW
Definition: gpio.h:77
#define GPIO_PIN_TYPE_STD
Definition: gpio.h:112
#define ASSERT(expr)
Definition: debug.h:67
void GPIOPadConfigSet(uint32_t ui32Port, uint8_t ui8Pins, uint32_t ui32Strength, uint32_t ui32PinType)
Definition: gpio.c:546
#define GPIO_STRENGTH_2MA
Definition: gpio.h:98
void GPIODirModeSet(uint32_t ui32Port, uint8_t ui8Pins, uint32_t ui32PinIO)
Definition: gpio.c:298

Here is the call graph for this function:

void GPIOPinTypeWakeHigh ( uint32_t  ui32Port,
uint8_t  ui8Pins 
)

Configures pin(s) for use as a hibernate wake-on-high source.

Parameters
ui32Portis the base address of the GPIO port.
ui8Pinsis the bit-packed representation of the pin(s).

The GPIO pins must be properly configured in order to function correctly as hibernate wake-high inputs. This function provides the proper configuration for those pin(s).

The pin(s) are specified using a bit-packed byte, where each bit that is set identifies the pin to be accessed, and where bit 0 of the byte represents GPIO port pin 0, bit 1 represents GPIO port pin 1, and so on.

Note
A subset of GPIO pins on Tiva devices, notably those used by the JTAG/SWD interface and any pin capable of acting as an NMI input, are locked against inadvertent reconfiguration. These pins must be unlocked using direct register writes to the relevant GPIO_O_LOCK and GPIO_O_CR registers before this function can be called. Please see the ``gpio_jtag'' example application for the mechanism required and consult your part datasheet for information on affected pins.
Returns
None.

Definition at line 2182 of file gpio.c.

References ASSERT, GPIO_DIR_MODE_IN, GPIO_PIN_TYPE_WAKE_HIGH, GPIO_STRENGTH_2MA, GPIODirModeSet(), and GPIOPadConfigSet().

2183 {
2184  //
2185  // Check the arguments.
2186  //
2187  ASSERT(_GPIOBaseValid(ui32Port));
2188 
2189  //
2190  // Make the pin(s) inputs.
2191  //
2192  GPIODirModeSet(ui32Port, ui8Pins, GPIO_DIR_MODE_IN);
2193 
2194  //
2195  // Set the pad(s) for wake-high operation.
2196  //
2197  GPIOPadConfigSet(ui32Port, ui8Pins, GPIO_STRENGTH_2MA,
2199 }
#define ASSERT(expr)
Definition: debug.h:67
void GPIOPadConfigSet(uint32_t ui32Port, uint8_t ui8Pins, uint32_t ui32Strength, uint32_t ui32PinType)
Definition: gpio.c:546
#define GPIO_PIN_TYPE_WAKE_HIGH
Definition: gpio.h:117
#define GPIO_STRENGTH_2MA
Definition: gpio.h:98
#define GPIO_DIR_MODE_IN
Definition: gpio.h:75
void GPIODirModeSet(uint32_t ui32Port, uint8_t ui8Pins, uint32_t ui32PinIO)
Definition: gpio.c:298

Here is the call graph for this function:

void GPIOPinTypeWakeLow ( uint32_t  ui32Port,
uint8_t  ui8Pins 
)

Configures pin(s) for use as a hibernate wake-on-low source.

Parameters
ui32Portis the base address of the GPIO port.
ui8Pinsis the bit-packed representation of the pin(s).

The GPIO pins must be properly configured in order to function correctly as hibernate wake-low inputs. This function provides the proper configuration for those pin(s).

The pin(s) are specified using a bit-packed byte, where each bit that is set identifies the pin to be accessed, and where bit 0 of the byte represents GPIO port pin 0, bit 1 represents GPIO port pin 1, and so on.

Note
A subset of GPIO pins on Tiva devices, notably those used by the JTAG/SWD interface and any pin capable of acting as an NMI input, are locked against inadvertent reconfiguration. These pins must be unlocked using direct register writes to the relevant GPIO_O_LOCK and GPIO_O_CR registers before this function can be called. Please see the ``gpio_jtag'' example application for the mechanism required and consult your part datasheet for information on affected pins.
Returns
None.

Definition at line 2228 of file gpio.c.

References ASSERT, GPIO_DIR_MODE_IN, GPIO_PIN_TYPE_WAKE_LOW, GPIO_STRENGTH_2MA, GPIODirModeSet(), and GPIOPadConfigSet().

2229 {
2230  //
2231  // Check the arguments.
2232  //
2233  ASSERT(_GPIOBaseValid(ui32Port));
2234 
2235  //
2236  // Make the pin(s) inputs.
2237  //
2238  GPIODirModeSet(ui32Port, ui8Pins, GPIO_DIR_MODE_IN);
2239 
2240  //
2241  // Set the pad(s) for wake-high operation.
2242  //
2243  GPIOPadConfigSet(ui32Port, ui8Pins, GPIO_STRENGTH_2MA,
2245 }
#define ASSERT(expr)
Definition: debug.h:67
void GPIOPadConfigSet(uint32_t ui32Port, uint8_t ui8Pins, uint32_t ui32Strength, uint32_t ui32PinType)
Definition: gpio.c:546
#define GPIO_PIN_TYPE_WAKE_LOW
Definition: gpio.h:118
#define GPIO_STRENGTH_2MA
Definition: gpio.h:98
#define GPIO_DIR_MODE_IN
Definition: gpio.h:75
void GPIODirModeSet(uint32_t ui32Port, uint8_t ui8Pins, uint32_t ui32PinIO)
Definition: gpio.c:298

Here is the call graph for this function:

uint32_t GPIOPinWakeStatus ( uint32_t  ui32Port)

Retrieves the wake pins status.

Parameters
ui32Portis the base address of the GPIO port.

This function returns the GPIO wake pin status values. The returned bitfield shows low or high pin state via a value of 0 or 1.

Note
This function is not available on all devices, consult the data sheet to ensure that the device you are using supports GPIO wake pins.
A subset of GPIO pins on Tiva devices, notably those used by the JTAG/SWD interface and any pin capable of acting as an NMI input, are locked against inadvertent reconfiguration. These pins must be unlocked using direct register writes to the relevant GPIO_O_LOCK and GPIO_O_CR registers before this function can be called. Please see the ``gpio_jtag'' example application for the mechanism required and consult your part datasheet for information on affected pins.
Returns
Returns the wake pin status.

Definition at line 2476 of file gpio.c.

References GPIO_O_WAKESTAT.

2477 {
2478  return(ui32Port + GPIO_O_WAKESTAT);
2479 }
#define GPIO_O_WAKESTAT
Definition: hw_gpio.h:76
void GPIOPinWrite ( uint32_t  ui32Port,
uint8_t  ui8Pins,
uint8_t  ui8Val 
)

Writes a value to the specified pin(s).

Parameters
ui32Portis the base address of the GPIO port.
ui8Pinsis the bit-packed representation of the pin(s).
ui8Valis the value to write to the pin(s).

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

The pin(s) are specified using a bit-packed byte, where each bit that is set identifies the pin to be accessed, and where bit 0 of the byte represents GPIO port pin 0, bit 1 represents GPIO port pin 1, and so on.

Returns
None.

Definition at line 1038 of file gpio.c.

References ASSERT, GPIO_O_DATA, and HWREG.

Referenced by heart_beat(), heart_off(), heart_on(), heart_toggle(), led_blink_blue(), led_blink_green(), led_blink_red(), led_single_blink_blue(), led_single_blink_green(), led_single_blink_red(), postpone_suicide(), Thread1(), Thread2(), and uart_consumer().

1039 {
1040  //
1041  // Check the arguments.
1042  //
1043  ASSERT(_GPIOBaseValid(ui32Port));
1044 
1045  //
1046  // Write the pins.
1047  //
1048  HWREG(ui32Port + (GPIO_O_DATA + (ui8Pins << 2))) = ui8Val;
1049 }
#define HWREG(x)
Definition: hw_types.h:48
#define ASSERT(expr)
Definition: debug.h:67
#define GPIO_O_DATA
Definition: hw_gpio.h:48

Here is the caller graph for this function:

Variable Documentation

const uint32_t g_ppui32GPIOIntMapBlizzard[][2]
static
Initial value:
=
{
}
#define GPIO_PORTB_AHB_BASE
Definition: hw_memmap.h:101
#define GPIO_PORTD_AHB_BASE
Definition: hw_memmap.h:103
#define INT_GPIOA_TM4C123
Definition: hw_ints.h:64
#define GPIO_PORTN_BASE
Definition: hw_memmap.h:112
#define GPIO_PORTG_BASE
Definition: hw_memmap.h:75
#define GPIO_PORTK_BASE
Definition: hw_memmap.h:109
#define INT_GPIOH_TM4C123
Definition: hw_ints.h:97
#define INT_GPIOE_TM4C123
Definition: hw_ints.h:68
#define GPIO_PORTB_BASE
Definition: hw_memmap.h:54
#define GPIO_PORTM_BASE
Definition: hw_memmap.h:111
#define INT_GPIOJ_TM4C123
Definition: hw_ints.h:115
#define GPIO_PORTE_AHB_BASE
Definition: hw_memmap.h:104
#define INT_GPIOM_TM4C123
Definition: hw_ints.h:146
#define GPIO_PORTE_BASE
Definition: hw_memmap.h:73
#define INT_GPION_TM4C123
Definition: hw_ints.h:147
#define INT_GPIOL_TM4C123
Definition: hw_ints.h:117
#define GPIO_PORTH_BASE
Definition: hw_memmap.h:76
#define INT_GPIOG_TM4C123
Definition: hw_ints.h:96
#define INT_GPIOQ0_TM4C123
Definition: hw_ints.h:156
#define GPIO_PORTF_AHB_BASE
Definition: hw_memmap.h:105
#define GPIO_PORTA_AHB_BASE
Definition: hw_memmap.h:100
#define INT_GPIOB_TM4C123
Definition: hw_ints.h:65
#define INT_GPIOP0_TM4C123
Definition: hw_ints.h:148
#define GPIO_PORTJ_BASE
Definition: hw_memmap.h:92
#define GPIO_PORTA_BASE
Definition: hw_memmap.h:53
#define INT_GPIOC_TM4C123
Definition: hw_ints.h:66
#define GPIO_PORTH_AHB_BASE
Definition: hw_memmap.h:107
#define GPIO_PORTQ_BASE
Definition: hw_memmap.h:114
#define INT_GPIOK_TM4C123
Definition: hw_ints.h:116
#define GPIO_PORTC_BASE
Definition: hw_memmap.h:55
#define GPIO_PORTJ_AHB_BASE
Definition: hw_memmap.h:108
#define GPIO_PORTL_BASE
Definition: hw_memmap.h:110
#define INT_GPIOD_TM4C123
Definition: hw_ints.h:67
#define INT_GPIOF_TM4C123
Definition: hw_ints.h:95
#define GPIO_PORTD_BASE
Definition: hw_memmap.h:56
#define GPIO_PORTG_AHB_BASE
Definition: hw_memmap.h:106
#define GPIO_PORTP_BASE
Definition: hw_memmap.h:113
#define GPIO_PORTC_AHB_BASE
Definition: hw_memmap.h:102
#define GPIO_PORTF_BASE
Definition: hw_memmap.h:74

Definition at line 63 of file gpio.c.

Referenced by _GPIOIntNumberGet().

const uint32_t g_ppui32GPIOIntMapSnowflake[][2]
static
Initial value:
=
{
}
#define GPIO_PORTB_AHB_BASE
Definition: hw_memmap.h:101
#define INT_GPION_TM4C129
Definition: hw_ints.h:248
#define GPIO_PORTD_AHB_BASE
Definition: hw_memmap.h:103
#define INT_GPIOG_TM4C129
Definition: hw_ints.h:207
#define GPIO_PORTN_BASE
Definition: hw_memmap.h:112
#define GPIO_PORTG_BASE
Definition: hw_memmap.h:75
#define GPIO_PORTK_BASE
Definition: hw_memmap.h:109
#define GPIO_PORTB_BASE
Definition: hw_memmap.h:54
#define GPIO_PORTM_BASE
Definition: hw_memmap.h:111
#define INT_GPIOA_TM4C129
Definition: hw_ints.h:176
#define GPIO_PORTE_AHB_BASE
Definition: hw_memmap.h:104
#define GPIO_PORTE_BASE
Definition: hw_memmap.h:73
#define GPIO_PORTH_BASE
Definition: hw_memmap.h:76
#define INT_GPIOE_TM4C129
Definition: hw_ints.h:180
#define INT_GPIOH_TM4C129
Definition: hw_ints.h:208
#define GPIO_PORTF_AHB_BASE
Definition: hw_memmap.h:105
#define GPIO_PORTA_AHB_BASE
Definition: hw_memmap.h:100
#define GPIO_PORTJ_BASE
Definition: hw_memmap.h:92
#define GPIO_PORTA_BASE
Definition: hw_memmap.h:53
#define INT_GPIOF_TM4C129
Definition: hw_ints.h:206
#define GPIO_PORTH_AHB_BASE
Definition: hw_memmap.h:107
#define GPIO_PORTQ_BASE
Definition: hw_memmap.h:114
#define GPIO_PORTC_BASE
Definition: hw_memmap.h:55
#define INT_GPIOP0_TM4C129
Definition: hw_ints.h:250
#define GPIO_PORTJ_AHB_BASE
Definition: hw_memmap.h:108
#define GPIO_PORTL_BASE
Definition: hw_memmap.h:110
#define INT_GPIOK_TM4C129
Definition: hw_ints.h:228
#define INT_GPIOJ_TM4C129
Definition: hw_ints.h:227
#define INT_GPIOM_TM4C129
Definition: hw_ints.h:247
#define INT_GPIOQ0_TM4C129
Definition: hw_ints.h:258
#define INT_GPIOD_TM4C129
Definition: hw_ints.h:179
#define INT_GPIOC_TM4C129
Definition: hw_ints.h:178
#define GPIO_PORTD_BASE
Definition: hw_memmap.h:56
#define INT_GPIOL_TM4C129
Definition: hw_ints.h:229
#define GPIO_PORTG_AHB_BASE
Definition: hw_memmap.h:106
#define GPIO_PORTP_BASE
Definition: hw_memmap.h:113
#define INT_GPIOB_TM4C129
Definition: hw_ints.h:177
#define GPIO_PORTC_AHB_BASE
Definition: hw_memmap.h:102
#define GPIO_PORTF_BASE
Definition: hw_memmap.h:74

Definition at line 93 of file gpio.c.

Referenced by _GPIOIntNumberGet().

const uint32_t g_pui32GPIOBaseAddrs[]
static
Initial value:
=
{
}
#define GPIO_PORTB_AHB_BASE
Definition: hw_memmap.h:101
#define GPIO_PORTD_AHB_BASE
Definition: hw_memmap.h:103
#define GPIO_PORTN_BASE
Definition: hw_memmap.h:112
#define GPIO_PORTS_BASE
Definition: hw_memmap.h:117
#define GPIO_PORTG_BASE
Definition: hw_memmap.h:75
#define GPIO_PORTK_BASE
Definition: hw_memmap.h:109
#define GPIO_PORTB_BASE
Definition: hw_memmap.h:54
#define GPIO_PORTM_BASE
Definition: hw_memmap.h:111
#define GPIO_PORTT_BASE
Definition: hw_memmap.h:119
#define GPIO_PORTE_AHB_BASE
Definition: hw_memmap.h:104
#define GPIO_PORTE_BASE
Definition: hw_memmap.h:73
#define GPIO_PORTH_BASE
Definition: hw_memmap.h:76
#define GPIO_PORTF_AHB_BASE
Definition: hw_memmap.h:105
#define GPIO_PORTA_AHB_BASE
Definition: hw_memmap.h:100
#define GPIO_PORTJ_BASE
Definition: hw_memmap.h:92
#define GPIO_PORTA_BASE
Definition: hw_memmap.h:53
#define GPIO_PORTH_AHB_BASE
Definition: hw_memmap.h:107
#define GPIO_PORTQ_BASE
Definition: hw_memmap.h:114
#define GPIO_PORTC_BASE
Definition: hw_memmap.h:55
#define GPIO_PORTJ_AHB_BASE
Definition: hw_memmap.h:108
#define GPIO_PORTL_BASE
Definition: hw_memmap.h:110
#define GPIO_PORTD_BASE
Definition: hw_memmap.h:56
#define GPIO_PORTG_AHB_BASE
Definition: hw_memmap.h:106
#define GPIO_PORTP_BASE
Definition: hw_memmap.h:113
#define GPIO_PORTC_AHB_BASE
Definition: hw_memmap.h:102
#define GPIO_PORTF_BASE
Definition: hw_memmap.h:74
#define GPIO_PORTR_BASE
Definition: hw_memmap.h:115

Definition at line 130 of file gpio.c.

const uint_fast32_t g_ui32GPIOIntMapBlizzardRows
static
Initial value:
=
static const uint32_t g_ppui32GPIOIntMapBlizzard[][2]
Definition: gpio.c:63

Definition at line 90 of file gpio.c.

Referenced by _GPIOIntNumberGet().

const uint_fast32_t g_ui32GPIOIntMapSnowflakeRows
static
Initial value:
=
static const uint32_t g_ppui32GPIOIntMapSnowflake[][2]
Definition: gpio.c:93

Definition at line 120 of file gpio.c.

Referenced by _GPIOIntNumberGet().