OpenMPTL - STM32F10X
C++ Microprocessor Template Library
tim.hpp
Go to the documentation of this file.
1 /*
2  * OpenMPTL - C++ Microprocessor Template Library
3  *
4  * Copyright (C) 2012-2017 Axel Burri <axel@tty0.ch>
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program. If not, see <http://www.gnu.org/licenses/>.
18  *
19  */
20 
21 /*
22  * This program contains derivative representations of CMSIS System
23  * View Description (SVD) files, and is subject to the "End User
24  * License Agreement for STMicroelectronics" (see "STM_License.html"
25  * in the containing directory).
26  */
27 
28 #ifndef ARCH_REG_TIM_HPP_INCLUDED
29 #define ARCH_REG_TIM_HPP_INCLUDED
30 
31 #include "../../../../common/reg/tim.hpp"
32 
33 namespace mptl {
34 
35 template<unsigned tim_no>
36 class TIM
37 {
38  /* See available template specialisations below if the compiler asserts here! */
39  static_assert(tim_no == !tim_no, "unsupported TIM number"); // assertion needs to be dependent of template parameter
40 };
41 
42 template<> class TIM< 1 > : public TIM_common< 0x40012c00 > { };
43 template<> class TIM< 2 > : public TIM_common< 0x40000000 > { };
44 template<> class TIM< 3 > : public TIM_common< 0x40000400 > { };
45 template<> class TIM< 4 > : public TIM_common< 0x40000800 > { };
46 template<> class TIM< 5 > : public TIM_common< 0x40000c00 > { };
47 template<> class TIM< 6 > : public TIM_common< 0x40001000 > { };
48 template<> class TIM< 7 > : public TIM_common< 0x40001400 > { };
49 template<> class TIM< 8 > : public TIM_common< 0x40013400 > { };
50 template<> class TIM< 9 > : public TIM_common< 0x40014c00 > { };
51 template<> class TIM< 10 > : public TIM_common< 0x40015000 > { };
52 template<> class TIM< 11 > : public TIM_common< 0x40015400 > { };
53 template<> class TIM< 12 > : public TIM_common< 0x40001800 > { };
54 template<> class TIM< 13 > : public TIM_common< 0x40001c00 > { };
55 template<> class TIM< 14 > : public TIM_common< 0x40002000 > { };
56 
57 } // namespace mptl
58 
59 #endif // ARCH_REG_TIM_HPP_INCLUDED
Definition: tim.hpp:36