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

boards/common/atmega: Added ATmega1284P PWM conf

Added PWM configuration for the ATmega1284P CPU; this can be reused for every
board featuring that CPU.
This commit is contained in:
Marian Buschsieweke 2019-11-18 23:46:08 +01:00
parent edb03cceb7
commit b7150ed6c7
No known key found for this signature in database
GPG Key ID: 61F64C6599B1539F

View File

@ -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,