libopencm3
A free/libre/open-source firmware library for various ARM Cortex-M3 microcontrollers.
g0/timer.h
Go to the documentation of this file.
1/** @defgroup timer_defines Timer Defines
2 *
3 * @ingroup STM32G0xx_defines
4 *
5 * @brief <b>Defined Constants and Types for the STM32G0xx Timers</b>
6 *
7 * @version 1.0.0
8 *
9 * LGPL License Terms @ref lgpl_license
10 * */
11/*
12 * This file is part of the libopencm3 project.
13 *
14 * Copyright (C) 2019 Guillaume Revaillot <g.revaillot@gmail.com>
15 *
16 * This library is free software: you can redistribute it and/or modify
17 * it under the terms of the GNU Lesser General Public License as published by
18 * the Free Software Foundation, either version 3 of the License, or
19 * (at your option) any later version.
20 *
21 * This library is distributed in the hope that it will be useful,
22 * but WITHOUT ANY WARRANTY; without even the implied warranty of
23 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 * GNU Lesser General Public License for more details.
25 *
26 * You should have received a copy of the GNU Lesser General Public License
27 * along with this library. If not, see <http://www.gnu.org/licenses/>.
28 */
29
30#pragma once
32
33/**@{*/
34
35/* Option Register (TIMx_OR1) */
36#define TIM_OR1(tim_base) MMIO32((tim_base) + 0x50)
37#define TIM2_OR1 TIM_OR1(TIM2)
38#define TIM3_OR1 TIM_OR1(TIM3)
39
40/* Alternate Function (TIMx_AF1) */
41#define TIM_AF1(tim_base) MMIO32((tim_base) + 0x60)
42#define TIM2_AF1 TIM_AF1(TIM2)
43#define TIM3_AF1 TIM_AF1(TIM3)
44#define TIM16_AF1 TIM_AF1(TIM16)
45#define TIM17_AF1 TIM_AF1(TIM17)
46
47/* Input Selection Register (TIMx_TISEL) */
48#define TIM_TISEL(tim_base) MMIO32((tim_base) + 0x68)
49#define TIM2_TISEL TIM_TISEL(TIM2)
50#define TIM3_TISEL TIM_TISEL(TIM3)
51#define TIM14_TISEL TIM_TISEL(TIM14)
52#define TIM16_TISEL TIM_TISEL(TIM16)
53#define TIM17_TISEL TIM_TISEL(TIM17)
54
55/* --- TIMx_OR1 values ---------------------------------------------------- */
56
57/* OCREF_CLR: ocref_clr Source Selection */
58#define TIM_OR1_OCREF_CLR (1 << 0)
59
60/** @defgroup tim_or1_ocref_clr TIM_OR1_OCREF_CLR Source Selection
61@{*/
62#define TIM_OR1_OCREF_CLR_COMP1 (0)
63#define TIM_OR1_OCREF_CLR_COMP2 (1)
64/**@}*/
65
67
69
70/**@}*/
#define END_DECLS
Definition: common.h:34
#define BEGIN_DECLS
Definition: common.h:33