cpu_timer.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2016 Freie Universität Berlin
3  * 2017 OTA keys S.A.
4  *
5  * This file is subject to the terms and conditions of the GNU Lesser
6  * General Public License v2.1. See the file LICENSE in the top level
7  * directory for more details.
8  */
9 
10 #pragma once
11 
23 #include <stdint.h>
24 
25 #include "cpu.h"
26 
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
30 
34 #define TIMER_CHANNEL_NUMOF (4U)
35 
39 #define PERIPH_TIMER_PROVIDES_SET
40 
44 #define TIM_CHAN(tim, chan) *(&dev(tim)->CCR1 + chan)
45 
49 typedef struct {
50  TIM_TypeDef *dev;
51  uint32_t max;
52  uint32_t rcc_mask;
53  uint8_t bus;
54  uint8_t irqn;
55  uint8_t channel_numof;
57 } timer_conf_t;
58 
59 #ifdef __cplusplus
60 }
61 #endif
62 
Timer device configuration.
Definition: periph_cpu.h:263
uint32_t rcc_mask
corresponding bit in the RCC register
Definition: cpu_timer.h:52
TIM_TypeDef * dev
timer device
Definition: cpu_timer.h:50