Skip to content

Commit c4f8dc5

Browse files
committed
Add Sleep test specification to sleep_api.h.
1 parent 4c98293 commit c4f8dc5

File tree

1 file changed

+39
-1
lines changed

1 file changed

+39
-1
lines changed

hal/sleep_api.h

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,42 @@
2727
extern "C" {
2828
#endif
2929

30+
/**
31+
* \defgroup hal_sleep sleep hal requirements
32+
* Low level interface to the sleep mode of a target.
33+
*
34+
* # Defined behaviour
35+
*
36+
* * Sleep mode
37+
* * wake-up time should be less than 10 us - Verified by sleep_usticker_test().
38+
* * the processor can be woken up by any internal peripheral interrupt - Verified by sleep_usticker_test().
39+
* * all peripherals operate as in run mode - not verified.
40+
* * the processor can be woken up by external pin interrupt - not verified.
41+
* * Deep sleep
42+
* * the wake-up time should be less than 10 ms - Verified by deepsleep_lpticker_test().
43+
* * lp ticker should wake up a target from this mode - Verified by deepsleep_lpticker_test().
44+
* * RTC should wake up a target from this mode - not verified.
45+
* * an external interrupt on a pin should wake up a target from this mode - not verified.
46+
* * a watchdog timer should wake up a target from this mode - not verified.
47+
* * High-speed clocks are turned off - Verified by deepsleep_high_speed_clocks_turned_off_test().
48+
* * RTC keeps time - Verified by rtc_sleep_test().
49+
*
50+
* # Undefined behaviour
51+
*
52+
* * peripherals aside from RTC, GPIO and lp ticker result in undefined behaviour in deep sleep.
53+
* @{
54+
*/
55+
56+
/**
57+
* \defgroup hal_sleep_tests sleep hal tests
58+
* The sleep HAL tests ensure driver conformance to defined behaviour.
59+
*
60+
* To run the sleep hal tests use the command:
61+
*
62+
* mbed test -t <toolchain> -m <target> -n tests-mbed_hal-sleep*
63+
*
64+
*/
65+
3066
/** Send the microcontroller to sleep
3167
*
3268
* The processor is setup ready for sleep, and sent to sleep. In this mode, the
@@ -53,6 +89,8 @@ void hal_sleep(void);
5389
*/
5490
void hal_deepsleep(void);
5591

92+
/**@}*/
93+
5694
#ifdef __cplusplus
5795
}
5896
#endif
@@ -61,4 +99,4 @@ void hal_deepsleep(void);
6199

62100
#endif
63101

64-
/** @}*/
102+
/**@}*/

0 commit comments

Comments
 (0)