Knight KE / Mbed OS Game_Master
Embed: (wiki syntax)

« Back to documentation index

RTC hal tests

RTC hal tests
[RTC hal]

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.
void rtc_sleep_test (void)
 Test that the RTC keeps counting in the various sleep modes.
void rtc_persist_test (void)
 Test that the RTC keeps counting even after rtc_free has been called.
void rtc_glitch_test (void)
 Test time does not glitch backwards due to an incorrectly implemented ripple counter driver.
void rtc_range_test (void)
 Test that the RTC correctly handles large time values.
void rtc_accuracy_test (void)
 Test that the RTC accuracy is at least 10%.
void rtc_write_read_test (void)
 Test that rtc_write/rtc_read functions provides availability to set/get RTC time.
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.
void rtc_reset_test ()
 Test that the RTC does not stop counting after a software reset.

Detailed Description

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*


Function Documentation

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%.

Definition at line 176 of file mbed-os/TESTS/mbed_hal/rtc/main.cpp.

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.

Definition at line 221 of file mbed-os/TESTS/mbed_hal/rtc/main.cpp.

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.

Definition at line 138 of file mbed-os/TESTS/mbed_hal/rtc/main.cpp.

void rtc_init_test ( void   )

Test that rtc_init can be called multiple times.

Given board provides RTC. When rtc_init is called multiple times. Then rtc_init are successfully performed (no exception is generated).

Definition at line 96 of file mbed-os/TESTS/mbed_hal/rtc/main.cpp.

void rtc_persist_test ( void   )

Test that the RTC keeps counting even after rtc_free has been called.

Given board provides RTC. When rtc_free has been called. RTC keeps counting.

Definition at line 119 of file mbed-os/TESTS/mbed_hal/rtc/main.cpp.

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.

Definition at line 155 of file mbed-os/TESTS/mbed_hal/rtc/main.cpp.

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.

Definition at line 78 of file mbed-os/TESTS/mbed_hal/rtc_reset/main.cpp.

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.

Definition at line 108 of file mbed-os/TESTS/mbed_hal/rtc/main.cpp.

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.

Definition at line 195 of file mbed-os/TESTS/mbed_hal/rtc/main.cpp.