drivers/periph/rtt: add periph_rtt_set_counter feature
Some periph_rtt implementations do not provide `rtt_set_counter()`. This adds `periph_rtt_set_counter` as feature to allow testing for its availability. The feature is provided at CPU level if periph_rtt is provided by the board for all CPUs implementing `rtt_set_counter()`.
This commit is contained in:
parent
720b350f6f
commit
b9cb75fedf
@ -8,6 +8,7 @@ FEATURES_PROVIDED += periph_cpuid
|
||||
FEATURES_PROVIDED += periph_eeprom
|
||||
FEATURES_PROVIDED += periph_gpio periph_gpio_irq
|
||||
FEATURES_PROVIDED += periph_pm
|
||||
FEATURES_PROVIDED += periph_rtt_set_counter
|
||||
FEATURES_PROVIDED += periph_timer_periodic
|
||||
FEATURES_PROVIDED += periph_wdt
|
||||
FEATURES_PROVIDED += puf_sram
|
||||
|
||||
@ -6,6 +6,7 @@ FEATURES_PROVIDED += periph_flashpage
|
||||
FEATURES_PROVIDED += periph_flashpage_pagewise
|
||||
FEATURES_PROVIDED += periph_gpio periph_gpio_irq
|
||||
FEATURES_PROVIDED += periph_hwrng
|
||||
FEATURES_PROVIDED += periph_rtt_set_counter
|
||||
FEATURES_PROVIDED += periph_uart_modecfg
|
||||
FEATURES_PROVIDED += periph_uart_nonblocking
|
||||
FEATURES_PROVIDED += periph_wdt
|
||||
|
||||
@ -13,6 +13,7 @@ FEATURES_PROVIDED += periph_cpuid
|
||||
FEATURES_PROVIDED += periph_flashpage
|
||||
FEATURES_PROVIDED += periph_flashpage_pagewise
|
||||
FEATURES_PROVIDED += periph_gpio periph_gpio_irq
|
||||
FEATURES_PROVIDED += periph_rtt_set_counter
|
||||
FEATURES_PROVIDED += periph_wdt
|
||||
|
||||
FEATURES_CONFLICT += periph_rtc:periph_rtt
|
||||
|
||||
@ -9,3 +9,4 @@ FEATURES_PROVIDED += esp_wifi_enterprise
|
||||
FEATURES_PROVIDED += periph_adc_ctrl
|
||||
FEATURES_PROVIDED += periph_rtc
|
||||
FEATURES_PROVIDED += periph_rtt
|
||||
FEATURES_PROVIDED += periph_rtt_set_counter
|
||||
|
||||
@ -7,3 +7,4 @@ include $(RIOTCPU)/esp_common/Makefile.features
|
||||
FEATURES_PROVIDED += arch_esp8266
|
||||
FEATURES_PROVIDED += periph_rtt
|
||||
FEATURES_PROVIDED += periph_rtc
|
||||
FEATURES_PROVIDED += periph_rtt_set_counter
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
FEATURES_PROVIDED += periph_cpuid
|
||||
FEATURES_PROVIDED += periph_gpio periph_gpio_irq
|
||||
FEATURES_PROVIDED += periph_pm
|
||||
FEATURES_PROVIDED += periph_rtt_set_counter
|
||||
FEATURES_PROVIDED += periph_wdt
|
||||
|
||||
include $(RIOTCPU)/riscv_common/Makefile.features
|
||||
|
||||
@ -14,6 +14,7 @@ endif
|
||||
|
||||
FEATURES_PROVIDED += periph_gpio
|
||||
FEATURES_PROVIDED += periph_gpio_irq
|
||||
FEATURES_PROVIDED += periph_rtt_set_counter
|
||||
|
||||
# Parse parameters from CPU_MODEL using the kinetis-info.mk script in the same
|
||||
# directory as this Makefile.
|
||||
|
||||
@ -4,6 +4,7 @@ FEATURES_PROVIDED += periph_flashpage
|
||||
FEATURES_PROVIDED += periph_flashpage_pagewise
|
||||
FEATURES_PROVIDED += periph_gpio periph_gpio_irq
|
||||
FEATURES_PROVIDED += periph_hwrng
|
||||
FEATURES_PROVIDED += periph_rtt_set_counter
|
||||
FEATURES_PROVIDED += periph_temperature
|
||||
FEATURES_PROVIDED += periph_timer_periodic
|
||||
FEATURES_PROVIDED += periph_uart_modecfg
|
||||
|
||||
@ -12,6 +12,7 @@ FEATURES_PROVIDED += periph_flashpage_pagewise
|
||||
FEATURES_PROVIDED += periph_flashpage_rwee
|
||||
FEATURES_PROVIDED += periph_gpio periph_gpio_irq
|
||||
FEATURES_PROVIDED += periph_i2c_reconfigure
|
||||
FEATURES_PROVIDED += periph_rtt_set_counter
|
||||
FEATURES_PROVIDED += periph_spi_reconfigure
|
||||
FEATURES_PROVIDED += periph_timer_periodic # implements timer_set_periodic()
|
||||
FEATURES_PROVIDED += periph_uart_modecfg
|
||||
|
||||
@ -28,6 +28,7 @@ endif
|
||||
ifeq (f1,$(CPU_FAM))
|
||||
FEATURES_CONFLICT += periph_rtc:periph_rtt
|
||||
FEATURES_CONFLICT_MSG += "On the STM32F1, the RTC and RTT map to the same hardware peripheral."
|
||||
FEATURES_PROVIDED += periph_rtt_set_counter
|
||||
endif
|
||||
|
||||
# Not all F4 and L0 parts implement a RNG.
|
||||
|
||||
@ -194,6 +194,8 @@ uint32_t rtt_get_counter(void);
|
||||
* @brief Set the RTT counter to a specified value.
|
||||
*
|
||||
* @param[in] counter The value to set the RTT to.
|
||||
*
|
||||
* @note This function is only provided when the feature `periph_rtt_set_counter` is provided
|
||||
*/
|
||||
void rtt_set_counter(uint32_t counter);
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user