MotorWare f2806x Driver API Documentation
Data Structures | Macros | Typedefs | Enumerations | Functions
gpio.h File Reference

Contains public interface to general purpose I/O (GPIO) methods. More...

#include "sw/modules/types/src/types.h"
#include "sw/drivers/cpu/src/32b/f28x/f2806x/cpu.h"

Go to the source code of this file.

Data Structures

struct  _GPIO_Obj_
 Defines the General Purpose I/O (GPIO) object. More...
 

Macros

#define GPIO_BASE_ADDR   (0x00006F80)
 Defines the base address of the general purpose I/O (GPIO) registers. More...
 
#define GPIO_GPMUX_CONFIG_BITS   (3 << 0)
 Defines the location of the CONFIG bits in the GPMUX register. More...
 
#define GPIO_GPMUX_NUMGPIOS_PER_REG   16
 Defines number of GPIOs covered by each GPxMUX register. More...
 
#define GPIO_GPxQSELy_GPIOx_BITS   3
 Defines the location of the GPIOx bits in the GPxQSELy register. More...
 
#define GPIO_GPxQSELx_NUMGPIOS_PER_REG   16
 Defines number of GPIOs covered by each GPxQSELy register. More...
 
#define GPIO_GPxCTRL_QUALPRDx_BITS   0xFF
 Defines the location of the GPIOx bits in the GPxQSELy register. More...
 
#define GPIO_GPxCTRL_QUALPRDx_NUMBITS_PER_REG   8
 Defines number of bits per QUALPRDx field per GPxCTRL register. More...
 

Typedefs

typedef struct _GPIO_Obj_ GPIO_Obj
 Defines the General Purpose I/O (GPIO) object. More...
 
typedef struct _GPIO_Obj_GPIO_Handle
 Defines the general purpose I/O (GPIO) handle. More...
 

Enumerations

