boards: efm32 boards, LETIMER + regular timer

This commit is contained in:
Francisco Molina 2020-08-18 15:52:47 +02:00
parent cbf78fe3d4
commit a3de88a4db
No known key found for this signature in database
GPG Key ID: 3E94EAC3DBDEEDA8
13 changed files with 128 additions and 109 deletions

View File

@ -147,7 +147,8 @@ static const timer_conf_t timer_config[] = {
.dev = TIMER1, .dev = TIMER1,
.cmu = cmuClock_TIMER1 .cmu = cmuClock_TIMER1
}, },
.irq = TIMER1_IRQn .irq = TIMER1_IRQn,
.channel_numof = 3
} }
}; };

View File

@ -34,12 +34,15 @@ extern "C" {
* The timer runs at 250 kHz to increase accuracy or 32768 Hz for LETIMER. * The timer runs at 250 kHz to increase accuracy or 32768 Hz for LETIMER.
* @{ * @{
*/ */
#if IS_ACTIVE(CONFIG_EFM32_USE_LETIMER) #if IS_ACTIVE(CONFIG_EFM32_XTIMER_USE_LETIMER)
#define XTIMER_DEV (TIMER_DEV(1))
#define XTIMER_HZ (32768UL) #define XTIMER_HZ (32768UL)
#else #else
#define XTIMER_DEV (TIMER_DEV(0))
#define XTIMER_HZ (250000UL) #define XTIMER_HZ (250000UL)
#endif #endif
#define XTIMER_WIDTH (16) #define XTIMER_WIDTH (16)
#define XTIMER_CHAN (0)
/** @} */ /** @} */
/** /**

View File

@ -85,19 +85,6 @@ static const spi_dev_t spi_config[] = {
* or two regular timers in cascade mode. * or two regular timers in cascade mode.
* @{ * @{
*/ */
#if IS_ACTIVE(CONFIG_EFM32_USE_LETIMER)
static const timer_conf_t timer_config[] = {
{
.timer = {
.dev = LETIMER0,
.cmu = cmuClock_LETIMER0
},
.irq = LETIMER0_IRQn
}
};
#define TIMER_0_ISR isr_letimer0
#else
static const timer_conf_t timer_config[] = { static const timer_conf_t timer_config[] = {
{ {
.prescaler = { .prescaler = {
@ -108,12 +95,25 @@ static const timer_conf_t timer_config[] = {
.dev = TIMER1, .dev = TIMER1,
.cmu = cmuClock_TIMER1 .cmu = cmuClock_TIMER1
}, },
.irq = TIMER1_IRQn .irq = TIMER1_IRQn,
} .channel_numof = 3
},
{
.prescaler = {
.dev = NULL,
.cmu = cmuClock_LETIMER0
},
.timer = {
.dev = LETIMER0,
.cmu = cmuClock_LETIMER0
},
.irq = LETIMER0_IRQn,
.channel_numof = 2
},
}; };
#define TIMER_0_ISR isr_timer1
#endif /* CONFIG_EFM32_USE_LETIMER */ #define TIMER_0_ISR isr_timer1
#define TIMER_1_ISR isr_letimer0
#define TIMER_NUMOF ARRAY_SIZE(timer_config) #define TIMER_NUMOF ARRAY_SIZE(timer_config)
/** @} */ /** @} */

View File

@ -35,12 +35,15 @@ extern "C" {
* The timer runs at 250 KHz to increase accuracy or 32768 Hz for LETIMER. * The timer runs at 250 KHz to increase accuracy or 32768 Hz for LETIMER.
* @{ * @{
*/ */
#if IS_ACTIVE(CONFIG_EFM32_USE_LETIMER) #if IS_ACTIVE(CONFIG_EFM32_XTIMER_USE_LETIMER)
#define XTIMER_DEV (TIMER_DEV(1))
#define XTIMER_HZ (32768UL) #define XTIMER_HZ (32768UL)
#else #else
#define XTIMER_DEV (TIMER_DEV(0))
#define XTIMER_HZ (250000UL) #define XTIMER_HZ (250000UL)
#endif #endif
#define XTIMER_WIDTH (16) #define XTIMER_WIDTH (16)
#define XTIMER_CHAN (0)
/** @} */ /** @} */
/** /**

View File

@ -145,19 +145,6 @@ static const spi_dev_t spi_config[] = {
* or two regular timers in cascade mode. * or two regular timers in cascade mode.
* @{ * @{
*/ */
#if IS_ACTIVE(CONFIG_EFM32_USE_LETIMER)
static const timer_conf_t timer_config[] = {
{
.timer = {
.dev = LETIMER0,
.cmu = cmuClock_LETIMER0
},
.irq = LETIMER0_IRQn
}
};
#define TIMER_0_ISR isr_letimer0
#else
static const timer_conf_t timer_config[] = { static const timer_conf_t timer_config[] = {
{ {
.prescaler = { .prescaler = {
@ -168,12 +155,25 @@ static const timer_conf_t timer_config[] = {
.dev = TIMER1, .dev = TIMER1,
.cmu = cmuClock_TIMER1 .cmu = cmuClock_TIMER1
}, },
.irq = TIMER1_IRQn .irq = TIMER1_IRQn,
} .channel_numof = 3
},
{
.prescaler = {
.dev = NULL,
.cmu = cmuClock_LETIMER0
},
.timer = {
.dev = LETIMER0,
.cmu = cmuClock_LETIMER0
},
.irq = LETIMER0_IRQn,
.channel_numof = 2
},
}; };
#define TIMER_0_ISR isr_timer1
#endif /* CONFIG_EFM32_USE_LETIMER */ #define TIMER_0_ISR isr_timer1
#define TIMER_1_ISR isr_letimer0
#define TIMER_NUMOF ARRAY_SIZE(timer_config) #define TIMER_NUMOF ARRAY_SIZE(timer_config)
/** @} */ /** @} */

View File

@ -33,13 +33,16 @@ extern "C" {
* @name Xtimer configuration * @name Xtimer configuration
* @{ * @{
*/ */
#if IS_ACTIVE(CONFIG_EFM32_USE_LETIMER) #if IS_ACTIVE(CONFIG_EFM32_XTIMER_USE_LETIMER)
#define XTIMER_DEV (TIMER_DEV(1))
#define XTIMER_HZ (32768UL) #define XTIMER_HZ (32768UL)
#define XTIMER_WIDTH (16) #define XTIMER_WIDTH (16)
#else #else
#define XTIMER_DEV (TIMER_DEV(0))
#define XTIMER_HZ (1000000UL) #define XTIMER_HZ (1000000UL)
#define XTIMER_WIDTH (32) #define XTIMER_WIDTH (32)
#endif #endif
#define XTIMER_CHAN (0)
/** @} */ /** @} */
/** /**

View File

@ -136,19 +136,6 @@ static const spi_dev_t spi_config[] = {
* or two regular timers in cascade mode. * or two regular timers in cascade mode.
* @{ * @{
*/ */
#if IS_ACTIVE(CONFIG_EFM32_USE_LETIMER)
static const timer_conf_t timer_config[] = {
{
.timer = {
.dev = LETIMER0,
.cmu = cmuClock_LETIMER0
},
.irq = LETIMER0_IRQn
}
};
#define TIMER_0_ISR isr_letimer0
#else
static const timer_conf_t timer_config[] = { static const timer_conf_t timer_config[] = {
{ {
.prescaler = { .prescaler = {
@ -159,12 +146,25 @@ static const timer_conf_t timer_config[] = {
.dev = WTIMER1, .dev = WTIMER1,
.cmu = cmuClock_WTIMER1 .cmu = cmuClock_WTIMER1
}, },
.irq = WTIMER1_IRQn .irq = WTIMER1_IRQn,
} .channel_numof = 3
},
{
.prescaler = {
.dev = NULL,
.cmu = cmuClock_LETIMER0
},
.timer = {
.dev = LETIMER0,
.cmu = cmuClock_LETIMER0
},
.irq = LETIMER0_IRQn,
.channel_numof = 2
},
}; };
#define TIMER_0_ISR isr_wtimer1
#endif /* CONFIG_EFM32_USE_LETIMER */ #define TIMER_0_ISR isr_wtimer1
#define TIMER_1_ISR isr_letimer0
#define TIMER_NUMOF ARRAY_SIZE(timer_config) #define TIMER_NUMOF ARRAY_SIZE(timer_config)
/** @} */ /** @} */

View File

@ -35,13 +35,16 @@ extern "C" {
* The timer runs at 250 KHz to increase accuracy or 32768 Hz for LETIMER. * The timer runs at 250 KHz to increase accuracy or 32768 Hz for LETIMER.
* @{ * @{
*/ */
#if IS_ACTIVE(CONFIG_EFM32_USE_LETIMER) #if IS_ACTIVE(CONFIG_EFM32_XTIMER_USE_LETIMER)
#define XTIMER_DEV (TIMER_DEV(1))
#define XTIMER_HZ (32768UL) #define XTIMER_HZ (32768UL)
#define XTIMER_WIDTH (16) #define XTIMER_WIDTH (16)
#else #else
#define XTIMER_DEV (TIMER_DEV(0))
#define XTIMER_HZ (250000UL) #define XTIMER_HZ (250000UL)
#define XTIMER_WIDTH (16) #define XTIMER_WIDTH (16)
#endif #endif
#define XTIMER_CHAN (0)
/** @} */ /** @} */
/** /**

View File

@ -145,19 +145,6 @@ static const spi_dev_t spi_config[] = {
* or two regular timers in cascade mode. * or two regular timers in cascade mode.
* @{ * @{
*/ */
#if IS_ACTIVE(CONFIG_EFM32_USE_LETIMER)
static const timer_conf_t timer_config[] = {
{
.timer = {
.dev = LETIMER0,
.cmu = cmuClock_LETIMER0
},
.irq = LETIMER0_IRQn
}
};
#define TIMER_0_ISR isr_letimer0
#else
static const timer_conf_t timer_config[] = { static const timer_conf_t timer_config[] = {
{ {
.prescaler = { .prescaler = {
@ -168,12 +155,25 @@ static const timer_conf_t timer_config[] = {
.dev = TIMER1, .dev = TIMER1,
.cmu = cmuClock_TIMER1 .cmu = cmuClock_TIMER1
}, },
.irq = TIMER1_IRQn .irq = TIMER1_IRQn,
} .channel_numof = 3
},
{
.prescaler = {
.dev = NULL,
.cmu = cmuClock_LETIMER0
},
.timer = {
.dev = LETIMER0,
.cmu = cmuClock_LETIMER0
},
.irq = LETIMER0_IRQn,
.channel_numof = 2
},
}; };
#define TIMER_0_ISR isr_timer1
#endif /* CONFIG_EFM32_USE_LETIMER */ #define TIMER_0_ISR isr_timer1
#define TIMER_1_ISR isr_letimer0
#define TIMER_NUMOF ARRAY_SIZE(timer_config) #define TIMER_NUMOF ARRAY_SIZE(timer_config)
/** @} */ /** @} */

View File

@ -35,13 +35,16 @@ extern "C" {
* The timer runs at 250 KHz to increase accuracy or 32768 Hz for LETIMER. * The timer runs at 250 KHz to increase accuracy or 32768 Hz for LETIMER.
* @{ * @{
*/ */
#if IS_ACTIVE(CONFIG_EFM32_USE_LETIMER) #if IS_ACTIVE(CONFIG_EFM32_XTIMER_USE_LETIMER)
#define XTIMER_DEV (TIMER_DEV(1))
#define XTIMER_HZ (32768UL) #define XTIMER_HZ (32768UL)
#define XTIMER_WIDTH (16) #define XTIMER_WIDTH (16)
#else #else
#define XTIMER_DEV (TIMER_DEV(0))
#define XTIMER_HZ (250000UL) #define XTIMER_HZ (250000UL)
#define XTIMER_WIDTH (16) #define XTIMER_WIDTH (16)
#endif #endif
#define XTIMER_CHAN (0)
/** @} */ /** @} */
/** /**

View File

@ -199,19 +199,6 @@ static const spi_dev_t spi_config[] = {
* or two regular timers in cascade mode. * or two regular timers in cascade mode.
* @{ * @{
*/ */
#if IS_ACTIVE(CONFIG_EFM32_USE_LETIMER)
static const timer_conf_t timer_config[] = {
{
.timer = {
.dev = LETIMER0,
.cmu = cmuClock_LETIMER0
},
.irq = LETIMER0_IRQn
}
};
#define TIMER_0_ISR isr_letimer0
#else
static const timer_conf_t timer_config[] = { static const timer_conf_t timer_config[] = {
{ {
.prescaler = { .prescaler = {
@ -222,12 +209,25 @@ static const timer_conf_t timer_config[] = {
.dev = TIMER1, .dev = TIMER1,
.cmu = cmuClock_TIMER1 .cmu = cmuClock_TIMER1
}, },
.irq = TIMER1_IRQn .irq = TIMER1_IRQn,
} .channel_numof = 3
},
{
.prescaler = {
.dev = NULL,
.cmu = cmuClock_LETIMER0
},
.timer = {
.dev = LETIMER0,
.cmu = cmuClock_LETIMER0
},
.irq = LETIMER0_IRQn,
.channel_numof = 2
},
}; };
#define TIMER_0_ISR isr_timer1
#endif /* CONFIG_EFM32_USE_LETIMER */ #define TIMER_0_ISR isr_timer1
#define TIMER_1_ISR isr_letimer0
#define TIMER_NUMOF ARRAY_SIZE(timer_config) #define TIMER_NUMOF ARRAY_SIZE(timer_config)
/** @} */ /** @} */

View File

@ -35,13 +35,16 @@ extern "C" {
* The timer runs at 250 KHz to increase accuracy or 32768 Hz for LETIMER. * The timer runs at 250 KHz to increase accuracy or 32768 Hz for LETIMER.
* @{ * @{
*/ */
#if IS_ACTIVE(CONFIG_EFM32_USE_LETIMER) #if IS_ACTIVE(CONFIG_EFM32_XTIMER_USE_LETIMER)
#define XTIMER_DEV (TIMER_DEV(1))
#define XTIMER_HZ (32768UL) #define XTIMER_HZ (32768UL)
#define XTIMER_WIDTH (16) #define XTIMER_WIDTH (16)
#else #else
#define XTIMER_DEV (TIMER_DEV(0))
#define XTIMER_HZ (250000UL) #define XTIMER_HZ (250000UL)
#define XTIMER_WIDTH (16) #define XTIMER_WIDTH (16)
#endif #endif
#define XTIMER_CHAN (0)
/** @} */ /** @} */
/** /**

View File

@ -199,19 +199,6 @@ static const spi_dev_t spi_config[] = {
* or two regular timers in cascade mode. * or two regular timers in cascade mode.
* @{ * @{
*/ */
#if IS_ACTIVE(CONFIG_EFM32_USE_LETIMER)
static const timer_conf_t timer_config[] = {
{
.timer = {
.dev = LETIMER0,
.cmu = cmuClock_LETIMER0
},
.irq = LETIMER0_IRQn
}
};
#define TIMER_0_ISR isr_letimer0
#else
static const timer_conf_t timer_config[] = { static const timer_conf_t timer_config[] = {
{ {
.prescaler = { .prescaler = {
@ -222,12 +209,25 @@ static const timer_conf_t timer_config[] = {
.dev = TIMER1, .dev = TIMER1,
.cmu = cmuClock_TIMER1 .cmu = cmuClock_TIMER1
}, },
.irq = TIMER1_IRQn .irq = TIMER1_IRQn,
} .channel_numof = 3
},
{
.prescaler = {
.dev = NULL,
.cmu = cmuClock_LETIMER0
},
.timer = {
.dev = LETIMER0,
.cmu = cmuClock_LETIMER0
},
.irq = LETIMER0_IRQn,
.channel_numof = 2
},
}; };
#define TIMER_0_ISR isr_timer1
#endif /* CONFIG_EFM32_USE_LETIMER */ #define TIMER_0_ISR isr_timer1
#define TIMER_1_ISR isr_letimer0
#define TIMER_NUMOF ARRAY_SIZE(timer_config) #define TIMER_NUMOF ARRAY_SIZE(timer_config)
/** @} */ /** @} */