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

cpu/stm32f1: add unified rtt configuration

This commit is contained in:
Francisco Molina 2020-04-15 11:49:24 +02:00
parent e9d2fdb29b
commit 4d398ab09e
No known key found for this signature in database
GPG Key ID: 3E94EAC3DBDEEDA8
6 changed files with 28 additions and 29 deletions

View File

@ -153,14 +153,9 @@ static const uart_conf_t uart_config[] = {
* @name Real time counter configuration
* @{
*/
#define RTT_IRQ_PRIO 1
#define RTT_DEV RTC
#define RTT_IRQ RTC_IRQn
#define RTT_ISR isr_rtc
#define RTT_MAX_VALUE (0xffffffff)
#ifndef RTT_FREQUENCY
#define RTT_FREQUENCY (1) /* in Hz */
#define RTT_PRESCALER (0x7fff) /* run with 1 Hz */
#endif
/** @} */
/**

View File

@ -153,14 +153,9 @@ static const spi_conf_t spi_config[] = {
* @name Real time counter configuration
* @{
*/
#define RTT_IRQ_PRIO 1
#define RTT_DEV RTC
#define RTT_IRQ RTC_IRQn
#define RTT_ISR isr_rtc
#define RTT_MAX_VALUE (0xffffffff)
#ifndef RTT_FREQUENCY
#define RTT_FREQUENCY (1) /* in Hz */
#define RTT_PRESCALER (0x7fff) /* run with 1 Hz */
#endif
/** @} */
/**

View File

@ -123,14 +123,9 @@ static const uart_conf_t uart_config[] = {
* @name Real time counter configuration
* @{
*/
#define RTT_IRQ_PRIO 1
#define RTT_DEV RTC
#define RTT_IRQ RTC_IRQn
#define RTT_ISR isr_rtc
#define RTT_MAX_VALUE (0xffffffff)
#ifndef RTT_FREQUENCY
#define RTT_FREQUENCY (16384) /* in Hz */
#define RTT_PRESCALER (0x1) /* run with ~16 kHz Hz */
#endif
/** @} */
/**

View File

@ -197,14 +197,9 @@ static const uart_conf_t uart_config[] = {
* @name Real time counter configuration
* @{
*/
#define RTT_IRQ_PRIO 1
#define RTT_DEV RTC
#define RTT_IRQ RTC_IRQn
#define RTT_ISR isr_rtc
#define RTT_MAX_VALUE (0xffffffff)
#define RTT_FREQUENCY (16384) /* in Hz */
#define RTT_PRESCALER (0x1) /* run with ~16 kHz Hz */
#ifndef RTT_FREQUENCY
#define RTT_FREQUENCY (16384) /* in Hz */
#endif
/** @} */
/**

View File

@ -133,6 +133,23 @@ typedef struct {
uint8_t chan; /**< CPU ADC channel connected to the pin */
} adc_conf_t;
/**
* @name Real time counter configuration
* @{
*/
#define RTT_IRQ_PRIO 1
#define RTT_DEV RTC
#define RTT_IRQ RTC_IRQn
#define RTT_ISR isr_rtc
#define RTT_MAX_VALUE (0xffffffff)
#define RTT_CLOCK_FREQUENCY (32768U) /* in Hz */
#define RTT_MIN_FREQUENCY (1U) /* in Hz */
/* RTC frequency of 32kHz is not recommended, see RM0008 Rev 20, p490 */
#define RTT_MAX_FREQUENCY (RTT_CLOCK_FREQUENCY / 2) /* in Hz */
/** @} */
#ifdef __cplusplus
}
#endif

View File

@ -26,6 +26,8 @@
#define ENABLE_DEBUG (0)
#include "debug.h"
#define RTT_PRESCALER ((RTT_CLOCK_FREQUENCY / RTT_FREQUENCY) - 1 )
#define RTT_FLAG_RTOFF ((uint16_t)0x0020) /**< RTC Operation OFF flag */
#define RTT_FLAG_RSF ((uint16_t)0x0008) /**< Registers Synchronized flag */
#define RTT_FLAG_OW ((uint16_t)0x0004) /**< Overflow flag */