Date: March 20, 2011 This library is created from "LPC17xx CMSIS-Compliant Standard Peripheral Firmware Driver Library (GNU, Keil, IAR) (Jan 28, 2011)", available from NXP's website, under "All microcontrollers support documents" [[http://ics.nxp.com/support/documents/microcontrollers/?type=software]] You will need to follow [[/projects/libraries/svn/mbed/trunk/LPC1768/LPC17xx.h]] while using this library Examples provided here [[/users/frank26080115/programs/LPC1700CMSIS_Examples/]] The beautiful thing is that NXP does not place copyright protection on any of the files in here Only a few modifications are made to make it compile with the mbed online compiler, I fixed some warnings as well. This is untested as of March 20, 2011 Forum post about this library: [[/forum/mbed/topic/2030/]]

Committer:
frank26080115
Date:
Sun Mar 20 18:45:15 2011 +0000
Revision:
0:84d7747641aa

        

Who changed what in which revision?

UserRevisionLine numberNew contents of line
frank26080115 0:84d7747641aa 1 /***********************************************************************//**
frank26080115 0:84d7747641aa 2 * @file lpc17xx_exti.h
frank26080115 0:84d7747641aa 3 * @brief Contains all macro definitions and function prototypes
frank26080115 0:84d7747641aa 4 * support for External interrupt firmware library on LPC17xx
frank26080115 0:84d7747641aa 5 * @version 2.0
frank26080115 0:84d7747641aa 6 * @date 21. May. 2010
frank26080115 0:84d7747641aa 7 * @author NXP MCU SW Application Team
frank26080115 0:84d7747641aa 8 **************************************************************************
frank26080115 0:84d7747641aa 9 * Software that is described herein is for illustrative purposes only
frank26080115 0:84d7747641aa 10 * which provides customers with programming information regarding the
frank26080115 0:84d7747641aa 11 * products. This software is supplied "AS IS" without any warranties.
frank26080115 0:84d7747641aa 12 * NXP Semiconductors assumes no responsibility or liability for the
frank26080115 0:84d7747641aa 13 * use of the software, conveys no license or title under any patent,
frank26080115 0:84d7747641aa 14 * copyright, or mask work right to the product. NXP Semiconductors
frank26080115 0:84d7747641aa 15 * reserves the right to make changes in the software without
frank26080115 0:84d7747641aa 16 * notification. NXP Semiconductors also make no representation or
frank26080115 0:84d7747641aa 17 * warranty that such application will be suitable for the specified
frank26080115 0:84d7747641aa 18 * use without further testing or modification.
frank26080115 0:84d7747641aa 19 **************************************************************************/
frank26080115 0:84d7747641aa 20
frank26080115 0:84d7747641aa 21 /* Peripheral group ----------------------------------------------------------- */
frank26080115 0:84d7747641aa 22 /** @defgroup EXTI EXTI
frank26080115 0:84d7747641aa 23 * @ingroup LPC1700CMSIS_FwLib_Drivers
frank26080115 0:84d7747641aa 24 * @{
frank26080115 0:84d7747641aa 25 */
frank26080115 0:84d7747641aa 26
frank26080115 0:84d7747641aa 27 #ifndef LPC17XX_EXTI_H_
frank26080115 0:84d7747641aa 28 #define LPC17XX_EXTI_H_
frank26080115 0:84d7747641aa 29
frank26080115 0:84d7747641aa 30 /* Includes ------------------------------------------------------------------- */
frank26080115 0:84d7747641aa 31 #include "LPC17xx.h"
frank26080115 0:84d7747641aa 32 #include "lpc_types.h"
frank26080115 0:84d7747641aa 33
frank26080115 0:84d7747641aa 34
frank26080115 0:84d7747641aa 35 #ifdef __cplusplus
frank26080115 0:84d7747641aa 36 extern "C"
frank26080115 0:84d7747641aa 37 {
frank26080115 0:84d7747641aa 38 #endif
frank26080115 0:84d7747641aa 39
frank26080115 0:84d7747641aa 40
frank26080115 0:84d7747641aa 41 /* Private Macros ------------------------------------------------------------- */
frank26080115 0:84d7747641aa 42 /** @defgroup EXTI_Private_Macros EXTI Private Macros
frank26080115 0:84d7747641aa 43 * @{
frank26080115 0:84d7747641aa 44 */
frank26080115 0:84d7747641aa 45 /*********************************************************************//**
frank26080115 0:84d7747641aa 46 * Macro defines for EXTI control register
frank26080115 0:84d7747641aa 47 **********************************************************************/
frank26080115 0:84d7747641aa 48 #define EXTI_EINT0_BIT_MARK 0x01
frank26080115 0:84d7747641aa 49 #define EXTI_EINT1_BIT_MARK 0x02
frank26080115 0:84d7747641aa 50 #define EXTI_EINT2_BIT_MARK 0x04
frank26080115 0:84d7747641aa 51 #define EXTI_EINT3_BIT_MARK 0x08
frank26080115 0:84d7747641aa 52
frank26080115 0:84d7747641aa 53 /**
frank26080115 0:84d7747641aa 54 * @}
frank26080115 0:84d7747641aa 55 */
frank26080115 0:84d7747641aa 56
frank26080115 0:84d7747641aa 57 /* Private Macros ------------------------------------------------------------- */
frank26080115 0:84d7747641aa 58 /** @defgroup EXTI_Public_Types EXTI Public Types
frank26080115 0:84d7747641aa 59 * @{
frank26080115 0:84d7747641aa 60 */
frank26080115 0:84d7747641aa 61
frank26080115 0:84d7747641aa 62 /**
frank26080115 0:84d7747641aa 63 * @brief EXTI external interrupt line option
frank26080115 0:84d7747641aa 64 */
frank26080115 0:84d7747641aa 65 typedef enum
frank26080115 0:84d7747641aa 66 {
frank26080115 0:84d7747641aa 67 EXTI_EINT0, /*!< External interrupt 0, P2.10 */
frank26080115 0:84d7747641aa 68 EXTI_EINT1, /*!< External interrupt 0, P2.11 */
frank26080115 0:84d7747641aa 69 EXTI_EINT2, /*!< External interrupt 0, P2.12 */
frank26080115 0:84d7747641aa 70 EXTI_EINT3 /*!< External interrupt 0, P2.13 */
frank26080115 0:84d7747641aa 71 } EXTI_LINE_ENUM;
frank26080115 0:84d7747641aa 72
frank26080115 0:84d7747641aa 73 /**
frank26080115 0:84d7747641aa 74 * @brief EXTI mode option
frank26080115 0:84d7747641aa 75 */
frank26080115 0:84d7747641aa 76 typedef enum
frank26080115 0:84d7747641aa 77 {
frank26080115 0:84d7747641aa 78 EXTI_MODE_LEVEL_SENSITIVE, /*!< Level sensitivity is selected */
frank26080115 0:84d7747641aa 79 EXTI_MODE_EDGE_SENSITIVE /*!< Edge sensitivity is selected */
frank26080115 0:84d7747641aa 80 } EXTI_MODE_ENUM;
frank26080115 0:84d7747641aa 81
frank26080115 0:84d7747641aa 82 /**
frank26080115 0:84d7747641aa 83 * @brief EXTI polarity option
frank26080115 0:84d7747641aa 84 */
frank26080115 0:84d7747641aa 85 typedef enum
frank26080115 0:84d7747641aa 86 {
frank26080115 0:84d7747641aa 87 EXTI_POLARITY_LOW_ACTIVE_OR_FALLING_EDGE, /*!< Low active or falling edge sensitive
frank26080115 0:84d7747641aa 88 depending on pin mode */
frank26080115 0:84d7747641aa 89 EXTI_POLARITY_HIGH_ACTIVE_OR_RISING_EDGE /*!< High active or rising edge sensitive
frank26080115 0:84d7747641aa 90 depending on pin mode */
frank26080115 0:84d7747641aa 91 } EXTI_POLARITY_ENUM;
frank26080115 0:84d7747641aa 92
frank26080115 0:84d7747641aa 93 /**
frank26080115 0:84d7747641aa 94 * @brief EXTI Initialize structure
frank26080115 0:84d7747641aa 95 */
frank26080115 0:84d7747641aa 96 typedef struct
frank26080115 0:84d7747641aa 97 {
frank26080115 0:84d7747641aa 98 EXTI_LINE_ENUM EXTI_Line; /*!<Select external interrupt pin (EINT0, EINT1, EINT 2, EINT3) */
frank26080115 0:84d7747641aa 99
frank26080115 0:84d7747641aa 100 EXTI_MODE_ENUM EXTI_Mode; /*!< Choose between Level-sensitivity or Edge sensitivity */
frank26080115 0:84d7747641aa 101
frank26080115 0:84d7747641aa 102 EXTI_POLARITY_ENUM EXTI_polarity; /*!< If EXTI mode is level-sensitive: this element use to select low or high active level
frank26080115 0:84d7747641aa 103 if EXTI mode is polarity-sensitive: this element use to select falling or rising edge */
frank26080115 0:84d7747641aa 104
frank26080115 0:84d7747641aa 105 }EXTI_InitTypeDef;
frank26080115 0:84d7747641aa 106
frank26080115 0:84d7747641aa 107
frank26080115 0:84d7747641aa 108 /**
frank26080115 0:84d7747641aa 109 * @}
frank26080115 0:84d7747641aa 110 */
frank26080115 0:84d7747641aa 111
frank26080115 0:84d7747641aa 112
frank26080115 0:84d7747641aa 113 /* Public Functions ----------------------------------------------------------- */
frank26080115 0:84d7747641aa 114 /** @defgroup EXTI_Public_Functions EXTI Public Functions
frank26080115 0:84d7747641aa 115 * @{
frank26080115 0:84d7747641aa 116 */
frank26080115 0:84d7747641aa 117
frank26080115 0:84d7747641aa 118 void EXTI_Init(void);
frank26080115 0:84d7747641aa 119 void EXTI_DeInit(void);
frank26080115 0:84d7747641aa 120
frank26080115 0:84d7747641aa 121 void EXTI_Config(EXTI_InitTypeDef *EXTICfg);
frank26080115 0:84d7747641aa 122 void EXTI_SetMode(EXTI_LINE_ENUM EXTILine, EXTI_MODE_ENUM mode);
frank26080115 0:84d7747641aa 123 void EXTI_SetPolarity(EXTI_LINE_ENUM EXTILine, EXTI_POLARITY_ENUM polarity);
frank26080115 0:84d7747641aa 124 void EXTI_ClearEXTIFlag(EXTI_LINE_ENUM EXTILine);
frank26080115 0:84d7747641aa 125
frank26080115 0:84d7747641aa 126
frank26080115 0:84d7747641aa 127 /**
frank26080115 0:84d7747641aa 128 * @}
frank26080115 0:84d7747641aa 129 */
frank26080115 0:84d7747641aa 130
frank26080115 0:84d7747641aa 131
frank26080115 0:84d7747641aa 132 #ifdef __cplusplus
frank26080115 0:84d7747641aa 133 }
frank26080115 0:84d7747641aa 134 #endif
frank26080115 0:84d7747641aa 135
frank26080115 0:84d7747641aa 136
frank26080115 0:84d7747641aa 137 #endif /* LPC17XX_EXTI_H_ */
frank26080115 0:84d7747641aa 138
frank26080115 0:84d7747641aa 139 /**
frank26080115 0:84d7747641aa 140 * @}
frank26080115 0:84d7747641aa 141 */
frank26080115 0:84d7747641aa 142
frank26080115 0:84d7747641aa 143 /* --------------------------------- End Of File ------------------------------ */