The official Mbed 2 C/C++ SDK provides the software platform and libraries to build your applications.

Dependents:   hello SerialTestv11 SerialTestv12 Sierpinski ... more

mbed 2

This is the mbed 2 library. If you'd like to learn about Mbed OS please see the mbed-os docs.

Committer:
Kojto
Date:
Wed Jul 19 16:46:19 2017 +0100
Revision:
147:a97add6d7e64
Parent:
143:86740a56073b
Child:
160:5571c4ff569f
Release 147 of the mbed library.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
AnnaBridge 143:86740a56073b 1 /* mbed Microcontroller Library
AnnaBridge 143:86740a56073b 2 *******************************************************************************
AnnaBridge 143:86740a56073b 3 * Copyright (c) 2016, STMicroelectronics
AnnaBridge 143:86740a56073b 4 * All rights reserved.
AnnaBridge 143:86740a56073b 5 *
AnnaBridge 143:86740a56073b 6 * Redistribution and use in source and binary forms, with or without
AnnaBridge 143:86740a56073b 7 * modification, are permitted provided that the following conditions are met:
AnnaBridge 143:86740a56073b 8 *
AnnaBridge 143:86740a56073b 9 * 1. Redistributions of source code must retain the above copyright notice,
AnnaBridge 143:86740a56073b 10 * this list of conditions and the following disclaimer.
AnnaBridge 143:86740a56073b 11 * 2. Redistributions in binary form must reproduce the above copyright notice,
AnnaBridge 143:86740a56073b 12 * this list of conditions and the following disclaimer in the documentation
AnnaBridge 143:86740a56073b 13 * and/or other materials provided with the distribution.
AnnaBridge 143:86740a56073b 14 * 3. Neither the name of STMicroelectronics nor the names of its contributors
AnnaBridge 143:86740a56073b 15 * may be used to endorse or promote products derived from this software
AnnaBridge 143:86740a56073b 16 * without specific prior written permission.
AnnaBridge 143:86740a56073b 17 *
AnnaBridge 143:86740a56073b 18 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AnnaBridge 143:86740a56073b 19 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
AnnaBridge 143:86740a56073b 20 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
AnnaBridge 143:86740a56073b 21 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
AnnaBridge 143:86740a56073b 22 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
AnnaBridge 143:86740a56073b 23 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
AnnaBridge 143:86740a56073b 24 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
AnnaBridge 143:86740a56073b 25 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
AnnaBridge 143:86740a56073b 26 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
AnnaBridge 143:86740a56073b 27 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
AnnaBridge 143:86740a56073b 28 *******************************************************************************
AnnaBridge 143:86740a56073b 29 */
AnnaBridge 143:86740a56073b 30
AnnaBridge 143:86740a56073b 31 #ifndef MBED_RTC_API_HAL_H
AnnaBridge 143:86740a56073b 32 #define MBED_RTC_API_HAL_H
AnnaBridge 143:86740a56073b 33
AnnaBridge 143:86740a56073b 34 #include <stdint.h>
AnnaBridge 143:86740a56073b 35 #include "rtc_api.h"
AnnaBridge 143:86740a56073b 36
AnnaBridge 143:86740a56073b 37 #ifdef __cplusplus
AnnaBridge 143:86740a56073b 38 extern "C" {
AnnaBridge 143:86740a56073b 39 #endif
AnnaBridge 143:86740a56073b 40 /*
AnnaBridge 143:86740a56073b 41 * Extend rtc_api.h
AnnaBridge 143:86740a56073b 42 */
AnnaBridge 143:86740a56073b 43
AnnaBridge 143:86740a56073b 44 /** Set the given function as handler of wakeup timer event.
AnnaBridge 143:86740a56073b 45 *
AnnaBridge 143:86740a56073b 46 * @param handler The function to set as handler
AnnaBridge 143:86740a56073b 47 */
AnnaBridge 143:86740a56073b 48 void rtc_set_irq_handler(uint32_t handler);
AnnaBridge 143:86740a56073b 49
AnnaBridge 143:86740a56073b 50 /** Read the subsecond register.
AnnaBridge 143:86740a56073b 51 *
AnnaBridge 143:86740a56073b 52 * @return The remaining time as microseconds (0-999999)
AnnaBridge 143:86740a56073b 53 */
AnnaBridge 143:86740a56073b 54 uint32_t rtc_read_subseconds(void);
AnnaBridge 143:86740a56073b 55
AnnaBridge 143:86740a56073b 56 /** Program a wake up timer event in delta microseconds.
AnnaBridge 143:86740a56073b 57 *
AnnaBridge 143:86740a56073b 58 * @param delta The time to wait
AnnaBridge 143:86740a56073b 59 */
AnnaBridge 143:86740a56073b 60 void rtc_set_wake_up_timer(uint32_t delta);
AnnaBridge 143:86740a56073b 61
AnnaBridge 143:86740a56073b 62 /** Disable the wake up timer event.
AnnaBridge 143:86740a56073b 63 *
AnnaBridge 143:86740a56073b 64 * The wake up timer use auto reload, you have to deactivate it manually.
AnnaBridge 143:86740a56073b 65 */
AnnaBridge 143:86740a56073b 66 void rtc_deactivate_wake_up_timer(void);
AnnaBridge 143:86740a56073b 67
AnnaBridge 143:86740a56073b 68 /** Synchronise the RTC shadow registers.
AnnaBridge 143:86740a56073b 69 *
AnnaBridge 143:86740a56073b 70 * Must be called after a deepsleep.
AnnaBridge 143:86740a56073b 71 */
AnnaBridge 143:86740a56073b 72 void rtc_synchronize(void);
AnnaBridge 143:86740a56073b 73
AnnaBridge 143:86740a56073b 74
AnnaBridge 143:86740a56073b 75 #ifdef __cplusplus
AnnaBridge 143:86740a56073b 76 }
AnnaBridge 143:86740a56073b 77 #endif
AnnaBridge 143:86740a56073b 78
AnnaBridge 143:86740a56073b 79 #endif