enum  GPIO_Mode_e {
  GPIO_0_Mode_GeneralPurpose =0, GPIO_0_Mode_EPWM1A, GPIO_0_Mode_Rsvd_2, GPIO_0_Mode_Rsvd_3,
  GPIO_1_Mode_GeneralPurpose =0, GPIO_1_Mode_EPWM1B, GPIO_1_Mode_Rsvd_2, GPIO_1_Mode_COMP1OUT,
  GPIO_2_Mode_GeneralPurpose =0, GPIO_2_Mode_EPWM2A, GPIO_2_Mode_Rsvd_2, GPIO_2_Mode_Rsvd_3,
  GPIO_3_Mode_GeneralPurpose =0, GPIO_3_Mode_EPWM2B, GPIO_3_Mode_SPISOMIA, GPIO_3_Mode_COMP2OUT,
  GPIO_4_Mode_GeneralPurpose =0, GPIO_4_Mode_EPWM3A, GPIO_4_Mode_Rsvd_2, GPIO_4_Mode_Rsvd_3,
  GPIO_5_Mode_GeneralPurpose =0, GPIO_5_Mode_EPWM3B, GPIO_5_Mode_SPISIMOA, GPIO_5_Mode_ECAP1,
  GPIO_6_Mode_GeneralPurpose =0, GPIO_6_Mode_EPWM4A, GPIO_6_Mode_EPWMSYNCI, GPIO_6_Mode_EPWMSYNCO,
  GPIO_7_Mode_GeneralPurpose =0, GPIO_7_Mode_EPWM4B, GPIO_7_Mode_SCIRXDA, GPIO_7_Mode_ECAP2,
  GPIO_8_Mode_GeneralPurpose =0, GPIO_8_Mode_EPWM5A, GPIO_8_Mode_Rsvd_2, GPIO_8_Mode_ADCSOCAO_NOT,
  GPIO_9_Mode_GeneralPurpose =0, GPIO_9_Mode_EPWM5B, GPIO_9_Mode_SCITXDB, GPIO_9_Mode_ECAP3,
  GPIO_10_Mode_GeneralPurpose =0, GPIO_10_Mode_EPWM6A, GPIO_10_Mode_Rsvd_2, GPIO_10_Mode_ADCSOCBO_NOT,
  GPIO_11_Mode_GeneralPurpose =0, GPIO_11_Mode_EPWM6B, GPIO_11_Mode_SCIRXDB, GPIO_11_Mode_ECAP1,
  GPIO_12_Mode_GeneralPurpose =0, GPIO_12_Mode_TZ1_NOT, GPIO_12_Mode_SCITXDA, GPIO_12_Mode_SPISIMOB,
  GPIO_13_Mode_GeneralPurpose =0, GPIO_13_Mode_TZ2_NOT, GPIO_13_Mode_Rsvd_2, GPIO_13_Mode_SPISOMIB,
  GPIO_14_Mode_GeneralPurpose =0, GPIO_14_Mode_TZ3_NOT, GPIO_14_Mode_SCITXDB, GPIO_14_Mode_SPICLKB,
  GPIO_15_Mode_GeneralPurpose =0, GPIO_15_Mode_ECAP2, GPIO_15_Mode_SCIRXDB, GPIO_15_Mode_SPISTEB_NOT,
  GPIO_16_Mode_GeneralPurpose =0, GPIO_16_Mode_SPISIMOA, GPIO_16_Mode_Rsvd_2, GPIO_16_Mode_TZ2_NOT,
  GPIO_17_Mode_GeneralPurpose =0, GPIO_17_Mode_SPISOMIA, GPIO_17_Mode_Rsvd_2, GPIO_17_Mode_TZ3_NOT,
  GPIO_18_Mode_GeneralPurpose =0, GPIO_18_Mode_SPICLKA, GPIO_18_Mode_SCITXDB, GPIO_18_Mode_XCLKOUT,
  GPIO_19_Mode_GeneralPurpose =0, GPIO_19_Mode_SPISTEA_NOT, GPIO_19_Mode_SCIRXDB, GPIO_19_Mode_ECAP1,
  GPIO_20_Mode_GeneralPurpose =0, GPIO_20_Mode_EQEP1A, GPIO_20_Mode_MDXA, GPIO_20_Mode_COMP1OUT,
  GPIO_21_Mode_GeneralPurpose =0, GPIO_21_Mode_EQEP1B, GPIO_21_Mode_MDRA, GPIO_21_Mode_COMP2OUT,
  GPIO_22_Mode_GeneralPurpose =0, GPIO_22_Mode_EQEP1S, GPIO_22_Mode_MCLKXA, GPIO_22_Mode_SCITXDB,
  GPIO_23_Mode_GeneralPurpose =0, GPIO_23_Mode_EQEP1I, GPIO_23_Mode_MFSXA, GPIO_23_Mode_SCIRXDB,
  GPIO_24_Mode_GeneralPurpose =0, GPIO_24_Mode_ECAP1, GPIO_24_Mode_EQEP2A, GPIO_24_Mode_SPISIMOB,
  GPIO_25_Mode_GeneralPurpose =0, GPIO_25_Mode_ECAP2, GPIO_25_Mode_EQEP2B, GPIO_25_Mode_SPISOMIB,
  GPIO_26_Mode_GeneralPurpose =0, GPIO_26_Mode_ECAP3, GPIO_26_Mode_EQEP2I, GPIO_26_Mode_SPICLKB,
  GPIO_27_Mode_GeneralPurpose =0, GPIO_27_Mode_HRCAP2, GPIO_27_Mode_EQEP2S, GPIO_27_Mode_SPISTEB_NOT,
  GPIO_28_Mode_GeneralPurpose =0, GPIO_28_Mode_SCIRXDA, GPIO_28_Mode_SDDA, GPIO_28_Mode_TZ2_NOT,
  GPIO_29_Mode_GeneralPurpose =0, GPIO_29_Mode_SCITXDA, GPIO_29_Mode_SCLA, GPIO_29_Mode_TZ3_NOT,
  GPIO_30_Mode_GeneralPurpose =0, GPIO_30_Mode_CANRXA, GPIO_30_Mode_EQEP2I, GPIO_30_Mode_EPWM7A,
  GPIO_31_Mode_GeneralPurpose =0, GPIO_31_Mode_CANTXA, GPIO_31_Mode_EQEP2S, GPIO_31_Mode_EPWM8A,
  GPIO_32_Mode_GeneralPurpose =0, GPIO_32_Mode_SDAA, GPIO_32_Mode_EPWMSYNCI, GPIO_32_Mode_ADCSOCAO_NOT,
  GPIO_33_Mode_GeneralPurpose =0, GPIO_33_Mode_SCLA, GPIO_33_Mode_EPWMSYNCO, GPIO_33_Mode_ADCSOCBO_NOT,
  GPIO_34_Mode_GeneralPurpose =0, GPIO_34_Mode_COMP2OUT, GPIO_34_Mode_Rsvd_2, GPIO_34_Mode_COMP3OUT,
  GPIO_35_Mode_JTAG_TDI =0, GPIO_35_Mode_Rsvd_1, GPIO_35_Mode_Rsvd_2, GPIO_35_Mode_Rsvd_3,
  GPIO_36_Mode_JTAG_TMS =0, GPIO_36_Mode_Rsvd_1, GPIO_36_Mode_Rsvd_2, GPIO_36_Mode_Rsvd_3,
  GPIO_37_Mode_JTAG_TDO =0, GPIO_37_Mode_Rsvd_1, GPIO_37_Mode_Rsvd_2, GPIO_37_Mode_Rsvd_3,
  GPIO_38_Mode_JTAG_TCK =0, GPIO_38_Mode_Rsvd_1, GPIO_38_Mode_Rsvd_2, GPIO_38_Mode_Rsvd_3,
  GPIO_39_Mode_GeneralPurpose =0, GPIO_39_Mode_Rsvd_1, GPIO_39_Mode_Rsvd_2, GPIO_39_Mode_Rsvd_3,
  GPIO_40_Mode_GeneralPurpose =0, GPIO_40_Mode_EPWM7A, GPIO_40_Mode_SCITXDB, GPIO_40_Mode_Rsvd_3,
  GPIO_41_Mode_GeneralPurpose =0, GPIO_41_Mode_EPWM7B, GPIO_41_Mode_SCIRXDB, GPIO_41_Mode_Rsvd_3,
  GPIO_42_Mode_GeneralPurpose =0, GPIO_42_Mode_EPWM8A, GPIO_42_Mode_TZ1_NOT, GPIO_42_Mode_COMP1OUT,
  GPIO_43_Mode_GeneralPurpose =0, GPIO_43_Mode_EPWM8B, GPIO_43_Mode_TZ2_NOT, GPIO_43_Mode_COMP2OUT,
  GPIO_44_Mode_GeneralPurpose =0, GPIO_44_Mode_MFSRA, GPIO_44_Mode_SCIRXDB, GPIO_44_Mode_EPWM7B,
  GPIO_50_Mode_GeneralPurpose =0, GPIO_50_Mode_EQEP1A, GPIO_50_Mode_MDXA, GPIO_50_Mode_TZ1_NOT,
  GPIO_51_Mode_GeneralPurpose =0, GPIO_51_Mode_EQEP1B, GPIO_51_Mode_MDRA, GPIO_51_Mode_TZ2_NOT,
  GPIO_52_Mode_GeneralPurpose =0, GPIO_52_Mode_EQEP1S, GPIO_52_Mode_MCLKXA, GPIO_52_Mode_TZ3_NOT,
  GPIO_53_Mode_GeneralPurpose =0, GPIO_53_Mode_EQEP1I, GPIO_53_Mode_MFSXA, GPIO_53_Mode_Rsvd_1,
  GPIO_54_Mode_GeneralPurpose =0, GPIO_54_Mode_SPISIMOA, GPIO_54_Mode_EQEP2A, GPIO_54_Mode_HRCAP1,
  GPIO_55_Mode_GeneralPurpose =0, GPIO_55_Mode_SPISOMIA, GPIO_55_Mode_EQEP2B, GPIO_55_Mode_HRCAP2,
  GPIO_56_Mode_GeneralPurpose =0, GPIO_56_Mode_SPICLKA, GPIO_56_Mode_EQEP2I, GPIO_56_Mode_HRCAP3,
  GPIO_57_Mode_GeneralPurpose =0, GPIO_57_Mode_SPISTEA_NOT, GPIO_57_Mode_EQEP2S, GPIO_57_Mode_HRCAP4,
  GPIO_58_Mode_GeneralPurpose =0, GPIO_58_Mode_MCLKRA, GPIO_58_Mode_SCITXDB, GPIO_58_Mode_EPWM7A
}
 Enumeration to define the general purpose I/O (GPIO) modes for each pin. More...
 
