From fb95997b3b090ac74baf51c4a99779098d0d0f23 Mon Sep 17 00:00:00 2001 From: Karl Palsson Date: Fri, 14 Nov 2014 22:32:49 +0000 Subject: [PATCH] stm32f1: rcc: timer 15,16,27 rcc bits missing for old style The bits definitions for direct manipulation were missing, and should be present for completeness. However, this only affects the legacy (error prone) API, replaced some time ago. old and error prone: (stop using code like this) rcc_peripheral_enable_clock(&RCC_APB2ENR, RCC_APB2ENR_TIM16EN); rcc_peripheral_reset(&RCC_APB2RSTR, RCC_APB2RSTR_TIM16RST); new: rcc_periph_clock_enable(RCC_TIM16); rcc_periph_reset_{pulse,hold,release}(RCC_TIM16); Fixes github issue #361 --- include/libopencm3/stm32/f1/rcc.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/libopencm3/stm32/f1/rcc.h b/include/libopencm3/stm32/f1/rcc.h index 799b8c24..efb308d1 100644 --- a/include/libopencm3/stm32/f1/rcc.h +++ b/include/libopencm3/stm32/f1/rcc.h @@ -289,6 +289,9 @@ @ingroup STM32F1xx_rcc_defines @{*/ +#define RCC_APB2RSTR_TIM17RST (1 << 18) +#define RCC_APB2RSTR_TIM16RST (1 << 17) +#define RCC_APB2RSTR_TIM15RST (1 << 16) #define RCC_APB2RSTR_ADC3RST (1 << 15) /* (XX) */ #define RCC_APB2RSTR_USART1RST (1 << 14) #define RCC_APB2RSTR_TIM8RST (1 << 13) /* (XX) */ @@ -362,6 +365,9 @@ @ingroup STM32F1xx_rcc_defines @{*/ +#define RCC_APB2ENR_TIM17EN (1 << 17) +#define RCC_APB2ENR_TIM16EN (1 << 16) +#define RCC_APB2ENR_TIM15EN (1 << 16) #define RCC_APB2ENR_ADC3EN (1 << 15) /* (XX) */ #define RCC_APB2ENR_USART1EN (1 << 14) #define RCC_APB2ENR_TIM8EN (1 << 13) /* (XX) */