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.
Dependents: mbed-TFT-example-NCS36510 mbed-Accelerometer-example-NCS36510 mbed-Accelerometer-example-NCS36510
targets/TARGET_ONSEMI/TARGET_NCS36510/uart.h@0:098463de4c5d, 2017-01-25 (annotated)
- Committer:
- group-onsemi
- Date:
- Wed Jan 25 20:34:15 2017 +0000
- Revision:
- 0:098463de4c5d
Initial commit
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
group-onsemi | 0:098463de4c5d | 1 | /** |
group-onsemi | 0:098463de4c5d | 2 | ****************************************************************************** |
group-onsemi | 0:098463de4c5d | 3 | * @file uart.h |
group-onsemi | 0:098463de4c5d | 4 | * @brief Defines common properties of any UART driver. |
group-onsemi | 0:098463de4c5d | 5 | * @internal |
group-onsemi | 0:098463de4c5d | 6 | * @author ON Semiconductor |
group-onsemi | 0:098463de4c5d | 7 | * $Rev: 2074 $ |
group-onsemi | 0:098463de4c5d | 8 | * $Date: 2013-07-10 18:06:15 +0530 (Wed, 10 Jul 2013) $ |
group-onsemi | 0:098463de4c5d | 9 | ****************************************************************************** |
group-onsemi | 0:098463de4c5d | 10 | * Copyright 2016 Semiconductor Components Industries LLC (d/b/a ON Semiconductor). |
group-onsemi | 0:098463de4c5d | 11 | * All rights reserved. This software and/or documentation is licensed by ON Semiconductor |
group-onsemi | 0:098463de4c5d | 12 | * under limited terms and conditions. The terms and conditions pertaining to the software |
group-onsemi | 0:098463de4c5d | 13 | * and/or documentation are available at http://www.onsemi.com/site/pdf/ONSEMI_T&C.pdf |
group-onsemi | 0:098463de4c5d | 14 | * (ON Semiconductor Standard Terms and Conditions of Sale, Section 8 Software) and |
group-onsemi | 0:098463de4c5d | 15 | * if applicable the software license agreement. Do not use this software and/or |
group-onsemi | 0:098463de4c5d | 16 | * documentation unless you have carefully read and you agree to the limited terms and |
group-onsemi | 0:098463de4c5d | 17 | * conditions. By using this software and/or documentation, you agree to the limited |
group-onsemi | 0:098463de4c5d | 18 | * terms and conditions. |
group-onsemi | 0:098463de4c5d | 19 | * |
group-onsemi | 0:098463de4c5d | 20 | * THIS SOFTWARE IS PROVIDED "AS IS". NO WARRANTIES, WHETHER EXPRESS, IMPLIED |
group-onsemi | 0:098463de4c5d | 21 | * OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF |
group-onsemi | 0:098463de4c5d | 22 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE. |
group-onsemi | 0:098463de4c5d | 23 | * ON SEMICONDUCTOR SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, |
group-onsemi | 0:098463de4c5d | 24 | * INCIDENTAL, OR CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER. |
group-onsemi | 0:098463de4c5d | 25 | * @endinternal |
group-onsemi | 0:098463de4c5d | 26 | * |
group-onsemi | 0:098463de4c5d | 27 | * @details |
group-onsemi | 0:098463de4c5d | 28 | * A UART driver must comply to the generic driver template (see driver.h), and |
group-onsemi | 0:098463de4c5d | 29 | * more specifically to the character driver template (see char_driver.h). All |
group-onsemi | 0:098463de4c5d | 30 | * UART drivers share some properties; defining these is the purpose of this file. |
group-onsemi | 0:098463de4c5d | 31 | * |
group-onsemi | 0:098463de4c5d | 32 | * The options passed when opening a UART device should at least include the |
group-onsemi | 0:098463de4c5d | 33 | * flow control type and the baud rate. These are included in the uart_options_t |
group-onsemi | 0:098463de4c5d | 34 | * data type. The type can be extended by a UART driver implementation. |
group-onsemi | 0:098463de4c5d | 35 | * |
group-onsemi | 0:098463de4c5d | 36 | * The UART driver implementation must make its driver publicly available with |
group-onsemi | 0:098463de4c5d | 37 | * an external global variable. |
group-onsemi | 0:098463de4c5d | 38 | * |
group-onsemi | 0:098463de4c5d | 39 | * @ingroup uart |
group-onsemi | 0:098463de4c5d | 40 | */ |
group-onsemi | 0:098463de4c5d | 41 | |
group-onsemi | 0:098463de4c5d | 42 | #ifndef UART_H_ |
group-onsemi | 0:098463de4c5d | 43 | #define UART_H_ |
group-onsemi | 0:098463de4c5d | 44 | |
group-onsemi | 0:098463de4c5d | 45 | //#include "char_driver.h" |
group-onsemi | 0:098463de4c5d | 46 | |
group-onsemi | 0:098463de4c5d | 47 | /** Type listing the supported kinds of flow control. */ |
group-onsemi | 0:098463de4c5d | 48 | typedef enum { |
group-onsemi | 0:098463de4c5d | 49 | /** No flow control */ |
group-onsemi | 0:098463de4c5d | 50 | none, |
group-onsemi | 0:098463de4c5d | 51 | /** use hardware CTS (External CPU indicates it is ok for the modem to transmit) |
group-onsemi | 0:098463de4c5d | 52 | * and RTS (modem requests to sent to external CPU) flow control. |
group-onsemi | 0:098463de4c5d | 53 | */ |
group-onsemi | 0:098463de4c5d | 54 | rtscts, |
group-onsemi | 0:098463de4c5d | 55 | /** use hardware CTS/RTS flow control, but CTS is no response to RTS, |
group-onsemi | 0:098463de4c5d | 56 | * RTS and CTS are used to indicate intent to transmit. |
group-onsemi | 0:098463de4c5d | 57 | */ |
group-onsemi | 0:098463de4c5d | 58 | rtscts_e |
group-onsemi | 0:098463de4c5d | 59 | } flow_control_t; |
group-onsemi | 0:098463de4c5d | 60 | |
group-onsemi | 0:098463de4c5d | 61 | /** A set of options to be passed when creating a uart device instance. */ |
group-onsemi | 0:098463de4c5d | 62 | typedef struct uart_options { |
group-onsemi | 0:098463de4c5d | 63 | uint32_t baudrate; /**< The expected baud rate. */ |
group-onsemi | 0:098463de4c5d | 64 | flow_control_t control;/**< Defines type of flow control, none or rtscts */ |
group-onsemi | 0:098463de4c5d | 65 | } uart_options_t, *uart_options_pt; |
group-onsemi | 0:098463de4c5d | 66 | |
group-onsemi | 0:098463de4c5d | 67 | #endif /* UART_H_ */ |