1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
/** @addtogroup timer_file TIMER peripheral API
*
* @brief <b>Access functions for the Timer/Counter </b>
*
* @ingroup peripheral_apis
* LGPL License Terms @ref lgpl_license
* @author @htmlonly © @endhtmlonly 2016
* Maxim Sloyko <maxims@google.com>
*
*/
/*
* This file is part of the libopencm3 project.
*
* Copyright (C) 2017-2018 Unicore MX project<dev(at)lists(dot)unicore-mx(dot)org>
* Copyright (C) 2021 Eduard Drusa <ventyl86(at)netkosice(dot)sk>
*
* This library is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
/**@{*/
/** @brief Get timer ticks
*
* @param[in] timer uint32_t timer base
* @returns current ticks value
*/
uint32_t
/** @brief Set timer mode (counter/timer)
*
* @param[in] timer uint32_t timer base
* @param[in] mode enum timer_mode
*/
void
/** @brief Set timer bit mode (width)
*
* @param[in] timer uint32_t timer base
* @param[in] bitmode enum timer_bitmode
*/
void
/** @brief Start the timer
*
* @param[in] timer uint32_t timer base
*/
void
/** @brief Stop the timer
*
* @param[in] timer uint32_t timer base
*/
void
/** @brief Clear the timer
*
* @param[in] timer uint32_t timer base
*/
void
/** @brief Set prescaler value
*
* @param[in] timer uint32_t timer base
* @param[in] presc uint8_t prescaler value
*/
void
/** @brief Set compare register
*
* @param[in] timer uint32_t timer base
* @param[in] compare_num uint8_t compare number (0-3)
* @param[in] compare_val uint32_t compare value
*/
void
/** @brief Get the timer tick frequency
*
* @param[in] timer uint32_t timer base
* @returns frequency of ticking
*/
uint32_t
/** @brief Get compare register
*
* @param[in] timer uint32_t timer base
* @param[in] compare_num uint8_t compare number (0-3)
* @returns compare register value
*/
uint32_t
/**@}*/