2 * @brief Alarm Timer Registers and control functions
\r
5 * Copyright(C) NXP Semiconductors, 2012
\r
6 * All rights reserved.
\r
9 * Software that is described herein is for illustrative purposes only
\r
10 * which provides customers with programming information regarding the
\r
11 * LPC products. This software is supplied "AS IS" without any warranties of
\r
12 * any kind, and NXP Semiconductors and its licensor disclaim any and
\r
13 * all warranties, express or implied, including all implied warranties of
\r
14 * merchantability, fitness for a particular purpose and non-infringement of
\r
15 * intellectual property rights. NXP Semiconductors assumes no responsibility
\r
16 * or liability for the use of the software, conveys no license or rights under any
\r
17 * patent, copyright, mask work right, or any other intellectual property rights in
\r
18 * or to any products. NXP Semiconductors reserves the right to make changes
\r
19 * in the software without notification. NXP Semiconductors also makes no
\r
20 * representation or warranty that such application will be suitable for the
\r
21 * specified use without further testing or modification.
\r
24 * Permission to use, copy, modify, and distribute this software and its
\r
25 * documentation is hereby granted, under NXP Semiconductors' and its
\r
26 * licensor's relevant copyrights in the software, without fee, provided that it
\r
27 * is used in conjunction with NXP Semiconductors microcontrollers. This
\r
28 * copyright, permission, and disclaimer notice must appear in all copies of
\r
32 #ifndef __ATIMER_001_H_
\r
33 #define __ATIMER_001_H_
\r
35 #include "sys_config.h"
\r
42 /** @defgroup IP_ATIMER_001 IP: ATimer register block and driver
\r
43 * @ingroup IP_Drivers
\r
49 * @brief Alarm Timer register block structure
\r
51 typedef struct { /*!< ATIMER Structure */
\r
52 __IO uint32_t DOWNCOUNTER; /*!< Downcounter register */
\r
53 __IO uint32_t PRESET; /*!< Preset value register */
\r
54 __I uint32_t RESERVED0[1012];
\r
55 __O uint32_t CLR_EN; /*!< Interrupt clear enable register */
\r
56 __O uint32_t SET_EN; /*!< Interrupt set enable register */
\r
57 __I uint32_t STATUS; /*!< Status register */
\r
58 __I uint32_t ENABLE; /*!< Enable register */
\r
59 __O uint32_t CLR_STAT; /*!< Clear register */
\r
60 __O uint32_t SET_STAT; /*!< Set register */
\r
64 * @brief Close ATIMER device
\r
65 * @param pATimer : Pointer to timer device
\r
67 * @note Important: 32KHz clock must be enabled in CREG prior to this call. See
\r
68 * the User Manual for more information.
\r
70 void IP_ATIMER_DeInit(IP_ATIMER_001_T *pATimer);
\r
73 * @brief Clear ATIMER Interrupt Status
\r
74 * @param pATimer : Pointer to timer device
\r
77 STATIC INLINE void IP_ATIMER_ClearIntStatus(IP_ATIMER_001_T *pATimer)
\r
79 pATimer->CLR_STAT = 1;
\r
83 * @brief Set ATIMER Interrupt Status
\r
84 * @param pATimer : Pointer to timer device
\r
87 STATIC INLINE void IP_ATIMER_SetIntStatus(IP_ATIMER_001_T *pATimer)
\r
89 pATimer->SET_STAT = 1;
\r
92 * @brief Enable ATIMER Interrupt
\r
93 * @param pATimer : Pointer to timer device
\r
96 STATIC INLINE void IP_ATIMER_IntEnable(IP_ATIMER_001_T *pATimer)
\r
98 pATimer->SET_EN = 1;
\r
102 * @brief Disable ATIMER Interrupt
\r
103 * @param pATimer : Pointer to timer device
\r
106 STATIC INLINE void IP_ATIMER_IntDisable(IP_ATIMER_001_T *pATimer)
\r
108 pATimer->CLR_EN = 1;
\r
112 * @brief Update Preset value
\r
113 * @param pATimer : Pointer to timer device
\r
114 * @param PresetValue updated preset value
\r
117 STATIC INLINE void IP_ATIMER_UpdatePresetValue(IP_ATIMER_001_T *pATimer, uint32_t PresetValue)
\r
119 pATimer->PRESET = PresetValue;
\r
123 * @brief Read value of preset register
\r
124 * @param pATimer : Pointer to timer/counter device
\r
125 * @return Value of capture register
\r
127 STATIC INLINE uint32_t IP_ATIMER_GetPresetValue(IP_ATIMER_001_T *pATimer)
\r
129 return pATimer->PRESET;
\r
133 * @brief Returns enable state of ATimer interrupt
\r
134 * @param pATimer : Pointer to timer/counter device
\r
135 * @return !0 if the ATimer interrupt is enabled, otherwise 0
\r
137 STATIC INLINE uint32_t IP_ATIMER_GetIntEnableState(IP_ATIMER_001_T *pATimer)
\r
139 return pATimer->ENABLE;
\r
143 * @brief Returns current pending state of ATimer interrupt
\r
144 * @param pATimer : Pointer to timer/counter device
\r
145 * @return !0 if the ATimer interrupt is asserted, otherwise 0
\r
147 STATIC INLINE uint32_t IP_ATIMER_GetIntPendingState(IP_ATIMER_001_T *pATimer)
\r
149 return pATimer->STATUS;
\r
160 #endif /* __ATIMER_001_H_ */
\r