libopencm3
A free/libre/open-source firmware library for various ARM Cortex-M3 microcontrollers.
l1/timer.h
Go to the documentation of this file.
1/** @defgroup timer_defines Timer Defines
2
3@brief <b>libopencm3 Defined Constants and Types for the STM32L1xx Timers</b>
4
5@ingroup STM32L1xx_defines
6
7@version 1.0.0
8
9@date 8 March 2013
10
11@author @htmlonly &copy; @endhtmlonly 2011 Fergus Noble <fergusnoble@gmail.com>
12
13LGPL License Terms @ref lgpl_license
14*/
15
16/*
17 * This file is part of the libopencm3 project.
18 *
19 * Copyright (C) 2011 Fergus Noble <fergusnoble@gmail.com>
20 *
21 * This library is free software: you can redistribute it and/or modify
22 * it under the terms of the GNU Lesser General Public License as published by
23 * the Free Software Foundation, either version 3 of the License, or
24 * (at your option) any later version.
25 *
26 * This library is distributed in the hope that it will be useful,
27 * but WITHOUT ANY WARRANTY; without even the implied warranty of
28 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
29 * GNU Lesser General Public License for more details.
30 *
31 * You should have received a copy of the GNU Lesser General Public License
32 * along with this library. If not, see <http://www.gnu.org/licenses/>.
33 */
34
35#pragma once
37
38/**@{*/
39
40/*
41 * TIM2 and TIM5 are now 32bit and the following registers are now 32-bit wide:
42 * CNT, ARR, CCR1, CCR2, CCR3, CCR4
43 */
44
45/* Timer 2/3 option register (TIMx_OR) */
46#define TIM_OR(tim_base) MMIO32((tim_base) + 0x50)
47#define TIM2_OR TIM_OR(TIM2)
48#define TIM3_OR TIM_OR(TIM3)
49
50/* --- TIMx_OR values ---------------------------------------------------- */
51
52/* ITR1_RMP */
53/****************************************************************************/
54/** @defgroup tim2_opt_trigger_remap TIM2_OR Timer 2 Internal Trigger 1 Remap
55@{*/
56/** Internal Trigger 1 remapped to timer 10 output compare */
57#define TIM2_OR_ITR1_RMP_TIM10_OC (0x0 << 0)
58/** Internal Trigger 1 remapped to timer 5 TGO */
59#define TIM2_OR_ITR1_RMP_TIM5_TGO (0x1 << 0)
60/**@}*/
61#define TIM2_OR_ITR1_RMP_MASK (0x1 << 0)
62
63/* --- TIMx_OR values ---------------------------------------------------- */
64
65/* ITR2_RMP */
66/****************************************************************************/
67/** @defgroup tim3_opt_trigger_remap TIM3_OR Timer 3 Internal Trigger 2 Remap
68@{*/
69/** Internal Trigger 1 remapped to timer 11 output compare */
70#define TIM3_OR_ITR2_RMP_TIM8_TRGOU (0x0 << 0)
71/** Internal Trigger 1 remapped to timer 5 TGO */
72#define TIM3_OR_ITR2_RMP_PTP (0x1 << 0)
73/**@}*/
74#define TIM3_OR_ITR2_RMP_MASK (0x1 << 0)
75
76/* --- Function prototypes ------------------------------------------------- */
77
79
80void timer_set_option(uint32_t timer_peripheral, uint32_t option);
81
83
84/**@}*/
#define END_DECLS
Definition: common.h:34
#define BEGIN_DECLS
Definition: common.h:33
void timer_set_option(uint32_t timer_peripheral, uint32_t option)
Set Timer Option.
Definition: timer.c:44