From f878f111932165651be72864bfa2e9f9b2c06579 Mon Sep 17 00:00:00 2001 From: Benjamin Valentin Date: Wed, 23 Nov 2022 13:53:14 +0100 Subject: [PATCH] boards/samr21-xpro: fix style of PWM config --- boards/samr21-xpro/include/periph_conf.h | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/boards/samr21-xpro/include/periph_conf.h b/boards/samr21-xpro/include/periph_conf.h index 036318afbd..72be389a05 100644 --- a/boards/samr21-xpro/include/periph_conf.h +++ b/boards/samr21-xpro/include/periph_conf.h @@ -194,27 +194,37 @@ static const uart_conf_t uart_config[] = { /* PWM0 channels */ static const pwm_conf_chan_t pwm_chan0_config[] = { /* GPIO pin, MUX value, TCC channel */ - { GPIO_PIN(PA, 6), GPIO_MUX_E, 0 }, - { GPIO_PIN(PA, 7), GPIO_MUX_E, 1 }, + { .pin = GPIO_PIN(PA, 6), .mux = GPIO_MUX_E, .chan = 0 }, + { .pin = GPIO_PIN(PA, 7), .mux = GPIO_MUX_E, .chan = 1 }, }; #endif #if PWM_1_EN /* PWM1 channels */ static const pwm_conf_chan_t pwm_chan1_config[] = { /* GPIO pin, MUX value, TCC channel */ - { GPIO_PIN(PA, 16), GPIO_MUX_F, 0 }, - { GPIO_PIN(PA, 18), GPIO_MUX_F, 2 }, - { GPIO_PIN(PA, 19), GPIO_MUX_F, 3 }, + { .pin = GPIO_PIN(PA, 16), .mux = GPIO_MUX_F, .chan = 0 }, + { .pin = GPIO_PIN(PA, 18), .mux = GPIO_MUX_F, .chan = 2 }, + { .pin = GPIO_PIN(PA, 19), .mux = GPIO_MUX_F, .chan = 3 }, }; #endif /* PWM device configuration */ static const pwm_conf_t pwm_config[] = { #if PWM_0_EN - {TCC_CONFIG(TCC1), pwm_chan0_config, ARRAY_SIZE(pwm_chan0_config), SAM0_GCLK_MAIN}, + { + .tim = TCC_CONFIG(TCC1), + .chan = pwm_chan0_config, + .chan_numof = ARRAY_SIZE(pwm_chan0_config), + .gclk_src = SAM0_GCLK_MAIN, + }, #endif #if PWM_1_EN - {TCC_CONFIG(TCC0), pwm_chan1_config, ARRAY_SIZE(pwm_chan1_config), SAM0_GCLK_MAIN}, + { + .tim = TCC_CONFIG(TCC0), + .chan = pwm_chan1_config, + .chan_numof = ARRAY_SIZE(pwm_chan1_config), + .gclk_src = SAM0_GCLK_MAIN, + }, #endif };