mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-01-17 10:12:45 +01:00
boards/hamilton: update PWM configuration
This commit is contained in:
parent
e03b692ff7
commit
335f669933
@ -179,28 +179,37 @@ static const adc_conf_chan_t adc_channels[] = {
|
||||
*/
|
||||
#define PWM_0_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
|
||||
{TCC1, {
|
||||
/* GPIO pin, MUX value, TCC channel */
|
||||
{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
|
||||
/* 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},
|
||||
};
|
||||
#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)
|
||||
/** @} */
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user