enum  GPIO_Direction_e { GPIO_Direction_Input =0, GPIO_Direction_Output }
 Enumeration to define the general purpose I/O (GPIO) directions. More...
 
enum  GPIO_Pullup_e { GPIO_Pullup_Enable =0, GPIO_Pullup_Disable }
 Enumeration to define the general purpose I/O (GPIO) pullups. More...
 
enum  GPIO_Qual_e { GPIO_Qual_Sync = 0, GPIO_Qual_Sample_3, GPIO_Qual_Sample_6, GPIO_Qual_ASync }
 Enumeration to define the general purpose I/O (GPIO) qualification. More...
 
enum  GPIO_Port_e { GPIO_Port_A = 0, GPIO_Port_B }
 Enumeration to define the general purpose I/O (GPIO) ports. More...
 
enum  GPIO_Number_e {
  GPIO_Number_0 =0, GPIO_Number_1, GPIO_Number_2, GPIO_Number_3,
  GPIO_Number_4, GPIO_Number_5, GPIO_Number_6, GPIO_Number_7,
  GPIO_Number_8, GPIO_Number_9, GPIO_Number_10, GPIO_Number_11,
  GPIO_Number_12, GPIO_Number_13, GPIO_Number_14, GPIO_Number_15,
  GPIO_Number_16, GPIO_Number_17, GPIO_Number_18, GPIO_Number_19,
  GPIO_Number_20, GPIO_Number_21, GPIO_Number_22, GPIO_Number_23,
  GPIO_Number_24, GPIO_Number_25, GPIO_Number_26, GPIO_Number_27,
  GPIO_Number_28, GPIO_Number_29, GPIO_Number_30, GPIO_Number_31,
  GPIO_Number_32, GPIO_Number_33, GPIO_Number_34, GPIO_Number_35,
  GPIO_Number_36, GPIO_Number_37, GPIO_Number_38, GPIO_Number_39,
  GPIO_Number_40, GPIO_Number_41, GPIO_Number_42, GPIO_Number_43,
  GPIO_Number_44, GPIO_Number_50 =50, GPIO_Number_51, GPIO_Number_52,
  GPIO_Number_53, GPIO_Number_54, GPIO_Number_55, GPIO_Number_56,
  GPIO_Number_57, GPIO_Number_58, GPIO_numGpios
}
 Enumeration to define the general purpose I/O (GPIO) numbers. More...
 

