ConOpSys V2970  P004.07
ANVILEX control operating system
TIMER2_STM32F429.h
Go to the documentation of this file.
1 //------------------------------------------------------------------------------
2 //! @file TIMER2_STM32F429.h
3 //! @brief STM32F429 on-chip TIMER2 module class header file.
4 //! @attention No special attention requered.
5 //! @copyright (C) 2015-2020 ANVILEX LLC
6 //! $HeadURL: https://192.168.3.4:8443/svn/P004_07/ConOpSys/Targets/STM32F429/TIMER2_STM32F429.h $
7 //! $Revision: 2781 $
8 //! $Date: 2021-07-07 13:45:04 +0500 (Mi, 07 Jul 2021) $
9 //! $Author: minch $
10 //------------------------------------------------------------------------------
11 //
12 // Redistribution and use in source and binary forms, with or without
13 // modification, are permitted provided that the following conditions are met:
14 //
15 // 1. Redistributions of source code must retain the above copyright notice,
16 // this list of conditions and the following disclaimer.
17 //
18 // 2. Redistributions in binary form must reproduce the above copyright notice,
19 // this list of conditions and the following disclaimer in the documentation
20 // and/or other materials provided with the distribution.
21 //
22 // 3. Neither the name of ANVILEX nor the names of its contributors may be
23 // used to endorse or promote products derived from this software without
24 // specific prior written permission.
25 //
26 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
27 // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
28 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
29 // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
30 // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
31 // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
32 // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
33 // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
34 // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
35 // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36 // POSSIBILITY OF SUCH DAMAGE.
37 //
38 //------------------------------------------------------------------------------
39 
40 #pragma once
41 
42 //------------------------------------------------------------------------------
43 // Include project files
44 //------------------------------------------------------------------------------
45 
47 
48 //------------------------------------------------------------------------------
49 // Class drfinitions
50 //------------------------------------------------------------------------------
51 
52 //! @brief System timer class
53 //! @details High resolution timer is used for implementing of the diverse delays and time intervals.
55 {
56 
57  //----------------------------------------------------------------------------
58  // Public methods, variables and definitions
59  //----------------------------------------------------------------------------
60 
61  public:
62 
63  //!-------------------------------------------------------------------------
64  //! @brief Set timer 2 input clock frequency method.
65  //! @note None
66  //! @param [in] u32_Clock - Timer input clock in herz
67  //! @return BOOL - Execution status
68  //! @retval false - Execution without errors
69  //! @retval true - Execution without any errors
70  //! \par Override
71  //! Optional
72  //! @attention None
73  //--------------------------------------------------------------------------
74 
75  virtual BOOL Configure_Clock( U32 u32_Clock );
76 
77  //!-------------------------------------------------------------------------
78  //! @brief Enable interrupt method.
79  //! @note None
80  //! @param [in] u32_Interrupt_Priority - Timer inperrupt priority
81  //! @return None
82  //! \par Override
83  //! Not allowed
84  //! @attention None
85  //--------------------------------------------------------------------------
86 
87  virtual VOID Interrupt_Enable( U32 u32_Interrupt_Priority );
88 
89  //!-------------------------------------------------------------------------
90  //! @brief Disable interrupt method.
91  //! @note None
92  //! @return None
93  //! \par Override
94  //! Not allowed
95  //! @attention None
96  //--------------------------------------------------------------------------
97 
98  virtual VOID Interrupt_Disable();
99 
100  //!-------------------------------------------------------------------------
101  //! @brief Start timer operation method.
102  //! @note None
103  //! @return None
104  //! \par Override
105  //! Not allowed
106  //! @attention None
107  //--------------------------------------------------------------------------
108 
109  virtual VOID Start();
110 
111  //!-------------------------------------------------------------------------
112  //! @brief Stop timer operation method.
113  //! @note None
114  //! @return None
115  //! \par Override
116  //! Not allowed
117  //! @attention None
118  //--------------------------------------------------------------------------
119 
120  virtual VOID Stop();
121 /*
122  //!-------------------------------------------------------------------------
123  //! @brief Get actual time in timer counts as U32 method.
124  //! @note None
125  //! @return U32 - Actual time in timer counts as U32.
126  //! \par Override
127  //! Not allowed
128  //! @attention None
129  //--------------------------------------------------------------------------
130 
131  virtual U32 Get_Actual_Time();
132 */
133  //!-------------------------------------------------------------------------
134  //! @brief Get actual time in timer counts as U64 method.
135  //! @note None
136  //! @return U32 - Actual time in timer counts as U64.
137  //! \par Override
138  //! Not allowed
139  //! @attention None
140  //--------------------------------------------------------------------------
141 
142  virtual U64 Get_Actual_Time_U64();
143 
144  //!-------------------------------------------------------------------------
145  //! @brief High precision timer interrupt method.
146  //! @note None
147  //! @return None
148  //! \par Override
149  //! Not allowed
150  //! @attention None
151  //--------------------------------------------------------------------------
152 
153  VOID Interrupt();
154 
155  //----------------------------------------------------------------------------
156  // Protected methods, variables and definitions
157  //----------------------------------------------------------------------------
158 
159  protected:
160 
161  //----------------------------------------------------------------------------
162  // Private methods, variables and definitions
163  //----------------------------------------------------------------------------
164 
165  private:
166 
167 };
168 
169 //------------------------------------------------------------------------------
170 // End of file
171 //------------------------------------------------------------------------------
int BOOL
Boolean datatype definition.
Definition: Defines.h:124
unsigned long long U64
Binary 64-Bit unsigned integer datatype defenition.
Definition: Defines.h:213
void VOID
Datatypesess datatype definition.
Definition: Defines.h:105
unsigned long U32
Binary 32-Bit unsigned integer datatype defenition.
Definition: Defines.h:203
High precision timer base class header file.
High precision timer base class.
Definition: High_Precision_Timer_Base.h:66
System timer class.
Definition: TIMER2_STM32F429.h:55
VOID Interrupt()
High precision timer interrupt method.
Definition: TIMER2_STM32F429.cpp:243
virtual U64 Get_Actual_Time_U64()
Get actual time in timer counts as U64 method.
Definition: TIMER2_STM32F429.cpp:216
virtual VOID Start()
Start timer operation method.
Definition: TIMER2_STM32F429.cpp:133
virtual VOID Interrupt_Enable(U32 u32_Interrupt_Priority)
Enable interrupt method.
Definition: TIMER2_STM32F429.cpp:182
virtual VOID Stop()
Stop timer operation method.
Definition: TIMER2_STM32F429.cpp:160
virtual VOID Interrupt_Disable()
Disable interrupt method.
Definition: TIMER2_STM32F429.cpp:193
virtual BOOL Configure_Clock(U32 u32_Clock)
Set timer 2 input clock frequency method.
Definition: TIMER2_STM32F429.cpp:67