Initial commit

Dependencies:   FastPWM

Committer:
lypinator
Date:
Wed Sep 16 01:11:49 2020 +0000
Revision:
0:bb348c97df44
Added PWM

Who changed what in which revision?

UserRevisionLine numberNew contents of line
lypinator 0:bb348c97df44 1
lypinator 0:bb348c97df44 2 /** \addtogroup hal */
lypinator 0:bb348c97df44 3 /** @{*/
lypinator 0:bb348c97df44 4 /* mbed Microcontroller Library
lypinator 0:bb348c97df44 5 * Copyright (c) 2006-2013 ARM Limited
lypinator 0:bb348c97df44 6 *
lypinator 0:bb348c97df44 7 * Licensed under the Apache License, Version 2.0 (the "License");
lypinator 0:bb348c97df44 8 * you may not use this file except in compliance with the License.
lypinator 0:bb348c97df44 9 * You may obtain a copy of the License at
lypinator 0:bb348c97df44 10 *
lypinator 0:bb348c97df44 11 * http://www.apache.org/licenses/LICENSE-2.0
lypinator 0:bb348c97df44 12 *
lypinator 0:bb348c97df44 13 * Unless required by applicable law or agreed to in writing, software
lypinator 0:bb348c97df44 14 * distributed under the License is distributed on an "AS IS" BASIS,
lypinator 0:bb348c97df44 15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
lypinator 0:bb348c97df44 16 * See the License for the specific language governing permissions and
lypinator 0:bb348c97df44 17 * limitations under the License.
lypinator 0:bb348c97df44 18 */
lypinator 0:bb348c97df44 19 #ifndef MBED_SLEEP_API_H
lypinator 0:bb348c97df44 20 #define MBED_SLEEP_API_H
lypinator 0:bb348c97df44 21
lypinator 0:bb348c97df44 22 #include "device.h"
lypinator 0:bb348c97df44 23
lypinator 0:bb348c97df44 24 #if DEVICE_SLEEP
lypinator 0:bb348c97df44 25
lypinator 0:bb348c97df44 26 #ifdef __cplusplus
lypinator 0:bb348c97df44 27 extern "C" {
lypinator 0:bb348c97df44 28 #endif
lypinator 0:bb348c97df44 29
lypinator 0:bb348c97df44 30 /**
lypinator 0:bb348c97df44 31 * \defgroup hal_sleep sleep hal requirements
lypinator 0:bb348c97df44 32 * Low level interface to the sleep mode of a target.
lypinator 0:bb348c97df44 33 *
lypinator 0:bb348c97df44 34 * # Defined behaviour
lypinator 0:bb348c97df44 35 *
lypinator 0:bb348c97df44 36 * * Sleep mode
lypinator 0:bb348c97df44 37 * * wake-up time should be less than 10 us - Verified by sleep_usticker_test().
lypinator 0:bb348c97df44 38 * * the processor can be woken up by any internal peripheral interrupt - Verified by sleep_usticker_test().
lypinator 0:bb348c97df44 39 * * all peripherals operate as in run mode - not verified.
lypinator 0:bb348c97df44 40 * * the processor can be woken up by external pin interrupt - not verified.
lypinator 0:bb348c97df44 41 * * Deep sleep
lypinator 0:bb348c97df44 42 * * the wake-up time should be less than 10 ms - Verified by deepsleep_lpticker_test().
lypinator 0:bb348c97df44 43 * * lp ticker should wake up a target from this mode - Verified by deepsleep_lpticker_test().
lypinator 0:bb348c97df44 44 * * RTC should wake up a target from this mode - not verified.
lypinator 0:bb348c97df44 45 * * an external interrupt on a pin should wake up a target from this mode - not verified.
lypinator 0:bb348c97df44 46 * * a watchdog timer should wake up a target from this mode - not verified.
lypinator 0:bb348c97df44 47 * * High-speed clocks are turned off - Verified by deepsleep_high_speed_clocks_turned_off_test().
lypinator 0:bb348c97df44 48 * * RTC keeps time - Verified by rtc_sleep_test().
lypinator 0:bb348c97df44 49 *
lypinator 0:bb348c97df44 50 * # Undefined behaviour
lypinator 0:bb348c97df44 51 *
lypinator 0:bb348c97df44 52 * * peripherals aside from RTC, GPIO and lp ticker result in undefined behaviour in deep sleep.
lypinator 0:bb348c97df44 53 * @{
lypinator 0:bb348c97df44 54 */
lypinator 0:bb348c97df44 55
lypinator 0:bb348c97df44 56 /**
lypinator 0:bb348c97df44 57 * \defgroup hal_sleep_tests sleep hal tests
lypinator 0:bb348c97df44 58 * The sleep HAL tests ensure driver conformance to defined behaviour.
lypinator 0:bb348c97df44 59 *
lypinator 0:bb348c97df44 60 * To run the sleep hal tests use the command:
lypinator 0:bb348c97df44 61 *
lypinator 0:bb348c97df44 62 * mbed test -t <toolchain> -m <target> -n tests-mbed_hal-sleep*
lypinator 0:bb348c97df44 63 *
lypinator 0:bb348c97df44 64 */
lypinator 0:bb348c97df44 65
lypinator 0:bb348c97df44 66 /** Send the microcontroller to sleep
lypinator 0:bb348c97df44 67 *
lypinator 0:bb348c97df44 68 * The processor is setup ready for sleep, and sent to sleep. In this mode, the
lypinator 0:bb348c97df44 69 * system clock to the core is stopped until a reset or an interrupt occurs. This eliminates
lypinator 0:bb348c97df44 70 * dynamic power used by the processor, memory systems and buses. The processor, peripheral and
lypinator 0:bb348c97df44 71 * memory state are maintained, and the peripherals continue to work and can generate interrupts.
lypinator 0:bb348c97df44 72 *
lypinator 0:bb348c97df44 73 * The processor can be woken up by any internal peripheral interrupt or external pin interrupt.
lypinator 0:bb348c97df44 74 *
lypinator 0:bb348c97df44 75 * The wake-up time shall be less than 10 us.
lypinator 0:bb348c97df44 76 *
lypinator 0:bb348c97df44 77 */
lypinator 0:bb348c97df44 78 void hal_sleep(void);
lypinator 0:bb348c97df44 79
lypinator 0:bb348c97df44 80 /** Send the microcontroller to deep sleep
lypinator 0:bb348c97df44 81 *
lypinator 0:bb348c97df44 82 * This processor is setup ready for deep sleep, and sent to sleep using __WFI(). This mode
lypinator 0:bb348c97df44 83 * has the same sleep features as sleep plus it powers down peripherals and high frequency clocks.
lypinator 0:bb348c97df44 84 * All state is still maintained.
lypinator 0:bb348c97df44 85 *
lypinator 0:bb348c97df44 86 * The processor can only be woken up by low power ticker, RTC, an external interrupt on a pin or a watchdog timer.
lypinator 0:bb348c97df44 87 *
lypinator 0:bb348c97df44 88 * The wake-up time shall be less than 10 ms.
lypinator 0:bb348c97df44 89 */
lypinator 0:bb348c97df44 90 void hal_deepsleep(void);
lypinator 0:bb348c97df44 91
lypinator 0:bb348c97df44 92 /**@}*/
lypinator 0:bb348c97df44 93
lypinator 0:bb348c97df44 94 #ifdef __cplusplus
lypinator 0:bb348c97df44 95 }
lypinator 0:bb348c97df44 96 #endif
lypinator 0:bb348c97df44 97
lypinator 0:bb348c97df44 98 #endif
lypinator 0:bb348c97df44 99
lypinator 0:bb348c97df44 100 #endif
lypinator 0:bb348c97df44 101
lypinator 0:bb348c97df44 102 /**@}*/