NXP's driver library for LPC17xx, ported to mbed's online compiler. Not tested! I had to fix a lot of warings and found a couple of pretty obvious bugs, so the chances are there are more. Original: http://ics.nxp.com/support/documents/microcontrollers/zip/lpc17xx.cmsis.driver.library.zip
lpc17xx_rit.h
00001 /***********************************************************************//** 00002 * @file : lpc17xx_rit.h 00003 * @brief : Contains all macro definitions and function prototypes 00004 * support for RIT firmware library on LPC17xx 00005 * @version : 1.0 00006 * @date : 07. May. 2009 00007 * @author : NguyenCao 00008 ************************************************************************** 00009 * Software that is described herein is for illustrative purposes only 00010 * which provides customers with programming information regarding the 00011 * products. This software is supplied "AS IS" without any warranties. 00012 * NXP Semiconductors assumes no responsibility or liability for the 00013 * use of the software, conveys no license or title under any patent, 00014 * copyright, or mask work right to the product. NXP Semiconductors 00015 * reserves the right to make changes in the software without 00016 * notification. NXP Semiconductors also make no representation or 00017 * warranty that such application will be suitable for the specified 00018 * use without further testing or modification. 00019 **************************************************************************/ 00020 00021 /* Peripheral group ----------------------------------------------------------- */ 00022 /** @defgroup RIT 00023 * @ingroup LPC1700CMSIS_FwLib_Drivers 00024 * @{ 00025 */ 00026 00027 #ifndef LPC17XX_RIT_H_ 00028 #define LPC17XX_RIT_H_ 00029 00030 /* Includes ------------------------------------------------------------------- */ 00031 #include "cmsis.h" 00032 #include "lpc_types.h" 00033 00034 00035 #ifdef __cplusplus 00036 extern "C" 00037 { 00038 #endif 00039 00040 00041 /* Private Macros ------------------------------------------------------------- */ 00042 /** @defgroup RIT_Private_Macros 00043 * @{ 00044 */ 00045 00046 /** @defgroup RIT_REGISTER_BIT_DEFINITIONS 00047 * @{ 00048 */ 00049 00050 /*********************************************************************//** 00051 * Macro defines for RIT control register 00052 **********************************************************************/ 00053 /** Set interrupt flag when the counter value equals the masked compare value */ 00054 #define RIT_CTRL_INTEN ((uint32_t) (1)) 00055 /** Set timer enable clear to 0 when the counter value equals the masked compare value */ 00056 #define RIT_CTRL_ENCLR ((uint32_t) _BIT(1)) 00057 /** Set timer enable on break */ 00058 #define RIT_CTRL_ENBR ((uint32_t) _BIT(2)) 00059 /** Set timer enable */ 00060 #define RIT_CTRL_TEN ((uint32_t) _BIT(3)) 00061 00062 /** 00063 * @} 00064 */ 00065 00066 /** 00067 * @} 00068 */ 00069 00070 00071 /* Public Types --------------------------------------------------------------- */ 00072 /** @defgroup RIT_Public_Types 00073 * @{ 00074 */ 00075 00076 /** 00077 * @brief RIT compare configuration structure definition 00078 */ 00079 typedef struct 00080 { 00081 uint32_t CMPVAL; /** Compare Value */ 00082 uint32_t MASKVAL; /** Mask Value */ 00083 uint32_t COUNTVAL; /** Counter Value */ 00084 }RIT_CMP_VAL; 00085 00086 /*************************** GLOBAL/PUBLIC MACROS ***************************/ 00087 /** Macro to determine if it is valid RIT peripheral */ 00088 #define PARAM_RITx(n) (((uint32_t *)n)==((uint32_t *)LPC_RIT)) 00089 00090 /** 00091 * @} 00092 */ 00093 00094 00095 /* Public Functions ----------------------------------------------------------- */ 00096 /** @defgroup RIT_Public_Functions 00097 * @{ 00098 */ 00099 00100 void RIT_Init(LPC_RIT_TypeDef *RITx); 00101 void RIT_DeInit(LPC_RIT_TypeDef *RITx); 00102 void RIT_TimerConfig(LPC_RIT_TypeDef *RITx, RIT_CMP_VAL *value); 00103 void RIT_Cmd(LPC_RIT_TypeDef *RITx, FunctionalState NewState); 00104 void RIT_TimerClearCmd(LPC_RIT_TypeDef *RITx, FunctionalState NewState); 00105 void RIT_TimerEnableOnBreakCmd(LPC_RIT_TypeDef *RITx, FunctionalState NewState); 00106 IntStatus RIT_GetIntStatus(LPC_RIT_TypeDef *RITx); 00107 00108 /** 00109 * @} 00110 */ 00111 00112 #ifdef __cplusplus 00113 } 00114 #endif 00115 00116 #endif /* LPC17XX_RIT_H_ */ 00117 00118 /** 00119 * @} 00120 */ 00121 00122 /* --------------------------------- End Of File ------------------------------ */
Generated on Tue Jul 12 2022 17:06:02 by 1.7.2