Rename DEVICE_LOWPOWERTIMER to DEVICE_LPTICKER

That's to match DEVICE_USTICKER.
pull/7009/head
Bartek Szatkowski 2018-03-13 17:11:18 +00:00
parent f55f9d36fb
commit 6e9f04bf2f
30 changed files with 106 additions and 95 deletions

View File

@ -19,7 +19,7 @@
#include "unity/unity.h" #include "unity/unity.h"
#if !DEVICE_LOWPOWERTIMER #if !DEVICE_LPTICKER
#error [NOT_SUPPORTED] Low power ticker not supported for this target #error [NOT_SUPPORTED] Low power ticker not supported for this target
#endif #endif

View File

@ -14,8 +14,8 @@
* limitations under the License. * limitations under the License.
*/ */
#if !DEVICE_LOWPOWERTIMER #if !DEVICE_LPTICKER
#error [NOT_SUPPORTED] Low power timer not supported for this target #error [NOT_SUPPORTED] Low power timer not supported for this target
#endif #endif
#include "mbed.h" #include "mbed.h"

View File

@ -22,7 +22,7 @@
#include "rtos.h" #include "rtos.h"
#include "hal/us_ticker_api.h" #include "hal/us_ticker_api.h"
#if !DEVICE_LOWPOWERTIMER #if !DEVICE_LPTICKER
#error [NOT_SUPPORTED] test not supported #error [NOT_SUPPORTED] test not supported
#endif #endif

View File

@ -21,8 +21,8 @@
#include "lp_ticker_api_tests.h" #include "lp_ticker_api_tests.h"
#include "hal/lp_ticker_api.h" #include "hal/lp_ticker_api.h"
#if !DEVICE_LOWPOWERTIMER #if !DEVICE_LPTICKER
#error [NOT_SUPPORTED] test not supported #error [NOT_SUPPORTED] Low power timer not supported for this target
#endif #endif
using namespace utest::v1; using namespace utest::v1;

View File

