From b7150ed6c7b453854101c701fa376f71f0307d23 Mon Sep 17 00:00:00 2001 From: Marian Buschsieweke Date: Mon, 18 Nov 2019 23:46:08 +0100 Subject: [PATCH] boards/common/atmega: Added ATmega1284P PWM conf Added PWM configuration for the ATmega1284P CPU; this can be reused for every board featuring that CPU. --- .../common/atmega/include/periph_conf_atmega_common.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/boards/common/atmega/include/periph_conf_atmega_common.h b/boards/common/atmega/include/periph_conf_atmega_common.h index a6a7049df8..a9928a9acc 100644 --- a/boards/common/atmega/include/periph_conf_atmega_common.h +++ b/boards/common/atmega/include/periph_conf_atmega_common.h @@ -311,7 +311,8 @@ extern "C" { * @name PWM configuration * * The current implementation supports only 8-bit timers for PWM generation. - * These timers are typically timer 0 and timer 2 in Atmega2560/1281/328p. + * These timers are typically timer 0 and timer 2 for + * ATmega 328P/1281/1284P/2560. * * Setting the first channel to GPIO_UNDEF allows multiple resolutions for the * PWM channel. Otherwise the resolution is fixed to 256, allowing duty cycle @@ -326,6 +327,9 @@ extern "C" { #elif defined(CPU_ATMEGA1281) #define PWM_PINS_CH0 { GPIO_PIN(PORT_B, 7), GPIO_PIN(PORT_G, 5) } #define PWM_PINS_CH1 { GPIO_PIN(PORT_B, 4), GPIO_UNDEF } +#elif defined(CPU_ATMEGA1284P) + #define PWM_PINS_CH0 { GPIO_PIN(PORT_B, 3), GPIO_PIN(PORT_B, 4) } + #define PWM_PINS_CH1 { GPIO_PIN(PORT_D, 7), GPIO_PIN(PORT_D, 6) } #elif defined(CPU_ATMEGA2560) #define PWM_PINS_CH0 { GPIO_PIN(PORT_B, 7), GPIO_PIN(PORT_G, 5) } #define PWM_PINS_CH1 { GPIO_PIN(PORT_B, 4), GPIO_PIN(PORT_H, 6) } @@ -335,7 +339,9 @@ extern "C" { #define PWM_NUMOF (0U) #endif -#if defined(CPU_ATMEGA328P) || defined(CPU_ATMEGA1281) || defined(CPU_ATMEGA2560) || defined(CPU_ATMEGA32U4) +#if defined(CPU_ATMEGA32U4) || defined(CPU_ATMEGA328P) || \ + defined(CPU_ATMEGA1281) || defined(CPU_ATMEGA1284P) || \ + defined(CPU_ATMEGA2560) static const pwm_conf_t pwm_conf[] = { { .dev = MINI_TIMER0,