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_rit.h
frank26080115 0:84d7747641aa 3 * @brief Contains all macro definitions and function prototypes
frank26080115 0:84d7747641aa 4 * support for RIT 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 RIT RIT
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_RIT_H_
frank26080115 0:84d7747641aa 28 #define LPC17XX_RIT_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 RIT_Private_Macros RIT Private Macros
frank26080115 0:84d7747641aa 43 * @{
frank26080115 0:84d7747641aa 44 */
frank26080115 0:84d7747641aa 45
frank26080115 0:84d7747641aa 46 /* --------------------- BIT DEFINITIONS -------------------------------------- */
frank26080115 0:84d7747641aa 47 /*********************************************************************//**
frank26080115 0:84d7747641aa 48 * Macro defines for RIT control register
frank26080115 0:84d7747641aa 49 **********************************************************************/
frank26080115 0:84d7747641aa 50 /** Set interrupt flag when the counter value equals the masked compare value */
frank26080115 0:84d7747641aa 51 #define RIT_CTRL_INTEN ((uint32_t) (1))
frank26080115 0:84d7747641aa 52 /** Set timer enable clear to 0 when the counter value equals the masked compare value */
frank26080115 0:84d7747641aa 53 #define RIT_CTRL_ENCLR ((uint32_t) _BIT(1))
frank26080115 0:84d7747641aa 54 /** Set timer enable on debug */
frank26080115 0:84d7747641aa 55 #define RIT_CTRL_ENBR ((uint32_t) _BIT(2))
frank26080115 0:84d7747641aa 56 /** Set timer enable */
frank26080115 0:84d7747641aa 57 #define RIT_CTRL_TEN ((uint32_t) _BIT(3))
frank26080115 0:84d7747641aa 58
frank26080115 0:84d7747641aa 59 /** Macro to determine if it is valid RIT peripheral */
frank26080115 0:84d7747641aa 60 #define PARAM_RITx(n) (((uint32_t *)n)==((uint32_t *)LPC_RIT))
frank26080115 0:84d7747641aa 61 /**
frank26080115 0:84d7747641aa 62 * @}
frank26080115 0:84d7747641aa 63 */
frank26080115 0:84d7747641aa 64
frank26080115 0:84d7747641aa 65
frank26080115 0:84d7747641aa 66
frank26080115 0:84d7747641aa 67 /* Public Functions ----------------------------------------------------------- */
frank26080115 0:84d7747641aa 68 /** @defgroup RIT_Public_Functions RIT Public Functions
frank26080115 0:84d7747641aa 69 * @{
frank26080115 0:84d7747641aa 70 */
frank26080115 0:84d7747641aa 71 /* RIT Init/DeInit functions */
frank26080115 0:84d7747641aa 72 void RIT_Init(LPC_RIT_TypeDef *RITx);
frank26080115 0:84d7747641aa 73 void RIT_DeInit(LPC_RIT_TypeDef *RITx);
frank26080115 0:84d7747641aa 74
frank26080115 0:84d7747641aa 75 /* RIT config timer functions */
frank26080115 0:84d7747641aa 76 void RIT_TimerConfig(LPC_RIT_TypeDef *RITx, uint32_t time_interval);
frank26080115 0:84d7747641aa 77
frank26080115 0:84d7747641aa 78 /* Enable/Disable RIT functions */
frank26080115 0:84d7747641aa 79 void RIT_TimerClearCmd(LPC_RIT_TypeDef *RITx, FunctionalState NewState);
frank26080115 0:84d7747641aa 80 void RIT_Cmd(LPC_RIT_TypeDef *RITx, FunctionalState NewState);
frank26080115 0:84d7747641aa 81 void RIT_TimerDebugCmd(LPC_RIT_TypeDef *RITx, FunctionalState NewState);
frank26080115 0:84d7747641aa 82
frank26080115 0:84d7747641aa 83 /* RIT Interrupt functions */
frank26080115 0:84d7747641aa 84 IntStatus RIT_GetIntStatus(LPC_RIT_TypeDef *RITx);
frank26080115 0:84d7747641aa 85
frank26080115 0:84d7747641aa 86 /**
frank26080115 0:84d7747641aa 87 * @}
frank26080115 0:84d7747641aa 88 */
frank26080115 0:84d7747641aa 89
frank26080115 0:84d7747641aa 90 #ifdef __cplusplus
frank26080115 0:84d7747641aa 91 }
frank26080115 0:84d7747641aa 92 #endif
frank26080115 0:84d7747641aa 93
frank26080115 0:84d7747641aa 94 #endif /* LPC17XX_RIT_H_ */
frank26080115 0:84d7747641aa 95
frank26080115 0:84d7747641aa 96 /**
frank26080115 0:84d7747641aa 97 * @}
frank26080115 0:84d7747641aa 98 */
frank26080115 0:84d7747641aa 99
frank26080115 0:84d7747641aa 100 /* --------------------------------- End Of File ------------------------------ */