Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
mbed-os/targets/TARGET_STM/serial_api_hal.h@0:6bf0743ece18, 2020-03-28 (annotated)
- Committer:
- demayer
- Date:
- Sat Mar 28 15:28:19 2020 +0000
- Revision:
- 0:6bf0743ece18
IMU Thread with an event-queue running parallel to handle tasks like a 5 times blinking LED. Button with interrupt detected.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
demayer | 0:6bf0743ece18 | 1 | /* mbed Microcontroller Library |
demayer | 0:6bf0743ece18 | 2 | ******************************************************************************* |
demayer | 0:6bf0743ece18 | 3 | * Copyright (c) 2016, STMicroelectronics |
demayer | 0:6bf0743ece18 | 4 | * All rights reserved. |
demayer | 0:6bf0743ece18 | 5 | * |
demayer | 0:6bf0743ece18 | 6 | * Redistribution and use in source and binary forms, with or without |
demayer | 0:6bf0743ece18 | 7 | * modification, are permitted provided that the following conditions are met: |
demayer | 0:6bf0743ece18 | 8 | * |
demayer | 0:6bf0743ece18 | 9 | * 1. Redistributions of source code must retain the above copyright notice, |
demayer | 0:6bf0743ece18 | 10 | * this list of conditions and the following disclaimer. |
demayer | 0:6bf0743ece18 | 11 | * 2. Redistributions in binary form must reproduce the above copyright notice, |
demayer | 0:6bf0743ece18 | 12 | * this list of conditions and the following disclaimer in the documentation |
demayer | 0:6bf0743ece18 | 13 | * and/or other materials provided with the distribution. |
demayer | 0:6bf0743ece18 | 14 | * 3. Neither the name of STMicroelectronics nor the names of its contributors |
demayer | 0:6bf0743ece18 | 15 | * may be used to endorse or promote products derived from this software |
demayer | 0:6bf0743ece18 | 16 | * without specific prior written permission. |
demayer | 0:6bf0743ece18 | 17 | * |
demayer | 0:6bf0743ece18 | 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
demayer | 0:6bf0743ece18 | 19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
demayer | 0:6bf0743ece18 | 20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
demayer | 0:6bf0743ece18 | 21 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE |
demayer | 0:6bf0743ece18 | 22 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
demayer | 0:6bf0743ece18 | 23 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
demayer | 0:6bf0743ece18 | 24 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
demayer | 0:6bf0743ece18 | 25 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
demayer | 0:6bf0743ece18 | 26 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
demayer | 0:6bf0743ece18 | 27 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
demayer | 0:6bf0743ece18 | 28 | ******************************************************************************* |
demayer | 0:6bf0743ece18 | 29 | */ |
demayer | 0:6bf0743ece18 | 30 | |
demayer | 0:6bf0743ece18 | 31 | #ifndef MBED_SERIAL_API_HAL_H |
demayer | 0:6bf0743ece18 | 32 | #define MBED_SERIAL_API_HAL_H |
demayer | 0:6bf0743ece18 | 33 | |
demayer | 0:6bf0743ece18 | 34 | #include "serial_api.h" |
demayer | 0:6bf0743ece18 | 35 | |
demayer | 0:6bf0743ece18 | 36 | |
demayer | 0:6bf0743ece18 | 37 | #ifdef __cplusplus |
demayer | 0:6bf0743ece18 | 38 | extern "C" { |
demayer | 0:6bf0743ece18 | 39 | #endif |
demayer | 0:6bf0743ece18 | 40 | /* |
demayer | 0:6bf0743ece18 | 41 | * Extend serial_api.h |
demayer | 0:6bf0743ece18 | 42 | */ |
demayer | 0:6bf0743ece18 | 43 | |
demayer | 0:6bf0743ece18 | 44 | #if DEVICE_SERIAL_ASYNCH |
demayer | 0:6bf0743ece18 | 45 | #define SERIAL_S(obj) (&((obj)->serial)) |
demayer | 0:6bf0743ece18 | 46 | #else |
demayer | 0:6bf0743ece18 | 47 | #define SERIAL_S(obj) (obj) |
demayer | 0:6bf0743ece18 | 48 | #endif |
demayer | 0:6bf0743ece18 | 49 | |
demayer | 0:6bf0743ece18 | 50 | extern UART_HandleTypeDef uart_handlers[]; |
demayer | 0:6bf0743ece18 | 51 | |
demayer | 0:6bf0743ece18 | 52 | |
demayer | 0:6bf0743ece18 | 53 | /** Initialize and configure the UART peripheral |
demayer | 0:6bf0743ece18 | 54 | * |
demayer | 0:6bf0743ece18 | 55 | * @param obj The serial object containing the configuration |
demayer | 0:6bf0743ece18 | 56 | */ |
demayer | 0:6bf0743ece18 | 57 | void init_uart(serial_t *obj); |
demayer | 0:6bf0743ece18 | 58 | |
demayer | 0:6bf0743ece18 | 59 | #ifdef __cplusplus |
demayer | 0:6bf0743ece18 | 60 | } |
demayer | 0:6bf0743ece18 | 61 | #endif |
demayer | 0:6bf0743ece18 | 62 | |
demayer | 0:6bf0743ece18 | 63 | #endif |