2 * -------------------------------------------
3 * MSP432 DriverLib - v01_04_00_18
4 * -------------------------------------------
6 * --COPYRIGHT--,BSD,BSD
7 * Copyright (c) 2015, Texas Instruments Incorporated
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions
14 * * Redistributions of source code must retain the above copyright
15 * notice, this list of conditions and the following disclaimer.
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.
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.
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.
40 //*****************************************************************************
42 //! \addtogroup systick_api
45 //*****************************************************************************
47 //*****************************************************************************
49 // If building with a C++ compiler, make all of the definitions in this header
52 //*****************************************************************************
59 //*****************************************************************************
61 // Prototypes for the APIs.
63 //*****************************************************************************
65 //*****************************************************************************
67 //! Enables the SysTick counter.
69 //! This function starts the SysTick counter. If an interrupt handler has been
70 //! registered, it is called when the SysTick counter rolls over.
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
82 //*****************************************************************************
83 extern void SysTick_enableModule(void);
85 //*****************************************************************************
87 //! Disables the SysTick counter.
89 //! This function stops the SysTick counter. If an interrupt handler has been
90 //! registered, it is not called until SysTick is restarted.
94 //*****************************************************************************
95 extern void SysTick_disableModule(void);
97 //*****************************************************************************
99 //! Registers an interrupt handler for the SysTick interrupt.
101 //! \param intHandler is a pointer to the function to be called when the
102 //! SysTick interrupt occurs.
104 //! This function registers the handler to be called when a SysTick interrupt
107 //! \sa Interrupt_registerInterrupt() for important information about
108 //! registering interrupt handlers.
112 //*****************************************************************************
113 extern void SysTick_registerInterrupt(void (*intHandler)(void));
115 //*****************************************************************************
117 //! Unregisters the interrupt handler for the SysTick interrupt.
119 //! This function unregisters the handler to be called when a SysTick interrupt
122 //! \sa Interrupt_registerInterrupt() for important information about
123 //! registering interrupt handlers.
127 //*****************************************************************************
128 extern void SysTick_unregisterInterrupt(void);
130 //*****************************************************************************
132 //! Enables the SysTick interrupt.
134 //! This function enables the SysTick interrupt, allowing it to be
135 //! reflected to the processor.
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.
143 //*****************************************************************************
144 extern void SysTick_enableInterrupt(void);
146 //*****************************************************************************
148 //! Disables the SysTick interrupt.
150 //! This function disables the SysTick interrupt, preventing it from being
151 //! reflected to the processor.
155 //*****************************************************************************
156 extern void SysTick_disableInterrupt(void);
158 //*****************************************************************************
160 //! Sets the period of the SysTick counter.
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.
165 //! This function sets the rate at which the SysTick counter wraps, which
166 //! equates to the number of processor clocks between interrupts.
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.
176 //*****************************************************************************
177 extern void SysTick_setPeriod(uint32_t period);
179 //*****************************************************************************
181 //! Gets the period of the SysTick counter.
183 //! This function returns the rate at which the SysTick counter wraps, which
184 //! equates to the number of processor clocks between interrupts.
186 //! \return Returns the period of the SysTick counter.
188 //*****************************************************************************
189 extern uint32_t SysTick_getPeriod(void);
191 //*****************************************************************************
193 //! Gets the current value of the SysTick counter.
195 //! This function returns the current value of the SysTick counter, which is
196 //! a value between the period - 1 and zero, inclusive.
198 //! \return Returns the current value of the SysTick counter.
200 //*****************************************************************************
201 extern uint32_t SysTick_getValue(void);
203 //*****************************************************************************
205 // Mark the end of the C bindings section for C++ compilers.
207 //*****************************************************************************
212 //*****************************************************************************
214 // Close the Doxygen group.
217 //*****************************************************************************
219 #endif // __SYSTICK_H__