cpu_pwm.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 
20 #include <stdint.h>
21 
22 #include "cpu.h"
23 #include "periph/cpu_gpio.h"
24 #include "periph/cpu_timer.h"
25 
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
29 
43 typedef struct {
44  gpio_t pin;
45  uint8_t cc_chan;
47 } pwm_chan_t;
48 
52 typedef struct {
53  TIM_TypeDef *dev;
54  uint32_t rcc_mask;
55 #ifdef CPU_FAM_STM32F1
56  uint32_t remap;
58 #endif
59  pwm_chan_t chan[TIMER_CHANNEL_NUMOF];
62  gpio_af_t af;
63  uint8_t bus;
64 } pwm_conf_t;
65 
66 #ifdef __cplusplus
67 }
68 #endif
69 
GPIO CPU definitions for the STM32 family.
Timer CPU specific definitions for the STM32 family.
gpio_af_t
Override alternative GPIO mode options.
Definition: periph_cpu.h:162
PWM channel.
Definition: periph_cpu.h:465
PWM device configuration.
uint32_t rcc_mask
bit in clock enable register
Definition: cpu_pwm.h:54
TIM_TypeDef * dev
Timer used.
Definition: cpu_pwm.h:53