From 824f7aa82b656b541e0bb2437e6b3d5a7c549c44 Mon Sep 17 00:00:00 2001 From: Benjamin Valentin Date: Sat, 2 May 2020 23:30:08 +0200 Subject: [PATCH] cpu/sam0_common: move PWM to common code --- cpu/sam0_common/include/periph_cpu_common.h | 18 ++++++++++++++++++ cpu/{samd21 => sam0_common}/periph/pwm.c | 0 cpu/samd21/include/periph_cpu.h | 18 ------------------ 3 files changed, 18 insertions(+), 18 deletions(-) rename cpu/{samd21 => sam0_common}/periph/pwm.c (100%) diff --git a/cpu/sam0_common/include/periph_cpu_common.h b/cpu/sam0_common/include/periph_cpu_common.h index e55e2a109b..de7bb6a364 100644 --- a/cpu/sam0_common/include/periph_cpu_common.h +++ b/cpu/sam0_common/include/periph_cpu_common.h @@ -212,6 +212,24 @@ typedef struct { uint8_t gclk_src; /**< GCLK source which supplys SERCOM */ } uart_conf_t; +/** + * @brief PWM channel configuration data structure + */ +typedef struct { + gpio_t pin; /**< GPIO pin */ + gpio_mux_t mux; /**< pin function multiplex value */ + uint8_t chan; /**< TCC channel to use */ +} pwm_conf_chan_t; + +/** + * @brief PWM device configuration data structure + */ +typedef struct { + Tcc *dev; /**< TCC device to use */ + const pwm_conf_chan_t *chan;/**< channel configuration */ + const uint8_t chan_numof; /**< number of channels */ +} pwm_conf_t; + /** * @brief Available values for SERCOM SPI MISO pad selection */ diff --git a/cpu/samd21/periph/pwm.c b/cpu/sam0_common/periph/pwm.c similarity index 100% rename from cpu/samd21/periph/pwm.c rename to cpu/sam0_common/periph/pwm.c diff --git a/cpu/samd21/include/periph_cpu.h b/cpu/samd21/include/periph_cpu.h index aed4f91fab..7f16663f3a 100644 --- a/cpu/samd21/include/periph_cpu.h +++ b/cpu/samd21/include/periph_cpu.h @@ -70,24 +70,6 @@ enum { */ #define SPI_HWCS(x) (UINT_MAX - 1) -/** - * @brief PWM channel configuration data structure - */ -typedef struct { - gpio_t pin; /**< GPIO pin */ - gpio_mux_t mux; /**< pin function multiplex value */ - uint8_t chan; /**< TCC channel to use */ -} pwm_conf_chan_t; - -/** - * @brief PWM device configuration data structure - */ -typedef struct { - Tcc *dev; /**< TCC device to use */ - const pwm_conf_chan_t *chan;/**< channel configuration */ - const uint8_t chan_numof; /**< number of channels */ -} pwm_conf_t; - /** * @brief Return the numeric id of a SERCOM device derived from its address *