The RTC test validate proper implementation of the RTC hal. More...
Functions | |
void | rtc_init_test (void) |
Test that rtc_init can be called multiple times. More... | |
void | rtc_sleep_test (void) |
Test that the RTC keeps counting in the various sleep modes. More... | |
void | rtc_persist_test (void) |
Test that the RTC keeps counting even after rtc_free has been called. More... | |
void | rtc_glitch_test (void) |
Test time does not glitch backwards due to an incorrectly implemented ripple counter driver. More... | |
void | rtc_range_test (void) |
Test that the RTC correctly handles large time values. More... | |
void | rtc_accuracy_test (void) |
Test that the RTC accuracy is at least 10%. More... | |
void | rtc_write_read_test (void) |
Test that rtc_write/rtc_read functions provides availability to set/get RTC time. More... | |
void | rtc_enabled_test (void) |
Test that rtc_isenabled function returns 1 if the RTC is counting and the time has been set, 0 otherwise. More... | |
void | rtc_reset_test () |
Test that the RTC does not stop counting after a software reset. More... | |
void | stack_size_unification_test (void) |
Test sizes of ISR stack, main thread stack, default user thread stack. More... | |
The RTC test validate proper implementation of the RTC hal.
To run the RTC hal tests use the command:
mbed test -t <toolchain> -m <target> -n tests-mbed_hal-rtc*
void rtc_accuracy_test | ( | void | ) |
Test that the RTC accuracy is at least 10%.
Given platform provides Real Time Clock. When delay is performed based on RTC (10 sec delay). Then the delay time measured using high frequency timer indicate that RTC accuracy is at least 10%.
void rtc_enabled_test | ( | void | ) |
Test that rtc_isenabled function returns 1 if the RTC is counting and the time has been set, 0 otherwise.
NOTE: RTC is counting when it has been initialised by means of rtc_init(). RTC time is set by means of rtc_write() function. RTC must be initialised before rtc_isenabled() function can be called.
Given platform provides Real Time Clock. When rtc_isenabled() function is called. Then the result is 1 if RTC time has been set, otherwise the result is 0.
void rtc_glitch_test | ( | void | ) |
Test time does not glitch backwards due to an incorrectly implemented ripple counter driver.
Given board provides RTC. When RTC is enabled and counts. Then time does not glitch backwards due to an incorrectly implemented ripple counter driver.
void rtc_init_test | ( | void | ) |
void rtc_persist_test | ( | void | ) |
void rtc_range_test | ( | void | ) |
Test that the RTC correctly handles large time values.
Given board provides RTC. When RTC is enabled and counts. The RTC correctly handles different time values.
void rtc_reset_test | ( | ) |
Test that the RTC does not stop counting after a software reset.
Given board provides RTC. When software reset is performed. Then the RTC does not stop counting.
void rtc_sleep_test | ( | void | ) |
Test that the RTC keeps counting in the various sleep modes.
Given board provides RTC. When system enters sleep/deep-sleep mode. RTC keeps counting.
void rtc_write_read_test | ( | void | ) |
Test that rtc_write/rtc_read functions provides availability to set/get RTC time.
Given platform provides Real Time Clock. When an example RTC time is set by means of rtc_write function and rtc_read is performed immediately after this operation. Then rtc_read function returns time which has been set.
void stack_size_unification_test | ( | void | ) |
Test sizes of ISR stack, main thread stack, default user thread stack.
Given is Mbed OS configuration. When ISR stack, main thread stack, default user thread stack sizes are defined. Then ISR stack size is equal to 1 KB, main thread stack size is equal to 4 KB, default user thread stack size is equal to 4 KB.
NOTE: It is impossible to verify RTOS-less thread stack size since all tests are build with RTOS.