Loading...
Searching...
No Matches
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
22
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
30extern "C" {
31#endif
32
46typedef struct {
47 gpio_t pin;
48 uint8_t cc_chan;
51
55typedef 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];
66 uint8_t bus;
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 remap
AFIO remap mask to route periph to other pins (or zero, if not needed)
Definition periph_cpu.h:479
uint32_t rcc_mask
bit in clock enable register
Definition cpu_pwm.h:57
gpio_af_t af
alternate function used
Definition periph_cpu.h:484
mini_timer_t * dev
Timer used.
uint8_t bus
APB bus.
Definition periph_cpu.h:485
pwm_chan_t chan[TIMER_CHANNEL_NUMOF]
channel mapping set to {GPIO_UNDEF, 0} if not used
Definition periph_cpu.h:482