Loading...
Searching...
No Matches
cpu_timer.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2016 Freie Universität Berlin
3 * SPDX-FileCopyrightText: 2017 OTA keys S.A.
4 * SPDX-License-Identifier: LGPL-2.1-only
5 */
6
7#pragma once
8
19
20#include <stdint.h>
21
22#include "cpu.h"
23
24#ifdef __cplusplus
25extern "C" {
26#endif
27
31#define TIMER_CHANNEL_NUMOF (4U)
32
36#define PERIPH_TIMER_PROVIDES_SET
37
41#define TIM_CHAN(tim, chan) *(&dev(tim)->CCR1 + chan)
42
46typedef struct {
47 TIM_TypeDef *dev;
48 uint32_t max;
49 uint32_t rcc_mask;
50 uint8_t bus;
51 uint8_t irqn;
52 uint8_t channel_numof;
55
56#ifdef __cplusplus
57}
58#endif
59
Timer device configuration.
Definition periph_cpu.h:260
uint8_t irqn
global IRQ channel
Definition periph_cpu.h:320
uint8_t bus
APBx bus the timer is clock from.
Definition periph_cpu.h:319
uint32_t rcc_mask
corresponding bit in the RCC register
Definition cpu_timer.h:49
TC0_t * dev
Pointer to the used as Timer device.
Definition periph_cpu.h:261
uint32_t max
maximum value to count to (16/32 bit)
Definition periph_cpu.h:317
uint8_t channel_numof
number of channels per timer
Definition periph_cpu.h:555