1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

boards/samr21-xpro: fix style of PWM config

This commit is contained in:
Benjamin Valentin 2022-11-23 13:53:14 +01:00
parent 64dcfd67ff
commit f878f11193

View File

@ -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
};