1 /**********************************************************************
\r
2 * $Id$ lpc18xx_rit.h 2011-06-02
\r
4 * @file lpc18xx_rit.h
\r
5 * @brief Contains all macro definitions and function prototypes
\r
6 * support for RIT firmware library on LPC18xx
\r
8 * @date 02. June. 2011
\r
9 * @author NXP MCU SW Application Team
\r
11 * Copyright(C) 2011, NXP Semiconductor
\r
12 * All rights reserved.
\r
14 ***********************************************************************
\r
15 * Software that is described herein is for illustrative purposes only
\r
16 * which provides customers with programming information regarding the
\r
17 * products. This software is supplied "AS IS" without any warranties.
\r
18 * NXP Semiconductors assumes no responsibility or liability for the
\r
19 * use of the software, conveys no license or title under any patent,
\r
20 * copyright, or mask work right to the product. NXP Semiconductors
\r
21 * reserves the right to make changes in the software without
\r
22 * notification. NXP Semiconductors also make no representation or
\r
23 * warranty that such application will be suitable for the specified
\r
24 * use without further testing or modification.
\r
25 **********************************************************************/
\r
27 /* Peripheral group ----------------------------------------------------------- */
\r
28 /** @defgroup RIT RIT (Repetitive Interrupt Timer)
\r
29 * @ingroup LPC1800CMSIS_FwLib_Drivers
\r
33 #ifndef LPC18XX_RIT_H_
\r
34 #define LPC18XX_RIT_H_
\r
36 /* Includes ------------------------------------------------------------------- */
\r
37 #include "LPC18xx.h"
\r
38 #include "lpc_types.h"
\r
47 /* Private Macros ------------------------------------------------------------- */
\r
48 /** @defgroup RIT_Private_Macros RIT Private Macros
\r
52 /* --------------------- BIT DEFINITIONS -------------------------------------- */
\r
53 /*********************************************************************//**
\r
54 * Macro defines for RIT control register
\r
55 **********************************************************************/
\r
56 /** Set interrupt flag when the counter value equals the masked compare value */
\r
57 #define RIT_CTRL_INTEN ((uint32_t) (1))
\r
58 /** Set timer enable clear to 0 when the counter value equals the masked compare value */
\r
59 #define RIT_CTRL_ENCLR ((uint32_t) _BIT(1))
\r
60 /** Set timer enable on debug */
\r
61 #define RIT_CTRL_ENBR ((uint32_t) _BIT(2))
\r
62 /** Set timer enable */
\r
63 #define RIT_CTRL_TEN ((uint32_t) _BIT(3))
\r
65 /** Macro to determine if it is valid RIT peripheral */
\r
66 #define PARAM_RITx(n) (((uint32_t *)n)==((uint32_t *)LPC_RITIMER))
\r
73 /* Public Functions ----------------------------------------------------------- */
\r
74 /** @defgroup RIT_Public_Functions RIT Public Functions
\r
77 /* RIT Init/DeInit functions */
\r
78 void RIT_Init(LPC_RITIMER_Type *RITx);
\r
79 void RIT_DeInit(LPC_RITIMER_Type *RITx);
\r
81 /* RIT config timer functions */
\r
82 void RIT_TimerConfig(LPC_RITIMER_Type *RITx, uint32_t time_interval);
\r
84 /* Enable/Disable RIT functions */
\r
85 void RIT_TimerClearCmd(LPC_RITIMER_Type *RITx, FunctionalState NewState);
\r
86 void RIT_Cmd(LPC_RITIMER_Type *RITx, FunctionalState NewState);
\r
87 void RIT_TimerDebugCmd(LPC_RITIMER_Type *RITx, FunctionalState NewState);
\r
89 /* RIT Interrupt functions */
\r
90 IntStatus RIT_GetIntStatus(LPC_RITIMER_Type *RITx);
\r
100 #endif /* LPC18XX_RIT_H_ */
\r
106 /* --------------------------------- End Of File ------------------------------ */
\r