Loading...
Searching...
No Matches
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
22
23#include <stdint.h>
24
25#include "cpu.h"
26
27#ifdef __cplusplus
28extern "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
49typedef 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;
58
59#ifdef __cplusplus
60}
61#endif
62
Timer device configuration.
Definition periph_cpu.h:263
uint8_t irqn
global IRQ channel
Definition periph_cpu.h:323
uint8_t bus
APBx bus the timer is clock from.
Definition periph_cpu.h:322
uint32_t rcc_mask
corresponding bit in the RCC register
Definition cpu_timer.h:52
TC0_t * dev
Pointer to the used as Timer device.
Definition periph_cpu.h:264
uint32_t max
maximum value to count to (16/32 bit)
Definition periph_cpu.h:320
uint8_t channel_numof
number of channels per timer
Definition periph_cpu.h:558