@ -73,7 +73,7 @@ void ticker_event_handler_stub(const ticker_data_t * const ticker)
if (ticker == get_us_ticker_data()) { if (ticker == get_us_ticker_data()) {
us_ticker_clear_interrupt(); us_ticker_clear_interrupt();
} else { } else {
#if DEVICE_LOWPOWERTIMER #if DEVICE_LPTICKER
lp_ticker_clear_interrupt(); lp_ticker_clear_interrupt();
#endif #endif
} }
@ -411,7 +411,7 @@ utest::v1::status_t hf_ticker_setup(const Case *const source, const size_t index
return greentea_case_setup_handler(source, index_of_case); return greentea_case_setup_handler(source, index_of_case);
} }
#if DEVICE_LOWPOWERTIMER #if DEVICE_LPTICKER
utest::v1::status_t lp_ticker_setup(const Case *const source, const size_t index_of_case) utest::v1::status_t lp_ticker_setup(const Case *const source, const size_t index_of_case)
{ {
intf = get_lp_ticker_data()->interface; intf = get_lp_ticker_data()->interface;
@ -444,7 +444,7 @@ Case cases[] = {
Case("hf ticker overflow test", hf_ticker_setup, ticker_overflow_test), Case("hf ticker overflow test", hf_ticker_setup, ticker_overflow_test),
Case("hf ticker increment test", hf_ticker_setup, ticker_increment_test), Case("hf ticker increment test", hf_ticker_setup, ticker_increment_test),
Case("hf ticker speed test", hf_ticker_setup, ticker_speed_test), Case("hf ticker speed test", hf_ticker_setup, ticker_speed_test),
#if DEVICE_LOWPOWERTIMER #if DEVICE_LPTICKER
Case("lp ticker init is safe to call repeatedly", lp_ticker_setup, ticker_init_test), Case("lp ticker init is safe to call repeatedly", lp_ticker_setup, ticker_init_test),
Case("lp ticker info test", lp_ticker_setup, ticker_info_test), Case("lp ticker info test", lp_ticker_setup, ticker_info_test),
Case("lp ticker interrupt test", lp_ticker_setup, ticker_interrupt_test), Case("lp ticker interrupt test", lp_ticker_setup, ticker_interrupt_test),

View File

@ -51,7 +51,7 @@ void ticker_event_handler_stub(const ticker_data_t * const ticker)
if (ticker == get_us_ticker_data()) { if (ticker == get_us_ticker_data()) {
us_ticker_clear_interrupt(); us_ticker_clear_interrupt();
} else { } else {
#if DEVICE_LOWPOWERTIMER #if DEVICE_LPTICKER
lp_ticker_clear_interrupt(); lp_ticker_clear_interrupt();
#endif #endif
} }
@ -111,7 +111,7 @@ utest::v1::status_t hf_ticker_case_setup_handler_t(const Case * const source, co
return greentea_case_setup_handler(source, index_of_case); return greentea_case_setup_handler(source, index_of_case);
} }
#if DEVICE_LOWPOWERTIMER #if DEVICE_LPTICKER
utest::v1::status_t lp_ticker_case_setup_handler_t(const Case * const source, const size_t index_of_case) utest::v1::status_t lp_ticker_case_setup_handler_t(const Case * const source, const size_t index_of_case)
{ {
intf = get_lp_ticker_data()->interface; intf = get_lp_ticker_data()->interface;
@ -130,7 +130,7 @@ utest::v1::status_t ticker_case_teardown_handler_t(const Case * const source, co
Case cases[] = { Case cases[] = {
Case("hf ticker frequency test", hf_ticker_case_setup_handler_t, ticker_frequency_test, Case("hf ticker frequency test", hf_ticker_case_setup_handler_t, ticker_frequency_test,
ticker_case_teardown_handler_t), ticker_case_teardown_handler_t),
#if DEVICE_LOWPOWERTIMER #if DEVICE_LPTICKER
Case("lp ticker frequency test", lp_ticker_case_setup_handler_t, ticker_frequency_test, Case("lp ticker frequency test", lp_ticker_case_setup_handler_t, ticker_frequency_test,
ticker_case_teardown_handler_t), ticker_case_teardown_handler_t),
#endif #endif

View File

@ -2079,7 +2079,7 @@ PREDEFINED = DOXYGEN_ONLY \
DEVICE_I2C_ASYNCH \ DEVICE_I2C_ASYNCH \
DEVICE_INTERRUPTIN \ DEVICE_INTERRUPTIN \
DEVICE_ITM \ DEVICE_ITM \
DEVICE_LOWPOWERTIMER \ DEVICE_LPTICKER \
DEVICE_PORTIN \ DEVICE_PORTIN \
DEVICE_PORTINOUT \ DEVICE_PORTINOUT \
DEVICE_PORTOUT \ DEVICE_PORTOUT \

View File

@ -6,7 +6,7 @@
"SEARCH_INCLUDES": "YES", "SEARCH_INCLUDES": "YES",
"INCLUDE_PATH": "", "INCLUDE_PATH": "",
"INCLUDE_FILE_PATTERNS": "", "INCLUDE_FILE_PATTERNS": "",
"PREDEFINED": "DOXYGEN_ONLY DEVICE_ANALOGIN DEVICE_ANALOGOUT DEVICE_CAN DEVICE_CRC DEVICE_ETHERNET DEVICE_EMAC DEVICE_FLASH DEVICE_I2C DEVICE_I2CSLAVE DEVICE_I2C_ASYNCH DEVICE_INTERRUPTIN DEVICE_ITM DEVICE_LOWPOWERTIMER DEVICE_PORTIN DEVICE_PORTINOUT DEVICE_PORTOUT DEVICE_PWMOUT DEVICE_RTC DEVICE_TRNG DEVICE_SERIAL DEVICE_SERIAL_ASYNCH DEVICE_SERIAL_FC DEVICE_SLEEP DEVICE_SPI DEVICE_SPI_ASYNCH DEVICE_SPISLAVE DEVICE_STORAGE \"MBED_DEPRECATED_SINCE(f, g)=\" \"MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, M)=\" \"MBED_DEPRECATED(s)=\"", "PREDEFINED": "DOXYGEN_ONLY DEVICE_ANALOGIN DEVICE_ANALOGOUT DEVICE_CAN DEVICE_CRC DEVICE_ETHERNET DEVICE_EMAC DEVICE_FLASH DEVICE_I2C DEVICE_I2CSLAVE DEVICE_I2C_ASYNCH DEVICE_INTERRUPTIN DEVICE_ITM DEVICE_LPTICKER DEVICE_PORTIN DEVICE_PORTINOUT DEVICE_PORTOUT DEVICE_PWMOUT DEVICE_RTC DEVICE_TRNG DEVICE_SERIAL DEVICE_SERIAL_ASYNCH DEVICE_SERIAL_FC DEVICE_SLEEP DEVICE_SPI DEVICE_SPI_ASYNCH DEVICE_SPISLAVE DEVICE_STORAGE \"MBED_DEPRECATED_SINCE(f, g)=\" \"MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, M)=\" \"MBED_DEPRECATED(s)=\"",
"EXPAND_AS_DEFINED": "", "EXPAND_AS_DEFINED": "",
"SKIP_FUNCTION_MACROS": "NO", "SKIP_FUNCTION_MACROS": "NO",
"STRIP_CODE_COMMENTS": "NO", "STRIP_CODE_COMMENTS": "NO",

View File

@ -20,7 +20,7 @@
#include "drivers/Ticker.h" #include "drivers/Ticker.h"
#include "platform/NonCopyable.h" #include "platform/NonCopyable.h"
#if defined (DEVICE_LOWPOWERTIMER) || defined(DOXYGEN_ONLY) #if defined (DEVICE_LPTICKER) || defined(DOXYGEN_ONLY)
#include "hal/lp_ticker_api.h" #include "hal/lp_ticker_api.h"

View File

@ -18,7 +18,7 @@
#include "platform/platform.h" #include "platform/platform.h"
#if defined (DEVICE_LOWPOWERTIMER) || defined(DOXYGEN_ONLY) #if defined (DEVICE_LPTICKER) || defined(DOXYGEN_ONLY)
#include "hal/lp_ticker_api.h" #include "hal/lp_ticker_api.h"
#include "drivers/LowPowerTicker.h" #include "drivers/LowPowerTicker.h"

View File

@ -20,7 +20,7 @@
#include "drivers/Timer.h" #include "drivers/Timer.h"
#include "platform/NonCopyable.h" #include "platform/NonCopyable.h"
#if defined (DEVICE_LOWPOWERTIMER) || defined(DOXYGEN_ONLY) #if defined (DEVICE_LPTICKER) || defined(DOXYGEN_ONLY)
#include "hal/lp_ticker_api.h" #include "hal/lp_ticker_api.h"

View File

@ -71,7 +71,7 @@ public:
// When low power ticker is in use, then do not disable deep-sleep. // When low power ticker is in use, then do not disable deep-sleep.
Ticker(const ticker_data_t *data) : TimerEvent(data), _function(0), _lock_deepsleep(true) { Ticker(const ticker_data_t *data) : TimerEvent(data), _function(0), _lock_deepsleep(true) {
#if DEVICE_LOWPOWERTIMER #if DEVICE_LPTICKER
_lock_deepsleep = (data != get_lp_ticker_data()); _lock_deepsleep = (data != get_lp_ticker_data());
#endif #endif
} }

View File

@ -27,7 +27,7 @@ Timer::Timer() : _running(), _start(), _time(), _ticker_data(get_us_ticker_data(
Timer::Timer(const ticker_data_t *data) : _running(), _start(), _time(), _ticker_data(data), _lock_deepsleep(true) { Timer::Timer(const ticker_data_t *data) : _running(), _start(), _time(), _ticker_data(data), _lock_deepsleep(true) {
reset(); reset();
#if DEVICE_LOWPOWERTIMER #if DEVICE_LPTICKER
_lock_deepsleep = (data != get_lp_ticker_data()); _lock_deepsleep = (data != get_lp_ticker_data());
#endif #endif
} }

View File

@ -21,7 +21,7 @@
#include "device.h" #include "device.h"
#if DEVICE_LOWPOWERTIMER #if DEVICE_LPTICKER
#include "hal/ticker_api.h" #include "hal/ticker_api.h"

View File

@ -15,7 +15,7 @@
*/ */
#include "hal/lp_ticker_api.h" #include "hal/lp_ticker_api.h"
#if DEVICE_LOWPOWERTIMER #if DEVICE_LPTICKER
void lp_ticker_set_interrupt_wrapper(timestamp_t timestamp); void lp_ticker_set_interrupt_wrapper(timestamp_t timestamp);

View File

@ -30,7 +30,7 @@ static uint32_t lp_ticker_overflows_delta = 0;
/* lp_ticker Overflow limit */ /* lp_ticker Overflow limit */
static uint32_t lp_ticker_overflow_limit = 0; static uint32_t lp_ticker_overflow_limit = 0;
#if DEVICE_LOWPOWERTIMER #if DEVICE_LPTICKER
/** /**
* Interrupt Handler * Interrupt Handler
*/ */

View File

@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
*/ */
#if DEVICE_LOWPOWERTIMER #if DEVICE_LPTICKER
#include "lp_ticker_api.h" #include "lp_ticker_api.h"
#include "fsl_rtc.h" #include "fsl_rtc.h"
@ -241,4 +241,4 @@ void lp_ticker_clear_interrupt(void)
lptmr_schedule = 0; lptmr_schedule = 0;
} }
#endif /* DEVICE_LOWPOWERTIMER */ #endif /* DEVICE_LPTICKER */

View File

@ -15,7 +15,7 @@
*/ */
#include "lp_ticker_api.h" #include "lp_ticker_api.h"
#if DEVICE_LOWPOWERTIMER #if DEVICE_LPTICKER
#include "common_rtc.h" #include "common_rtc.h"
#include "mbed_critical.h" #include "mbed_critical.h"
@ -60,4 +60,4 @@ void lp_ticker_clear_interrupt(void)
nrf_rtc_event_clear(COMMON_RTC_INSTANCE, LP_TICKER_EVENT); nrf_rtc_event_clear(COMMON_RTC_INSTANCE, LP_TICKER_EVENT);
} }
#endif // DEVICE_LOWPOWERTIMER #endif // DEVICE_LPTICKER

View File

@ -81,7 +81,7 @@ void COMMON_RTC_IRQ_HANDLER(void)
us_ticker_irq_handler(); us_ticker_irq_handler();
} }
#if DEVICE_LOWPOWERTIMER #if DEVICE_LPTICKER
if (m_common_sw_irq_flag & LP_TICKER_SW_IRQ_MASK) { if (m_common_sw_irq_flag & LP_TICKER_SW_IRQ_MASK) {
m_common_sw_irq_flag &= ~LP_TICKER_SW_IRQ_MASK; m_common_sw_irq_flag &= ~LP_TICKER_SW_IRQ_MASK;
lp_ticker_irq_handler(); lp_ticker_irq_handler();
@ -133,7 +133,7 @@ void common_rtc_init(void)
#if defined(TARGET_MCU_NRF51822) #if defined(TARGET_MCU_NRF51822)
nrf_rtc_event_clear(COMMON_RTC_INSTANCE, OS_TICK_EVENT); nrf_rtc_event_clear(COMMON_RTC_INSTANCE, OS_TICK_EVENT);
#endif #endif
#if DEVICE_LOWPOWERTIMER #if DEVICE_LPTICKER
nrf_rtc_event_clear(COMMON_RTC_INSTANCE, LP_TICKER_EVENT); nrf_rtc_event_clear(COMMON_RTC_INSTANCE, LP_TICKER_EVENT);
#endif #endif
nrf_rtc_event_clear(COMMON_RTC_INSTANCE, NRF_RTC_EVENT_OVERFLOW); nrf_rtc_event_clear(COMMON_RTC_INSTANCE, NRF_RTC_EVENT_OVERFLOW);
@ -142,7 +142,7 @@ void common_rtc_init(void)
// events will be enabled or disabled as needed (such approach is more // events will be enabled or disabled as needed (such approach is more
// energy efficient). // energy efficient).
nrf_rtc_int_enable(COMMON_RTC_INSTANCE, nrf_rtc_int_enable(COMMON_RTC_INSTANCE,
#if DEVICE_LOWPOWERTIMER #if DEVICE_LPTICKER
LP_TICKER_INT_MASK | LP_TICKER_INT_MASK |
#endif #endif
US_TICKER_INT_MASK | US_TICKER_INT_MASK |
@ -156,7 +156,7 @@ void common_rtc_init(void)
#if defined(TARGET_MCU_NRF51822) #if defined(TARGET_MCU_NRF51822)
OS_TICK_INT_MASK | OS_TICK_INT_MASK |
#endif #endif
#if DEVICE_LOWPOWERTIMER #if DEVICE_LPTICKER
LP_TICKER_INT_MASK | LP_TICKER_INT_MASK |
#endif #endif
US_TICKER_INT_MASK); US_TICKER_INT_MASK);

View File

@ -16,7 +16,7 @@
#include "lp_ticker_api.h" #include "lp_ticker_api.h"
#if DEVICE_LOWPOWERTIMER #if DEVICE_LPTICKER
#include "sleep_api.h" #include "sleep_api.h"
#include "mbed_wait_api.h" #include "mbed_wait_api.h"

View File

@ -16,7 +16,7 @@
#include "lp_ticker_api.h" #include "lp_ticker_api.h"
#if DEVICE_LOWPOWERTIMER #if DEVICE_LPTICKER
#include "sleep_api.h" #include "sleep_api.h"
#include "mbed_wait_api.h" #include "mbed_wait_api.h"

View File

@ -16,7 +16,7 @@
#include "lp_ticker_api.h" #include "lp_ticker_api.h"
#if DEVICE_LOWPOWERTIMER #if DEVICE_LPTICKER
#include "sleep_api.h" #include "sleep_api.h"
#include "mbed_wait_api.h" #include "mbed_wait_api.h"

View File

@ -16,7 +16,7 @@
#include "lp_ticker_api.h" #include "lp_ticker_api.h"
#if DEVICE_LOWPOWERTIMER #if DEVICE_LPTICKER
#include "sleep_api.h" #include "sleep_api.h"
#include "mbed_wait_api.h" #include "mbed_wait_api.h"

View File

@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
*/ */
#if DEVICE_LOWPOWERTIMER #if DEVICE_LPTICKER
#include "lp_ticker_api.h" #include "lp_ticker_api.h"
#include "fsl_snvs_hp.h" #include "fsl_snvs_hp.h"
@ -131,4 +131,4 @@ void lp_ticker_clear_interrupt(void)
GPT_ClearStatusFlags(GPT2, kGPT_OutputCompare1Flag); GPT_ClearStatusFlags(GPT2, kGPT_OutputCompare1Flag);
} }
#endif /* DEVICE_LOWPOWERTIMER */ #endif /* DEVICE_LPTICKER */

View File

@ -7,11 +7,11 @@
* $Rev: $ * $Rev: $
* $Date: $ * $Date: $
****************************************************************************** ******************************************************************************
* Copyright 2016 Semiconductor Components Industries LLC (d/b/a ON Semiconductor). * Copyright 2016 Semiconductor Components Industries LLC (d/b/a <EFBFBD>ON Semiconductor<EFBFBD>).
* All rights reserved. This software and/or documentation is licensed by ON Semiconductor * All rights reserved. This software and/or documentation is licensed by ON Semiconductor
* under limited terms and conditions. The terms and conditions pertaining to the software * under limited terms and conditions. The terms and conditions pertaining to the software
* and/or documentation are available at http://www.onsemi.com/site/pdf/ONSEMI_T&C.pdf * and/or documentation are available at http://www.onsemi.com/site/pdf/ONSEMI_T&C.pdf
* (ON Semiconductor Standard Terms and Conditions of Sale, Section 8 Software) and * (<EFBFBD>ON Semiconductor Standard Terms and Conditions of Sale, Section 8 Software<EFBFBD>) and
* if applicable the software license agreement. Do not use this software and/or * if applicable the software license agreement. Do not use this software and/or
* documentation unless you have carefully read and you agree to the limited terms and * documentation unless you have carefully read and you agree to the limited terms and
* conditions. By using this software and/or documentation, you agree to the limited * conditions. By using this software and/or documentation, you agree to the limited
@ -32,7 +32,7 @@
*/ */
#include "device.h" #include "device.h"
#if DEVICE_LOWPOWERTIMER #if DEVICE_LPTICKER
#include "cmsis_nvic.h" #include "cmsis_nvic.h"
#include "lp_ticker_api.h" #include "lp_ticker_api.h"
@ -79,4 +79,4 @@ void lp_ticker_clear_interrupt(void)
fRtcClearInterrupt(); fRtcClearInterrupt();
} }
#endif /* DEVICE_LOWPOWERTIMER */ #endif /* DEVICE_LPTICKER */

View File

@ -28,11 +28,11 @@
******************************************************************************* *******************************************************************************
*/ */
#if DEVICE_LOWPOWERTIMER #if DEVICE_LPTICKER
#include "rtc_api_hal.h" #include "rtc_api_hal.h"
#if MBED_CONF_TARGET_LOWPOWERTIMER_LPTIM #if MBED_CONF_TARGET_LPTICKER_LPTIM
LPTIM_HandleTypeDef LptimHandle; LPTIM_HandleTypeDef LptimHandle;
@ -283,7 +283,7 @@ void lp_ticker_clear_interrupt(void)
__HAL_LPTIM_CLEAR_FLAG(&LptimHandle, LPTIM_FLAG_CMPM); __HAL_LPTIM_CLEAR_FLAG(&LptimHandle, LPTIM_FLAG_CMPM);
} }
#else /* MBED_CONF_TARGET_LOWPOWERTIMER_LPTIM */ #else /* MBED_CONF_TARGET_LPTICKER_LPTIM */
void lp_ticker_init(void) void lp_ticker_init(void)
{ {
@ -319,6 +319,6 @@ void lp_ticker_clear_interrupt(void)
NVIC_ClearPendingIRQ(RTC_WKUP_IRQn); NVIC_ClearPendingIRQ(RTC_WKUP_IRQn);
} }
#endif /* MBED_CONF_TARGET_LOWPOWERTIMER_LPTIM */ #endif /* MBED_CONF_TARGET_LPTICKER_LPTIM */
#endif /* DEVICE_LOWPOWERTIMER */ #endif /* DEVICE_LPTICKER */

