1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-01-17 22:32:44 +01:00

boards/arduino-zero: update PWM configuration

This commit is contained in:
Benjamin Valentin 2020-04-26 22:39:38 +02:00
parent ed3f951825
commit e03b692ff7

View File

@ -171,31 +171,36 @@ static const uart_conf_t uart_config[] = {
*/ */
#define PWM_0_EN 1 #define PWM_0_EN 1
#define PWM_1_EN 1 #define PWM_1_EN 1
#define PWM_MAX_CHANNELS 2
/* for compatibility with test application */ #if PWM_0_EN
#define PWM_0_CHANNELS PWM_MAX_CHANNELS /* PWM0 channels */
#define PWM_1_CHANNELS PWM_MAX_CHANNELS static const pwm_conf_chan_t pwm_chan0_config[] = {
/* GPIO pin, MUX value, TCC channel */
{ GPIO_PIN(PA, 8), GPIO_MUX_E, 0 },
{ GPIO_PIN(PA, 9), GPIO_MUX_E, 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, 6), GPIO_MUX_E, 0 },
{ GPIO_PIN(PA, 7), GPIO_MUX_E, 1 },
};
#endif
/* PWM device configuration */ /* PWM device configuration */
static const pwm_conf_t pwm_config[] = { static const pwm_conf_t pwm_config[] = {
#if PWM_0_EN #if PWM_0_EN
{TCC0, { {TCC0, pwm_chan0_config, ARRAY_SIZE(pwm_chan0_config)},
/* GPIO pin, MUX value, TCC channel */
{ GPIO_PIN(PA, 8), GPIO_MUX_E, 0 },
{ GPIO_PIN(PA, 9), GPIO_MUX_E, 1 },
}},
#endif #endif
#if PWM_1_EN #if PWM_1_EN
{TCC1, { {TCC1, pwm_chan1_config, ARRAY_SIZE(pwm_chan1_config)},
/* GPIO pin, MUX value, TCC channel */
{ GPIO_PIN(PA, 6), GPIO_MUX_E, 0 },
{ GPIO_PIN(PA, 7), GPIO_MUX_E, 1 },
}},
#endif #endif
}; };
/* number of devices that are actually defined */ /* number of devices that are actually defined */
#define PWM_NUMOF (2U) #define PWM_NUMOF ARRAY_SIZE(pwm_config)
/** @} */ /** @} */
/** /**