boards/hamilton: update PWM configuration

This commit is contained in:
Benjamin Valentin 2020-04-26 22:42:20 +02:00
parent e03b692ff7
commit 335f669933

View File

@ -179,28 +179,37 @@ static const adc_conf_chan_t adc_channels[] = {
*/ */
#define PWM_0_EN 1 #define PWM_0_EN 1
#define PWM_1_EN 1 #define PWM_1_EN 1
#define PWM_NUMOF (PWM_0_EN + PWM_1_EN)
#define PWM_MAX_CHANNELS 2
/* PWM device configuration */
#if PWM_NUMOF
static const pwm_conf_t pwm_config[] = {
#if PWM_0_EN #if PWM_0_EN
{TCC1, { /* PWM0 channels */
/* GPIO pin, MUX value, TCC channel */ static const pwm_conf_chan_t pwm_chan0_config[] = {
{GPIO_PIN(PA, 6), GPIO_MUX_E, 0}, /* GPIO pin, MUX value, TCC channel */
{GPIO_PIN(PA, 7), GPIO_MUX_E, 1} {GPIO_PIN(PA, 6), GPIO_MUX_E, 0},
}}, {GPIO_PIN(PA, 7), GPIO_MUX_E, 1},
#endif
#if PWM_1_EN
{TCC0, {
/* GPIO pin, MUX value, TCC channel */
{GPIO_PIN(PA, 18), GPIO_MUX_F, 2},
{GPIO_PIN(PA, 19), GPIO_MUX_F, 3}
}},
#endif
}; };
#endif #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, 18), GPIO_MUX_F, 2},
{GPIO_PIN(PA, 19), GPIO_MUX_F, 3},
};
#endif
/* PWM device configuration */
static const pwm_conf_t pwm_config[] = {
#if PWM_0_EN
{TCC1, pwm_chan0_config, ARRAY_SIZE(pwm_chan0_config)},
#endif
#if PWM_1_EN
{TCC0, pwm_chan1_config, ARRAY_SIZE(pwm_chan1_config)},
#endif
};
/* number of devices that are actually defined */
#define PWM_NUMOF ARRAY_SIZE(pwm_config)
/** @} */ /** @} */
/** /**