Functions

bool GPIO_getData (GPIO_Handle gpioHandle, const GPIO_Number_e gpioNumber)
 Returns the data value present on a pin (either input or output) More...
 
uint16_t GPIO_getPortData (GPIO_Handle gpioHandle, const GPIO_Port_e gpioPort)
 Returns the data value present on a GPIO port. More...
 
GPIO_Handle GPIO_init (void *pMemory, const size_t numBytes)
 Initializes the general purpose I/O (GPIO) object handle. More...
 
void GPIO_setDirection (GPIO_Handle gpioHandle, const GPIO_Number_e gpioNumber, const GPIO_Direction_e direction)
 Sets the general purpose I/O (GPIO) signal direction. More...
 
void GPIO_setPullup (GPIO_Handle gpioHandle, const GPIO_Number_e gpioNumber, const GPIO_Pullup_e pullup)
 Sets the general purpose I/O (GPIO) pullup disable. More...
 
void GPIO_setExtInt (GPIO_Handle gpioHandle, const GPIO_Number_e gpioNumber, const CPU_ExtIntNumber_e intNumber)
 Sets the general purpose I/O (GPIO) external interrupt number. More...
 
void GPIO_setLow (GPIO_Handle gpioHandle, const GPIO_Number_e gpioNumber)
 Sets the specified general purpose I/O (GPIO) signal low. More...
 
void GPIO_setMode (GPIO_Handle gpioHandle, const GPIO_Number_e gpioNumber, const GPIO_Mode_e mode)
 Sets the mode for the specified general purpose I/O (GPIO) signal. More...
 
bool GPIO_read (GPIO_Handle gpioHandle, const GPIO_Number_e gpioNumber)
 Reads the specified general purpose I/O (GPIO) More...
 
void GPIO_setHigh (GPIO_Handle gpioHandle, const GPIO_Number_e gpioNumber)
 Sets the specified general purpose I/O (GPIO) signal high. More...
 
void GPIO_setPortData (GPIO_Handle gpioHandle, const GPIO_Port_e gpioPort, const uint16_t data)
 Sets data output on a given GPIO port. More...
 
void GPIO_setQualification (GPIO_Handle gpioHandle, const GPIO_Number_e gpioNumber, const GPIO_Qual_e qualification)
 Sets the qualification for the specified general purpose I/O (GPIO) More...
 
void GPIO_setQualificationPeriod (GPIO_Handle gpioHandle, const GPIO_Number_e gpioNumber, const uint_least8_t period)
 Sets the qualification period for the specified general purpose I/O block (8 I/O's per block) More...
 
void GPIO_toggle (GPIO_Handle gpioHandle, const GPIO_Number_e gpioNumber)
 Toggles the specified general purpose I/O (GPIO) signal. More...
 
void GPIO_lpmSelect (GPIO_Handle gpioHandle, const GPIO_Number_e gpioNumber)
 Selects a gpio pin to wake up device from STANDBY and HALT LPM. More...
 

Detailed Description

Contains public interface to general purpose I/O (GPIO) methods.

(C) Copyright 2015, Texas Instruments, Inc.

Definition in file gpio.h.