cpu_pwm.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 #include "periph/cpu_gpio.h"
27 #include "periph/cpu_timer.h"
28 
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32 
46 typedef struct {
47  gpio_t pin;
48  uint8_t cc_chan;
50 } pwm_chan_t;
51 
55 typedef struct {
56  TIM_TypeDef *dev;
57  uint32_t rcc_mask;
58 #ifdef CPU_FAM_STM32F1
59  uint32_t remap;
61 #endif
62  pwm_chan_t chan[TIMER_CHANNEL_NUMOF];
65  gpio_af_t af;
66  uint8_t bus;
67 } pwm_conf_t;
68 
69 #ifdef __cplusplus
70 }
71 #endif
72 
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:165
PWM channel.
Definition: periph_cpu.h:468
PWM device configuration.
uint32_t rcc_mask
bit in clock enable register
Definition: cpu_pwm.h:57
TIM_TypeDef * dev
Timer used.
Definition: cpu_pwm.h:56