View File

@ -35,14 +35,14 @@
static RTC_HandleTypeDef RtcHandle; static RTC_HandleTypeDef RtcHandle;
#if DEVICE_LOWPOWERTIMER && !MBED_CONF_TARGET_LOWPOWERTIMER_LPTIM #if DEVICE_LPTICKER && !MBED_CONF_TARGET_LPTICKER_LPTIM
#define GET_TICK_PERIOD(VALUE) (2048 * 1000000 / VALUE) /* 1s / SynchPrediv value * 2^11 (value to get the maximum precision value with no u32 overflow) */ #define GET_TICK_PERIOD(VALUE) (2048 * 1000000 / VALUE) /* 1s / SynchPrediv value * 2^11 (value to get the maximum precision value with no u32 overflow) */
static void (*irq_handler)(void); static void (*irq_handler)(void);
static void RTC_IRQHandler(void); static void RTC_IRQHandler(void);
static uint32_t lp_TickPeriod_us = GET_TICK_PERIOD(4095); /* default SynchPrediv value = 4095 */ static uint32_t lp_TickPeriod_us = GET_TICK_PERIOD(4095); /* default SynchPrediv value = 4095 */
#endif /* DEVICE_LOWPOWERTIMER && !MBED_CONF_TARGET_LOWPOWERTIMER_LPTIM */ #endif /* DEVICE_LPTICKER && !MBED_CONF_TARGET_LPTICKER_LPTIM */
void rtc_init(void) void rtc_init(void)
{ {
@ -111,14 +111,25 @@ void rtc_init(void)
RtcHandle.Init.AsynchPrediv = RTC_AUTO_1_SECOND; RtcHandle.Init.AsynchPrediv = RTC_AUTO_1_SECOND;
#else /* TARGET_STM32F1 */ #else /* TARGET_STM32F1 */
RtcHandle.Init.HourFormat = RTC_HOURFORMAT_24; RtcHandle.Init.HourFormat = RTC_HOURFORMAT_24;
RtcHandle.Init.AsynchPrediv = PREDIV_A_VALUE;
RtcHandle.Init.SynchPrediv = PREDIV_S_VALUE; /* PREDIV_A : 7-bit asynchronous prescaler */
#if DEVICE_LPTICKER && !MBED_CONF_TARGET_LPTICKER_LPTIM
/* PREDIV_A is set to a small value to improve the SubSeconds resolution */
/* with a 32768Hz clock, PREDIV_A=7 gives a precision of 244us */
RtcHandle.Init.AsynchPrediv = 7;
#else
/* PREDIV_A is set to the maximum value to improve the consumption */
RtcHandle.Init.AsynchPrediv = 0x007F;
#endif
/* PREDIV_S : 15-bit synchronous prescaler */
/* PREDIV_S is set in order to get a 1 Hz clock */
RtcHandle.Init.SynchPrediv = RTC_CLOCK / (RtcHandle.Init.AsynchPrediv + 1) - 1;
RtcHandle.Init.OutPut = RTC_OUTPUT_DISABLE; RtcHandle.Init.OutPut = RTC_OUTPUT_DISABLE;
RtcHandle.Init.OutPutPolarity = RTC_OUTPUT_POLARITY_HIGH; RtcHandle.Init.OutPutPolarity = RTC_OUTPUT_POLARITY_HIGH;
RtcHandle.Init.OutPutType = RTC_OUTPUT_TYPE_OPENDRAIN; RtcHandle.Init.OutPutType = RTC_OUTPUT_TYPE_OPENDRAIN;
#endif /* TARGET_STM32F1 */ #endif /* TARGET_STM32F1 */
#if DEVICE_LOWPOWERTIMER && !MBED_CONF_TARGET_LOWPOWERTIMER_LPTIM #if DEVICE_LPTICKER && !MBED_CONF_TARGET_LPTICKER_LPTIM
lp_TickPeriod_us = GET_TICK_PERIOD(RtcHandle.Init.SynchPrediv); lp_TickPeriod_us = GET_TICK_PERIOD(RtcHandle.Init.SynchPrediv);
#endif #endif
@ -285,7 +296,7 @@ void rtc_synchronize(void)
} }
} }
#if DEVICE_LOWPOWERTIMER && !MBED_CONF_TARGET_LOWPOWERTIMER_LPTIM #if DEVICE_LPTICKER && !MBED_CONF_TARGET_LPTICKER_LPTIM
static void RTC_IRQHandler(void) static void RTC_IRQHandler(void)
{ {
@ -369,6 +380,6 @@ void rtc_deactivate_wake_up_timer(void)
HAL_RTCEx_DeactivateWakeUpTimer(&RtcHandle); HAL_RTCEx_DeactivateWakeUpTimer(&RtcHandle);
} }
#endif /* DEVICE_LOWPOWERTIMER && !MBED_CONF_TARGET_LOWPOWERTIMER_LPTIM */ #endif /* DEVICE_LPTICKER && !MBED_CONF_TARGET_LPTICKER_LPTIM */
#endif /* DEVICE_RTC */ #endif /* DEVICE_RTC */

