1 //*****************************************************************************
2 //
3 //  am_hal_systick.h
4 //! @file
5 //!
6 //! @brief Functions for accessing and configuring the SYSTICK.
7 //!
8 //! @addtogroup systick2 System Timer (SYSTICK)
9 //! @ingroup apollo2hal
10 //! @{
11 //
12 //*****************************************************************************
13 
14 //*****************************************************************************
15 //
16 // Copyright (c) 2017, Ambiq Micro
17 // All rights reserved.
18 //
19 // Redistribution and use in source and binary forms, with or without
20 // modification, are permitted provided that the following conditions are met:
21 //
22 // 1. Redistributions of source code must retain the above copyright notice,
23 // this list of conditions and the following disclaimer.
24 //
25 // 2. Redistributions in binary form must reproduce the above copyright
26 // notice, this list of conditions and the following disclaimer in the
27 // documentation and/or other materials provided with the distribution.
28 //
29 // 3. Neither the name of the copyright holder nor the names of its
30 // contributors may be used to endorse or promote products derived from this
31 // software without specific prior written permission.
32 //
33 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
34 // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
35 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
36 // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
37 // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
38 // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
39 // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
40 // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
41 // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
42 // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
43 // POSSIBILITY OF SUCH DAMAGE.
44 //
45 // This is part of revision 1.2.11 of the AmbiqSuite Development Package.
46 //
47 //*****************************************************************************
48 #ifndef AM_HAL_SYSTICK_H
49 #define AM_HAL_SYSTICK_H
50 
51 #ifdef __cplusplus
52 extern "C"
53 {
54 #endif
55 
56 //*****************************************************************************
57 //
58 // External function definitions
59 //
60 //*****************************************************************************
61 extern void am_hal_systick_start(void);
62 extern void am_hal_systick_stop(void);
63 extern void am_hal_systick_int_enable(void);
64 extern void am_hal_systick_int_disable(void);
65 extern uint32_t am_hal_systick_int_status_get(void);
66 extern void am_hal_systick_reset(void);
67 extern void am_hal_systick_load(uint32_t ui32LoadVal);
68 extern uint32_t am_hal_systick_count(void);
69 extern uint32_t am_hal_systick_wait_ticks(uint32_t u32Ticks);
70 extern uint32_t am_hal_systick_delay_us(uint32_t u32NumUs);
71 
72 #ifdef __cplusplus
73 }
74 #endif
75 
76 #endif // AM_HAL_SYSTICK_H
77 
78 //*****************************************************************************
79 //
80 // End Doxygen group.
81 //! @}
82 //
83 //*****************************************************************************
84