lpc17xx_rit.h (3773B)
1 /********************************************************************** 2 * $Id$ lpc17xx_rit.h 2010-05-21 3 *//** 4 * @file lpc17xx_rit.h 5 * @brief Contains all macro definitions and function prototypes 6 * support for RIT firmware library on LPC17xx 7 * @version 2.0 8 * @date 21. May. 2010 9 * @author NXP MCU SW Application Team 10 * 11 * Copyright(C) 2010, NXP Semiconductor 12 * All rights reserved. 13 * 14 *********************************************************************** 15 * Software that is described herein is for illustrative purposes only 16 * which provides customers with programming information regarding the 17 * products. This software is supplied "AS IS" without any warranties. 18 * NXP Semiconductors assumes no responsibility or liability for the 19 * use of the software, conveys no license or title under any patent, 20 * copyright, or mask work right to the product. NXP Semiconductors 21 * reserves the right to make changes in the software without 22 * notification. NXP Semiconductors also make no representation or 23 * warranty that such application will be suitable for the specified 24 * use without further testing or modification. 25 * Permission to use, copy, modify, and distribute this software and its 26 * documentation is hereby granted, under NXP Semiconductors' 27 * relevant copyright in the software, without fee, provided that it 28 * is used in conjunction with NXP Semiconductors microcontrollers. This 29 * copyright, permission, and disclaimer notice must appear in all copies of 30 * this code. 31 **********************************************************************/ 32 33 /* Peripheral group ----------------------------------------------------------- */ 34 /** @defgroup RIT RIT (Repetitive Interrupt Timer) 35 * @ingroup LPC1700CMSIS_FwLib_Drivers 36 * @{ 37 */ 38 39 #ifndef LPC17XX_RIT_H_ 40 #define LPC17XX_RIT_H_ 41 42 /* Includes ------------------------------------------------------------------- */ 43 #include "LPC17xx.h" 44 #include "lpc_types.h" 45 46 47 #ifdef __cplusplus 48 extern "C" 49 { 50 #endif 51 52 53 /* Private Macros ------------------------------------------------------------- */ 54 /** @defgroup RIT_Private_Macros RIT Private Macros 55 * @{ 56 */ 57 58 /* --------------------- BIT DEFINITIONS -------------------------------------- */ 59 /*********************************************************************//** 60 * Macro defines for RIT control register 61 **********************************************************************/ 62 /** Set interrupt flag when the counter value equals the masked compare value */ 63 #define RIT_CTRL_INTEN ((uint32_t) (1)) 64 /** Set timer enable clear to 0 when the counter value equals the masked compare value */ 65 #define RIT_CTRL_ENCLR ((uint32_t) _BIT(1)) 66 /** Set timer enable on debug */ 67 #define RIT_CTRL_ENBR ((uint32_t) _BIT(2)) 68 /** Set timer enable */ 69 #define RIT_CTRL_TEN ((uint32_t) _BIT(3)) 70 71 /** Macro to determine if it is valid RIT peripheral */ 72 #define PARAM_RITx(n) (((uint32_t *)n)==((uint32_t *)LPC_RIT)) 73 /** 74 * @} 75 */ 76 77 78 79 /* Public Functions ----------------------------------------------------------- */ 80 /** @defgroup RIT_Public_Functions RIT Public Functions 81 * @{ 82 */ 83 /* RIT Init/DeInit functions */ 84 void RIT_Init(LPC_RIT_TypeDef *RITx); 85 void RIT_DeInit(LPC_RIT_TypeDef *RITx); 86 87 /* RIT config timer functions */ 88 void RIT_TimerConfig(LPC_RIT_TypeDef *RITx, uint32_t time_interval); 89 90 /* Enable/Disable RIT functions */ 91 void RIT_TimerClearCmd(LPC_RIT_TypeDef *RITx, FunctionalState NewState); 92 void RIT_Cmd(LPC_RIT_TypeDef *RITx, FunctionalState NewState); 93 void RIT_TimerDebugCmd(LPC_RIT_TypeDef *RITx, FunctionalState NewState); 94 95 /* RIT Interrupt functions */ 96 IntStatus RIT_GetIntStatus(LPC_RIT_TypeDef *RITx); 97 98 /** 99 * @} 100 */ 101 102 #ifdef __cplusplus 103 } 104 #endif 105 106 #endif /* LPC17XX_RIT_H_ */ 107 108 /** 109 * @} 110 */ 111 112 /* --------------------------------- End Of File ------------------------------ */