]> git.sur5r.net Git - freertos/blob - FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/LPCOpen/lpc_core/lpc_chip/chip_18xx_43xx/sct_18xx_43xx.h
Update LPC18xx FreeRTOS+UDP demo to use LPCOpen USB and Ethernet drivers.
[freertos] / FreeRTOS-Plus / Demo / FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC / ThirdParty / LPCOpen / lpc_core / lpc_chip / chip_18xx_43xx / sct_18xx_43xx.h
1 /*\r
2  * @brief LPC18xx/43xx State Configurable Timer driver\r
3  *\r
4  * @note\r
5  * Copyright(C) NXP Semiconductors, 2012\r
6  * All rights reserved.\r
7  *\r
8  * @par\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
22  *\r
23  * @par\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
29  * this code.\r
30  */\r
31 \r
32 #ifndef __SCT_18XX_43XX_H_\r
33 #define __SCT_18XX_43XX_H_\r
34 \r
35 #ifdef __cplusplus\r
36 extern "C" {\r
37 #endif\r
38 \r
39 /** @defgroup SCT_18XX_43XX CHIP: LPC18xx/43xx State Configurable Timer driver\r
40  * @ingroup CHIP_18XX_43XX_Drivers\r
41  * @{\r
42  */\r
43 \r
44 /**\r
45  * @brief       Initialize SCT\r
46  * @param       pSCT                    : Pointer to SCT register block\r
47  * @return      Nothing\r
48  */\r
49 void Chip_SCT_Init(LPC_SCT_T *pSCT);\r
50 \r
51 /**\r
52  * @brief       Shutdown SCT\r
53  * @param       pSCT                    : Pointer to SCT register block\r
54  * @return      Nothing\r
55  */\r
56 void Chip_SCT_DeInit(LPC_SCT_T *pSCT);\r
57 \r
58 /**\r
59  * @brief       Configure SCT\r
60  * @param       pSCT                    : Pointer to SCT register block\r
61  * @param       value                   : SCT Configuration register value\r
62  * @return      Nothing\r
63  * Initialise the SCT configuration register with \a value\r
64  */\r
65 STATIC INLINE void Chip_SCT_Config(LPC_SCT_T *pSCT, uint32_t value)\r
66 {\r
67         IP_SCT_Config(pSCT, value);\r
68 }\r
69 \r
70 /**\r
71  * @brief       Set or Clear the Control register\r
72  * @param       pSCT                    : Pointer to SCT register block\r
73  * @param       value                   : SCT Control register value\r
74  * @param       ena             : ENABLE - To set the fields specified by value\r
75  *                          : DISABLE - To clear the field specified by value\r
76  * @return      Nothing\r
77  * Set or clear the control register bits as specified by the \a value\r
78  * parameter. If \a ena is set to ENABLE, the mentioned register fields\r
79  * will be set. If \a ena is set to DISABLE, the mentioned register\r
80  * fields will be cleared\r
81  */\r
82 STATIC INLINE void Chip_SCT_ControlSetClr(LPC_SCT_T *pSCT, uint32_t value, FunctionalState ena)\r
83 {\r
84         IP_SCT_ControlSetClr(pSCT, value, ena);\r
85 }\r
86 \r
87 /**\r
88  * @brief       Set the conflict resolution\r
89  * @param       pSCT                    : Pointer to SCT register block\r
90  * @param       outnum                  : Output number\r
91  * @param       value           : Output value\r
92  *                          - SCT_RES_NOCHANGE          :No change\r
93  *                                              - SCT_RES_SET_OUTPUT    :Set output\r
94  *                                              - SCT_RES_CLEAR_OUTPUT  :Clear output\r
95  *                                              - SCT_RES_TOGGLE_OUTPUT :Toggle output\r
96  *                          : SCT_RES_NOCHANGE\r
97  *                          : DISABLE - To clear the field specified by value\r
98  * @return      Nothing\r
99  * Set conflict resolution for the output \a outnum\r
100  */\r
101 STATIC INLINE void Chip_SCT_ConflictResolutionSet(LPC_SCT_T *pSCT, uint8_t outnum, uint8_t value)\r
102 {\r
103         IP_SCT_ConflictResolutionSet(pSCT, outnum, value);\r
104 }\r
105 \r
106 /**\r
107  * @brief       Clear the SCT event flag\r
108  * @param       pSCT                    : Pointer to SCT register block\r
109  * @param       even_num                : SCT Event number\r
110  * @return      Nothing\r
111  * Clear the SCT event flag for the specified event \a even_num\r
112  */\r
113 STATIC INLINE void Chip_SCT_EventFlagClear(LPC_SCT_T *pSCT, uint8_t even_num)\r
114 {\r
115         IP_SCT_EventFlagClear(pSCT, even_num);\r
116 }\r
117 \r
118 /**\r
119  * @}\r
120  */\r
121 \r
122 #ifdef __cplusplus\r
123 }\r
124 #endif\r
125 \r
126 #endif /* __SCT_18XX_43XX_H_ */\r