View File

@ -23,7 +23,7 @@
#include "device.h" #include "device.h"
#include "clocking.h" #include "clocking.h"
#if DEVICE_LOWPOWERTIMER #if DEVICE_LPTICKER
/******************************************************************************* /*******************************************************************************
* The Silicon Labs lp_ticker implementation is mapped on top of an extended RTC * The Silicon Labs lp_ticker implementation is mapped on top of an extended RTC

View File

@ -630,7 +630,7 @@
"macros": ["CPU_MK64FN1M0VMD12", "FSL_RTOS_MBED"], "macros": ["CPU_MK64FN1M0VMD12", "FSL_RTOS_MBED"],
"inherits": ["Target"], "inherits": ["Target"],
"detect_code": ["0240"], "detect_code": ["0240"],
"device_has": ["USTICKER", "LOWPOWERTIMER", "CRC", "ANALOGIN", "ANALOGOUT", "EMAC", "I2C", "I2CSLAVE", "INTERRUPTIN", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "RTC", "SERIAL", "SERIAL_FC", "SERIAL_ASYNCH", "SLEEP", "SPI", "SPI_ASYNCH", "SPISLAVE", "STDIO_MESSAGES", "STORAGE", "TRNG", "FLASH"], "device_has": ["USTICKER", "LPTICKER", "CRC", "ANALOGIN", "ANALOGOUT", "EMAC", "I2C", "I2CSLAVE", "INTERRUPTIN", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "RTC", "SERIAL", "SERIAL_FC", "SERIAL_ASYNCH", "SLEEP", "SPI", "SPI_ASYNCH", "SPISLAVE", "STDIO_MESSAGES", "STORAGE", "TRNG", "FLASH"],
"features": ["LWIP", "STORAGE"], "features": ["LWIP", "STORAGE"],
"release_versions": ["2", "5"], "release_versions": ["2", "5"],
"device_name": "MK64FN1M0xxx12", "device_name": "MK64FN1M0xxx12",
@ -1095,8 +1095,8 @@
"value": "USE_PLL_HSE_EXTC|USE_PLL_HSI", "value": "USE_PLL_HSE_EXTC|USE_PLL_HSI",
"macro_name": "CLOCK_SOURCE" "macro_name": "CLOCK_SOURCE"
}, },
"lowpowertimer_lptim": { "lpticker_lptim": {
"help": "This target supports LPTIM. Set value 1 to use LPTIM for LOWPOWERTIMER, or 0 to use RTC wakeup timer", "help": "This target supports LPTIM. Set value 1 to use LPTIM for LPTICKER, or 0 to use RTC wakeup timer",
"value": 1 "value": 1
} }
}, },
@ -1203,8 +1203,8 @@
"value": "USE_PLL_HSE_EXTC|USE_PLL_HSI", "value": "USE_PLL_HSE_EXTC|USE_PLL_HSI",
"macro_name": "CLOCK_SOURCE" "macro_name": "CLOCK_SOURCE"
}, },
"lowpowertimer_lptim": { "lpticker_lptim": {
"help": "This target supports LPTIM. Set value 1 to use LPTIM for LOWPOWERTIMER, or 0 to use RTC wakeup timer", "help": "This target supports LPTIM. Set value 1 to use LPTIM for LPTICKER, or 0 to use RTC wakeup timer",
"value": 1 "value": 1
} }
}, },
@ -1373,8 +1373,8 @@
"value": "USE_PLL_HSE_EXTC|USE_PLL_HSI", "value": "USE_PLL_HSE_EXTC|USE_PLL_HSI",
"macro_name": "CLOCK_SOURCE" "macro_name": "CLOCK_SOURCE"
}, },
"lowpowertimer_lptim": { "lpticker_lptim": {
"help": "This target supports LPTIM. Set value 1 to use LPTIM for LOWPOWERTIMER, or 0 to use RTC wakeup timer", "help": "This target supports LPTIM. Set value 1 to use LPTIM for LPTICKER, or 0 to use RTC wakeup timer",
"value": 1 "value": 1
} }
}, },
@ -1405,8 +1405,8 @@
"value": "USE_PLL_HSE_EXTC|USE_PLL_HSI", "value": "USE_PLL_HSE_EXTC|USE_PLL_HSI",
"macro_name": "CLOCK_SOURCE" "macro_name": "CLOCK_SOURCE"
}, },
"lowpowertimer_lptim": { "lpticker_lptim": {
"help": "This target supports LPTIM. Set value 1 to use LPTIM for LOWPOWERTIMER, or 0 to use RTC wakeup timer", "help": "This target supports LPTIM. Set value 1 to use LPTIM for LPTICKER, or 0 to use RTC wakeup timer",
"value": 1 "value": 1
} }
}, },
@ -1436,8 +1436,8 @@
"value": "USE_PLL_HSE_EXTC|USE_PLL_HSI", "value": "USE_PLL_HSE_EXTC|USE_PLL_HSI",
"macro_name": "CLOCK_SOURCE" "macro_name": "CLOCK_SOURCE"
}, },
"lowpowertimer_lptim": { "lpticker_lptim": {
"help": "This target supports LPTIM. Set value 1 to use LPTIM for LOWPOWERTIMER, or 0 to use RTC wakeup timer", "help": "This target supports LPTIM. Set value 1 to use LPTIM for LPTICKER, or 0 to use RTC wakeup timer",
"value": 1 "value": 1
} }
}, },
@ -1466,8 +1466,8 @@
"value": "USE_PLL_HSE_EXTC|USE_PLL_HSI", "value": "USE_PLL_HSE_EXTC|USE_PLL_HSI",
"macro_name": "CLOCK_SOURCE" "macro_name": "CLOCK_SOURCE"
}, },
"lowpowertimer_lptim": { "lpticker_lptim": {
"help": "This target supports LPTIM. Set value 1 to use LPTIM for LOWPOWERTIMER, or 0 to use RTC wakeup timer", "help": "This target supports LPTIM. Set value 1 to use LPTIM for LPTICKER, or 0 to use RTC wakeup timer",
"value": 1 "value": 1
} }
}, },
@ -1489,8 +1489,8 @@
"value": "USE_PLL_HSI", "value": "USE_PLL_HSI",
"macro_name": "CLOCK_SOURCE" "macro_name": "CLOCK_SOURCE"
}, },
"lowpowertimer_lptim": { "lpticker_lptim": {
"help": "This target supports LPTIM. Set value 1 to use LPTIM for LOWPOWERTIMER, or 0 to use RTC wakeup timer", "help": "This target supports LPTIM. Set value 1 to use LPTIM for LPTICKER, or 0 to use RTC wakeup timer",
"value": 1 "value": 1
} }
}, },
@ -1511,8 +1511,8 @@
"value": "USE_PLL_HSE_EXTC|USE_PLL_HSI", "value": "USE_PLL_HSE_EXTC|USE_PLL_HSI",
"macro_name": "CLOCK_SOURCE" "macro_name": "CLOCK_SOURCE"
}, },
"lowpowertimer_lptim": { "lpticker_lptim": {
"help": "This target supports LPTIM. Set value 1 to use LPTIM for LOWPOWERTIMER, or 0 to use RTC wakeup timer", "help": "This target supports LPTIM. Set value 1 to use LPTIM for LPTICKER, or 0 to use RTC wakeup timer",
"value": 1 "value": 1
} }
}, },
@ -1533,8 +1533,8 @@
"value": "USE_PLL_HSE_EXTC|USE_PLL_HSI", "value": "USE_PLL_HSE_EXTC|USE_PLL_HSI",
"macro_name": "CLOCK_SOURCE" "macro_name": "CLOCK_SOURCE"
}, },
"lowpowertimer_lptim": { "lpticker_lptim": {
"help": "This target supports LPTIM. Set value 1 to use LPTIM for LOWPOWERTIMER, or 0 to use RTC wakeup timer", "help": "This target supports LPTIM. Set value 1 to use LPTIM for LPTICKER, or 0 to use RTC wakeup timer",
"value": 1 "value": 1
} }
}, },
@ -1571,8 +1571,8 @@
"value": "USE_PLL_MSI", "value": "USE_PLL_MSI",
"macro_name": "CLOCK_SOURCE" "macro_name": "CLOCK_SOURCE"
}, },
"lowpowertimer_lptim": { "lpticker_lptim": {
"help": "This target supports LPTIM. Set value 1 to use LPTIM for LOWPOWERTIMER, or 0 to use RTC wakeup timer", "help": "This target supports LPTIM. Set value 1 to use LPTIM for LPTICKER, or 0 to use RTC wakeup timer",
"value": 1 "value": 1
} }
}, },
@ -1593,8 +1593,8 @@
"value": "USE_PLL_MSI", "value": "USE_PLL_MSI",
"macro_name": "CLOCK_SOURCE" "macro_name": "CLOCK_SOURCE"
}, },
"lowpowertimer_lptim": { "lpticker_lptim": {
"help": "This target supports LPTIM. Set value 1 to use LPTIM for LOWPOWERTIMER, or 0 to use RTC wakeup timer", "help": "This target supports LPTIM. Set value 1 to use LPTIM for LPTICKER, or 0 to use RTC wakeup timer",
"value": 1 "value": 1
} }
}, },
@ -1635,8 +1635,8 @@
"value": "USE_PLL_MSI", "value": "USE_PLL_MSI",
"macro_name": "CLOCK_SOURCE" "macro_name": "CLOCK_SOURCE"
}, },
"lowpowertimer_lptim": { "lpticker_lptim": {
"help": "This target supports LPTIM. Set value 1 to use LPTIM for LOWPOWERTIMER, or 0 to use RTC wakeup timer", "help": "This target supports LPTIM. Set value 1 to use LPTIM for LPTICKER, or 0 to use RTC wakeup timer",
"value": 1 "value": 1
} }
}, },
@ -1676,8 +1676,8 @@
"value": "USE_PLL_MSI", "value": "USE_PLL_MSI",
"macro_name": "CLOCK_SOURCE" "macro_name": "CLOCK_SOURCE"
}, },
"lowpowertimer_lptim": { "lpticker_lptim": {
"help": "This target supports LPTIM. Set value 1 to use LPTIM for LOWPOWERTIMER, or 0 to use RTC wakeup timer", "help": "This target supports LPTIM. Set value 1 to use LPTIM for LPTICKER, or 0 to use RTC wakeup timer",
"value": 1 "value": 1
} }
}, },
@ -1844,8 +1844,8 @@
"value": "USE_PLL_HSE_EXTC|USE_PLL_HSI", "value": "USE_PLL_HSE_EXTC|USE_PLL_HSI",
"macro_name": "CLOCK_SOURCE" "macro_name": "CLOCK_SOURCE"
}, },
"lowpowertimer_lptim": { "lpticker_lptim": {
"help": "This target supports LPTIM. Set value 1 to use LPTIM for LOWPOWERTIMER, or 0 to use RTC wakeup timer", "help": "This target supports LPTIM. Set value 1 to use LPTIM for LPTICKER, or 0 to use RTC wakeup timer",
"value": 1 "value": 1
} }
@ -1867,8 +1867,8 @@
"value": "USE_PLL_HSI", "value": "USE_PLL_HSI",
"macro_name": "CLOCK_SOURCE" "macro_name": "CLOCK_SOURCE"
}, },
"lowpowertimer_lptim": { "lpticker_lptim": {
"help": "This target supports LPTIM. Set value 1 to use LPTIM for LOWPOWERTIMER, or 0 to use RTC wakeup timer", "help": "This target supports LPTIM. Set value 1 to use LPTIM for LPTICKER, or 0 to use RTC wakeup timer",
"value": 1 "value": 1
} }
}, },
@ -1901,8 +1901,8 @@
"help": "Select the USB speed/connector (0=FullSpeed, 1=HighSpeed)", "help": "Select the USB speed/connector (0=FullSpeed, 1=HighSpeed)",
"value": "1" "value": "1"
}, },
"lowpowertimer_lptim": { "lpticker_lptim": {
"help": "This target supports LPTIM. Set value 1 to use LPTIM for LOWPOWERTIMER, or 0 to use RTC wakeup timer", "help": "This target supports LPTIM. Set value 1 to use LPTIM for LPTICKER, or 0 to use RTC wakeup timer",
"value": 1 "value": 1
} }
}, },
@ -1927,8 +1927,8 @@
"value": "USE_PLL_HSE_EXTC|USE_PLL_HSI", "value": "USE_PLL_HSE_EXTC|USE_PLL_HSI",
"macro_name": "CLOCK_SOURCE" "macro_name": "CLOCK_SOURCE"
}, },
"lowpowertimer_lptim": { "lpticker_lptim": {
"help": "This target supports LPTIM. Set value 1 to use LPTIM for LOWPOWERTIMER, or 0 to use RTC wakeup timer", "help": "This target supports LPTIM. Set value 1 to use LPTIM for LPTICKER, or 0 to use RTC wakeup timer",
"value": 1 "value": 1
} }
}, },
@ -1952,8 +1952,8 @@
"value": "USE_PLL_MSI", "value": "USE_PLL_MSI",
"macro_name": "CLOCK_SOURCE" "macro_name": "CLOCK_SOURCE"
}, },
"lowpowertimer_lptim": { "lpticker_lptim": {
"help": "This target supports LPTIM. Set value 1 to use LPTIM for LOWPOWERTIMER, or 0 to use RTC wakeup timer", "help": "This target supports LPTIM. Set value 1 to use LPTIM for LPTICKER, or 0 to use RTC wakeup timer",
"value": 1 "value": 1
} }
}, },
@ -1975,8 +1975,8 @@
"value": "USE_PLL_MSI", "value": "USE_PLL_MSI",
"macro_name": "CLOCK_SOURCE" "macro_name": "CLOCK_SOURCE"
}, },
"lowpowertimer_lptim": { "lpticker_lptim": {
"help": "This target supports LPTIM. Set value 1 to use LPTIM for LOWPOWERTIMER, or 0 to use RTC wakeup timer", "help": "This target supports LPTIM. Set value 1 to use LPTIM for LPTICKER, or 0 to use RTC wakeup timer",
"value": 1 "value": 1
} }
}, },
@ -4001,8 +4001,8 @@
"value": "USE_PLL_MSI", "value": "USE_PLL_MSI",
"macro_name": "CLOCK_SOURCE" "macro_name": "CLOCK_SOURCE"
}, },
"lowpowertimer_lptim": { "lpticker_lptim": {
"help": "This target supports LPTIM. Set value 1 to use LPTIM for LOWPOWERTIMER, or 0 to use RTC wakeup timer", "help": "This target supports LPTIM. Set value 1 to use LPTIM for LPTICKER, or 0 to use RTC wakeup timer",
"value": 1 "value": 1
} }
}, },

View File

@ -79,7 +79,7 @@ def check_inherits(dict):
DEVICE_HAS_ALLOWED = ["ANALOGIN", "ANALOGOUT", "CAN", "ETHERNET", "EMAC", DEVICE_HAS_ALLOWED = ["ANALOGIN", "ANALOGOUT", "CAN", "ETHERNET", "EMAC",
"FLASH", "I2C", "I2CSLAVE", "I2C_ASYNCH", "INTERRUPTIN", "FLASH", "I2C", "I2CSLAVE", "I2C_ASYNCH", "INTERRUPTIN",
"LOWPOWERTIMER", "PORTIN", "PORTINOUT", "PORTOUT", "LPTICKER", "PORTIN", "PORTINOUT", "PORTOUT",
"PWMOUT", "RTC", "TRNG","SERIAL", "SERIAL_ASYNCH", "PWMOUT", "RTC", "TRNG","SERIAL", "SERIAL_ASYNCH",
"SERIAL_FC", "SLEEP", "SPI", "SPI_ASYNCH", "SPISLAVE", "SERIAL_FC", "SLEEP", "SPI", "SPI_ASYNCH", "SPISLAVE",
"STORAGE", "STCLK_OFF_DURING_SLEEP"] "STORAGE", "STCLK_OFF_DURING_SLEEP"]