]> git.sur5r.net Git - freertos/blob - FreeRTOS/Demo/CORTEX_M4F_MSP432_LaunchPad_IAR_CCS_Keil/driverlib/systick.h
Final V8.2.1 release ready for tagging:
[freertos] / FreeRTOS / Demo / CORTEX_M4F_MSP432_LaunchPad_IAR_CCS_Keil / driverlib / systick.h
1 /*
2  * -------------------------------------------
3  *    MSP432 DriverLib - v01_04_00_18 
4  * -------------------------------------------
5  *
6  * --COPYRIGHT--,BSD,BSD
7  * Copyright (c) 2015, Texas Instruments Incorporated
8  * All rights reserved.
9  *
10  * Redistribution and use in source and binary forms, with or without
11  * modification, are permitted provided that the following conditions
12  * are met:
13  *
14  * *  Redistributions of source code must retain the above copyright
15  *    notice, this list of conditions and the following disclaimer.
16  *
17  * *  Redistributions in binary form must reproduce the above copyright
18  *    notice, this list of conditions and the following disclaimer in the
19  *    documentation and/or other materials provided with the distribution.
20  *
21  * *  Neither the name of Texas Instruments Incorporated nor the names of
22  *    its contributors may be used to endorse or promote products derived
23  *    from this software without specific prior written permission.
24  *
25  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
26  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
27  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
28  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
29  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
30  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
31  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
32  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
33  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
34  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
35  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36  * --/COPYRIGHT--*/
37 #ifndef __SYSTICK_H__
38 #define __SYSTICK_H__
39
40 //*****************************************************************************
41 //
42 //! \addtogroup systick_api
43 //! @{
44 //
45 //*****************************************************************************
46
47 //*****************************************************************************
48 //
49 // If building with a C++ compiler, make all of the definitions in this header
50 // have a C binding.
51 //
52 //*****************************************************************************
53 #ifdef __cplusplus
54 extern "C"
55 {
56 #endif
57 #include <stdint.h>
58
59 //*****************************************************************************
60 //
61 // Prototypes for the APIs.
62 //
63 //*****************************************************************************
64
65 //*****************************************************************************
66 //
67 //! Enables the SysTick counter.
68 //!
69 //! This function starts the SysTick counter.  If an interrupt handler has been
70 //! registered, it is called when the SysTick counter rolls over.
71 //!
72 //! \note Calling this function causes the SysTick counter to (re)commence
73 //! counting from its current value.  The counter is not automatically reloaded
74 //! with the period as specified in a previous call to SysTick_setPeriod().  If
75 //! an immediate reload is required, the \b NVIC_ST_CURRENT register must be
76 //! written to force the reload.  Any write to this register clears the SysTick
77 //! counter to 0 and causes a reload with the supplied period on the next
78 //! clock.
79 //!
80 //! \return None.
81 //
82 //*****************************************************************************
83 extern void SysTick_enableModule(void);
84
85 //*****************************************************************************
86 //
87 //! Disables the SysTick counter.
88 //!
89 //! This function stops the SysTick counter.  If an interrupt handler has been
90 //! registered, it is not called until SysTick is restarted.
91 //!
92 //! \return None.
93 //
94 //*****************************************************************************
95 extern void SysTick_disableModule(void);
96
97 //*****************************************************************************
98 //
99 //! Registers an interrupt handler for the SysTick interrupt.
100 //!
101 //! \param intHandler is a pointer to the function to be called when the
102 //! SysTick interrupt occurs.
103 //!
104 //! This function registers the handler to be called when a SysTick interrupt
105 //! occurs.
106 //!
107 //! \sa Interrupt_registerInterrupt() for important information about
108 //! registering interrupt handlers.
109 //!
110 //! \return None.
111 //
112 //*****************************************************************************
113 extern void SysTick_registerInterrupt(void (*intHandler)(void));
114
115 //*****************************************************************************
116 //
117 //! Unregisters the interrupt handler for the SysTick interrupt.
118 //!
119 //! This function unregisters the handler to be called when a SysTick interrupt
120 //! occurs.
121 //!
122 //! \sa Interrupt_registerInterrupt() for important information about
123 //! registering interrupt handlers.
124 //!
125 //! \return None.
126 //
127 //*****************************************************************************
128 extern void SysTick_unregisterInterrupt(void);
129
130 //*****************************************************************************
131 //
132 //! Enables the SysTick interrupt.
133 //!
134 //! This function enables the SysTick interrupt, allowing it to be
135 //! reflected to the processor.
136 //!
137 //! \note The SysTick interrupt handler is not required to clear the SysTick
138 //! interrupt source because it is cleared automatically by the NVIC when the
139 //! interrupt handler is called.
140 //!
141 //! \return None.
142 //
143 //*****************************************************************************
144 extern void SysTick_enableInterrupt(void);
145
146 //*****************************************************************************
147 //
148 //! Disables the SysTick interrupt.
149 //!
150 //! This function disables the SysTick interrupt, preventing it from being
151 //! reflected to the processor.
152 //!
153 //! \return None.
154 //
155 //*****************************************************************************
156 extern void SysTick_disableInterrupt(void);
157
158 //*****************************************************************************
159 //
160 //! Sets the period of the SysTick counter.
161 //!
162 //! \param period is the number of clock ticks in each period of the SysTick
163 //! counter and must be between 1 and 16,777,216, inclusive.
164 //!
165 //! This function sets the rate at which the SysTick counter wraps, which
166 //! equates to the number of processor clocks between interrupts.
167 //!
168 //! \note Calling this function does not cause the SysTick counter to reload
169 //! immediately.  If an immediate reload is required, the \b NVIC_ST_CURRENT
170 //! register must be written.  Any write to this register clears the SysTick
171 //! counter to 0 and causes a reload with the \e period supplied here on
172 //! the next clock after SysTick is enabled.
173 //!
174 //! \return None.
175 //
176 //*****************************************************************************
177 extern void SysTick_setPeriod(uint32_t period);
178
179 //*****************************************************************************
180 //
181 //! Gets the period of the SysTick counter.
182 //!
183 //! This function returns the rate at which the SysTick counter wraps, which
184 //! equates to the number of processor clocks between interrupts.
185 //!
186 //! \return Returns the period of the SysTick counter.
187 //
188 //*****************************************************************************
189 extern uint32_t SysTick_getPeriod(void);
190
191 //*****************************************************************************
192 //
193 //! Gets the current value of the SysTick counter.
194 //!
195 //! This function returns the current value of the SysTick counter, which is
196 //! a value between the period - 1 and zero, inclusive.
197 //!
198 //! \return Returns the current value of the SysTick counter.
199 //
200 //*****************************************************************************
201 extern uint32_t SysTick_getValue(void);
202
203 //*****************************************************************************
204 //
205 // Mark the end of the C bindings section for C++ compilers.
206 //
207 //*****************************************************************************
208 #ifdef __cplusplus
209 }
210 #endif
211
212 //*****************************************************************************
213 //
214 // Close the Doxygen group.
215 //! @}
216 //
217 //*****************************************************************************
218
219 #endif // __SYSTICK_H__