frgpio.h
Go to the documentation of this file.
00001 #ifndef __MSP430WARE_FRGPIO_H__
00002 #define __MSP430WARE_FRGPIO_H__
00003 //*****************************************************************************
00004 //
00005 //The following are the defines to include the required modules for this
00006 //peripheral in msp430xgeneric.h file
00007 //
00008 // The reason for only including Ports 1,2,A is that most of the others are the exact
00009 //  same format with exceptions specific to your device.  It is up to the user
00010 //  to make sure the ports are available by looking in the datasheet for their device.
00011 //  These API's will work, however; ports that are not fully implemented will not work.
00012 //
00013 //*****************************************************************************
00014 #define __MSP430_HAS_PORT1_R__        /* Definition to show that Module is available */
00015 #define __MSP430_HAS_PORT2_R__        /* Definition to show that Module is available */
00016 #define __MSP430_HAS_PORTA_R__        /* Definition to show that Module is available */
00017 
00018 //*****************************************************************************
00019 //
00020 //The following are values that can be passed to the all GPIO module API
00021 //as the selectedPort parameter.
00022 //
00023 // Note: Since these GPIOs have the same offsets, we can just combine them into sets.
00024 //*****************************************************************************
00025 #define FRGPIO_PORT_P1     (0x00)
00026 #define FRGPIO_PORT_P2     (0x01)
00027 #define FRGPIO_PORT_P3     (0x00)
00028 #define FRGPIO_PORT_P4     (0x01)
00029 #define FRGPIO_PORT_P5     (0x00)
00030 #define FRGPIO_PORT_P6     (0x01)
00031 #define FRGPIO_PORT_P7     (0x00)
00032 #define FRGPIO_PORT_P8     (0x01)
00033 #define FRGPIO_PORT_P9     (0x00)
00034 #define FRGPIO_PORT_P10    (0x01)
00035 #define FRGPIO_PORT_P11    (0x00)
00036 #define FRGPIO_PORT_PA     (0x02)
00037 #define FRGPIO_PORT_PB     (0x02)
00038 #define FRGPIO_PORT_PC     (0x02)
00039 #define FRGPIO_PORT_PD     (0x02)
00040 #define FRGPIO_PORT_PE     (0x02)
00041 #define FRGPIO_PORT_PF     (0x02)
00042 #define FRGPIO_PORT_PJ     (0x02)
00043 
00044 //*****************************************************************************
00045 //
00046 //The following are values that can be passed to the all GPIO module API
00047 //as the selectedPin parameter.
00048 //
00049 //*****************************************************************************
00050 #define FRGPIO_PIN0    (0x0001)
00051 #define FRGPIO_PIN1    (0x0002)
00052 #define FRGPIO_PIN2    (0x0004)
00053 #define FRGPIO_PIN3    (0x0008)
00054 #define FRGPIO_PIN4    (0x0010)
00055 #define FRGPIO_PIN5    (0x0020)
00056 #define FRGPIO_PIN6    (0x0040)
00057 #define FRGPIO_PIN7    (0x0080)
00058 #define FRGPIO_PIN8    (0x0100)
00059 #define FRGPIO_PIN9    (0x0200)
00060 #define FRGPIO_PIN10   (0x0400)
00061 #define FRGPIO_PIN11   (0x0800)
00062 #define FRGPIO_PIN12   (0x1000)
00063 #define FRGPIO_PIN13   (0x2000)
00064 #define FRGPIO_PIN14   (0x4000)
00065 #define FRGPIO_PIN15   (0x8000)
00066 
00067 //*****************************************************************************
00068 //
00069 //The following are values that may be returned by the FRGPIO_getInputPinValue()
00070 //API.
00071 //
00072 //*****************************************************************************
00073 #define FRGPIO_INPUT_PIN_HIGH (0x01)
00074 #define FRGPIO_INPUT_PIN_LOW  (0x00)
00075 
00076 //*****************************************************************************
00077 //
00078 //The following are values that can be passed to the FRGPIO_interruptEdgeSelect()
00079 //API as the edgeSelect parameter.
00080 //
00081 //*****************************************************************************
00082 #define FRGPIO_HIGH_TO_LOW_TRANSITION (0x01)
00083 #define FRGPIO_LOW_TO_HIGH_TRANSITION (0x00)
00084 
00085 //*****************************************************************************
00086 //
00087 //The following are values that can be passed to the
00088 //  FRGPIO_setAsPeripheralModuleFunctionOutputPin() or FRGPIO_setAsPeripheralModuleFunctionInputPin() API
00089 //  as the mode parameter.
00090 //
00091 //*****************************************************************************
00092 #define FRGPIO_PRIMARY_MODULE_FUNCTION          (0x01)
00093 #define FRGPIO_SECONDARY_MODULE_FUNCTION        (0x02)
00094 #define FRGPIO_TERNARY_MODULE_FUNCTION          (0x03)
00095 
00096 //*****************************************************************************
00097 //
00098 //Prototypes for the APIs.
00099 //
00100 //*****************************************************************************
00101 extern void FRGPIO_setAsOutputPin (unsigned int baseAddress,
00102                                                                 unsigned char selectedPort,
00103                                                                 unsigned int selectedPin);
00104 
00105 extern void FRGPIO_setAsInputPin (unsigned int baseAddress,
00106                                                                 unsigned char selectedPort,
00107                                                                 unsigned int selectedPin);
00108 
00109 extern void FRGPIO_setOutputHighOnPin ( unsigned int baseAddress,
00110                                                                                 unsigned char selectedPort,
00111                                                                                 unsigned int selectedPin);
00112 
00113 extern void FRGPIO_setOutputLowOnPin (unsigned int baseAddress,
00114                                                                                 unsigned char selectedPort,
00115                                                                                 unsigned int selectedPin);
00116 
00117 extern void FRGPIO_toggleOutputOnPin (unsigned int baseAddress,
00118                                                                         unsigned char selectedPort,
00119                                                                         unsigned int selectedPin);
00120 
00121 extern void FRGPIO_setAsInputPinWithPullDownresistor (unsigned int baseAddress,
00122                                                                                                         unsigned char selectedPort,
00123                                                                                                         unsigned int selectedPin);
00124 
00125 extern void FRGPIO_setAsInputPinWithPullUpresistor (unsigned int baseAddress,
00126                                                                                                         unsigned char selectedPort,
00127                                                                                                         unsigned int selectedPin);
00128 
00129 extern void FRGPIO_enableInterrupt (unsigned int baseAddress,
00130                                                                         unsigned char selectedPort,
00131                                                                         unsigned int selectedPins);
00132 
00133 extern void FRGPIO_disableInterrupt (unsigned int baseAddress,
00134                                                                         unsigned char selectedPort,
00135                                                                         unsigned int selectedPins);
00136 
00137 extern void FRGPIO_clearInterruptFlag (unsigned int baseAddress,
00138                                                                                 unsigned char selectedPort,
00139                                                                                 unsigned int selectedPins);
00140 
00141 extern unsigned int FRGPIO_getInterruptStatus (unsigned int baseAddress,
00142                                                                                                 unsigned char selectedPort,
00143                                                                                                 unsigned int selectedPins);
00144 
00145 extern void FRGPIO_interruptEdgeSelect (unsigned int baseAddress,
00146                                                                                 unsigned char selectedPort,
00147                                                                                 unsigned int selectedPins,
00148                                                                                 unsigned char edgeSelect);
00149 
00150 extern unsigned short FRGPIO_getInputPinValue (unsigned int baseAddress,
00151                                                                                                 unsigned char selectedPort,
00152                                                                                                 unsigned int selectedPin);
00153 
00154 
00155 extern void FRGPIO_setAsPeripheralModuleFunctionOutputPin ( unsigned int baseAddress,
00156                                                                                                 unsigned char selectedPort,
00157                                                                                                 unsigned int selectedPin,
00158                                                                                                 unsigned char mode);
00159 
00160 extern void FRGPIO_setAsPeripheralModuleFunctionInputPin ( unsigned int baseAddress,
00161                                                                                                 unsigned char selectedPort,
00162                                                                                                 unsigned int selectedPin,
00163                                                                                                 unsigned char mode);
00164 #endif

Copyright 2012, Texas Instruments Incorporated