Macros | Functions
gpio.c File Reference
#include <stdint.h>
#include <gpio.h>
#include <debug.h>
#include <interrupt.h>
#include <hw_memmap.h>

Macros

#define OFS_LIB_PAIN   ((uint32_t)&P1->IN - (uint32_t)P1)
 
#define OFS_LIB_PAOUT   ((uint32_t)&P1->OUT - (uint32_t)P1)
 
#define OFS_LIB_PADIR   ((uint32_t)&P1->DIR - (uint32_t)P1)
 
#define OFS_LIB_PAREN   ((uint32_t)&P1->REN - (uint32_t)P1)
 
#define OFS_LIB_PADS   ((uint32_t)&P1->DS - (uint32_t)P1)
 
#define OFS_LIB_PASEL0   ((uint32_t)&P1->SEL0 - (uint32_t)P1)
 
#define OFS_LIB_PASEL1   ((uint32_t)&P1->SEL1 - (uint32_t)P1)
 
#define OFS_LIB_PAIE   ((uint32_t)&P1->IE - (uint32_t)P1)
 
#define OFS_LIB_PAIES   ((uint32_t)&P1->IES - (uint32_t)P1)
 
#define OFS_LIB_PAIFG   ((uint32_t)&P1->IFG - (uint32_t)P1)
 
#define OFS_LIB_P1IE   ((uint32_t)&P1->IE - (uint32_t)P1)
 
#define OFS_LIB_P2IE   OFS_LIB_P1IE
 

Functions

void GPIO_setAsOutputPin (uint_fast8_t selectedPort, uint_fast16_t selectedPins)
 This function configures the selected Pin as output pin. More...
 
void GPIO_setAsInputPin (uint_fast8_t selectedPort, uint_fast16_t selectedPins)
 This function configures the selected Pin as input pin. More...
 
void GPIO_setAsPeripheralModuleFunctionOutputPin (uint_fast8_t selectedPort, uint_fast16_t selectedPins, uint_fast8_t mode)
 This function configures the peripheral module function in the output direction for the selected pin for either primary, secondary or ternary module function modes. More...
 
void GPIO_setAsPeripheralModuleFunctionInputPin (uint_fast8_t selectedPort, uint_fast16_t selectedPins, uint_fast8_t mode)
 This function configures the peripheral module function in the input direction for the selected pin for either primary, secondary or ternary module function modes. More...
 
void GPIO_setOutputHighOnPin (uint_fast8_t selectedPort, uint_fast16_t selectedPins)
 This function sets output HIGH on the selected Pin. More...
 
void GPIO_setOutputLowOnPin (uint_fast8_t selectedPort, uint_fast16_t selectedPins)
 This function sets output LOW on the selected Pin. More...
 
void GPIO_toggleOutputOnPin (uint_fast8_t selectedPort, uint_fast16_t selectedPins)
 This function toggles the output on the selected Pin. More...
 
void GPIO_setAsInputPinWithPullDownResistor (uint_fast8_t selectedPort, uint_fast16_t selectedPins)
 This function sets the selected Pin in input Mode with Pull Down resistor. More...
 
void GPIO_setAsInputPinWithPullUpResistor (uint_fast8_t selectedPort, uint_fast16_t selectedPins)
 This function sets the selected Pin in input Mode with Pull Up resistor. More...
 
uint8_t GPIO_getInputPinValue (uint_fast8_t selectedPort, uint_fast16_t selectedPins)
 This function gets the input value on the selected pin. More...
 
void GPIO_enableInterrupt (uint_fast8_t selectedPort, uint_fast16_t selectedPins)
 This function enables the port interrupt on the selected pin. More...
 
void GPIO_disableInterrupt (uint_fast8_t selectedPort, uint_fast16_t selectedPins)
 This function disables the port interrupt on the selected pin. More...
 
uint_fast16_t GPIO_getInterruptStatus (uint_fast8_t selectedPort, uint_fast16_t selectedPins)
 This function gets the interrupt status of the selected pin. More...
 
void GPIO_clearInterruptFlag (uint_fast8_t selectedPort, uint_fast16_t selectedPins)
 This function clears the interrupt flag on the selected pin. More...
 
void GPIO_interruptEdgeSelect (uint_fast8_t selectedPort, uint_fast16_t selectedPins, uint_fast8_t edgeSelect)
 This function selects on what edge the port interrupt flag should be set for a transition. More...
 
uint_fast16_t GPIO_getEnabledInterruptStatus (uint_fast8_t selectedPort)
 This function gets the interrupt status of the provided PIN and masks it with the interrupts that are actually enabled. This is useful for inside ISRs where the status of only the enabled interrupts needs to be checked. More...
 
void GPIO_setDriveStrengthHigh (uint_fast8_t selectedPort, uint_fast8_t selectedPins)
 
void GPIO_setDriveStrengthLow (uint_fast8_t selectedPort, uint_fast8_t selectedPins)
 
void GPIO_registerInterrupt (uint_fast8_t selectedPort, void(*intHandler)(void))
 
void GPIO_unregisterInterrupt (uint_fast8_t selectedPort)
 

Macro Definition Documentation

#define OFS_LIB_PAIN   ((uint32_t)&P1->IN - (uint32_t)P1)

Referenced by GPIO_getInputPinValue().

#define OFS_LIB_PAOUT   ((uint32_t)&P1->OUT - (uint32_t)P1)
#define OFS_LIB_PADIR   ((uint32_t)&P1->DIR - (uint32_t)P1)
#define OFS_LIB_PAREN   ((uint32_t)&P1->REN - (uint32_t)P1)
#define OFS_LIB_PADS   ((uint32_t)&P1->DS - (uint32_t)P1)
#define OFS_LIB_PASEL0   ((uint32_t)&P1->SEL0 - (uint32_t)P1)
#define OFS_LIB_PASEL1   ((uint32_t)&P1->SEL1 - (uint32_t)P1)
#define OFS_LIB_PAIE   ((uint32_t)&P1->IE - (uint32_t)P1)
#define OFS_LIB_PAIES   ((uint32_t)&P1->IES - (uint32_t)P1)
#define OFS_LIB_PAIFG   ((uint32_t)&P1->IFG - (uint32_t)P1)
#define OFS_LIB_P1IE   ((uint32_t)&P1->IE - (uint32_t)P1)
#define OFS_LIB_P2IE   OFS_LIB_P1IE

Copyright 2016, Texas Instruments Incorporated