mbed library sources. Supersedes mbed-src.
Fork of mbed-dev by
targets/hal/TARGET_ONSEMI/TARGET_NCS36510/uart.h@144:ef7eb2e8f9f7, 2016-09-02 (annotated)
- Committer:
- <>
- Date:
- Fri Sep 02 15:07:44 2016 +0100
- Revision:
- 144:ef7eb2e8f9f7
- Child:
- 147:30b64687e01f
This updates the lib to the mbed lib v125
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
<> | 144:ef7eb2e8f9f7 | 1 | /** |
<> | 144:ef7eb2e8f9f7 | 2 | ****************************************************************************** |
<> | 144:ef7eb2e8f9f7 | 3 | * @file uart.h |
<> | 144:ef7eb2e8f9f7 | 4 | * @brief Defines common properties of any UART driver. |
<> | 144:ef7eb2e8f9f7 | 5 | * @internal |
<> | 144:ef7eb2e8f9f7 | 6 | * @author ON Semiconductor |
<> | 144:ef7eb2e8f9f7 | 7 | * $Rev: 2074 $ |
<> | 144:ef7eb2e8f9f7 | 8 | * $Date: 2013-07-10 18:06:15 +0530 (Wed, 10 Jul 2013) $ |
<> | 144:ef7eb2e8f9f7 | 9 | ****************************************************************************** |
<> | 144:ef7eb2e8f9f7 | 10 | * @copyright (c) 2012 ON Semiconductor. All rights reserved. |
<> | 144:ef7eb2e8f9f7 | 11 | * ON Semiconductor is supplying this software for use with ON Semiconductor |
<> | 144:ef7eb2e8f9f7 | 12 | * processor based microcontrollers only. |
<> | 144:ef7eb2e8f9f7 | 13 | * |
<> | 144:ef7eb2e8f9f7 | 14 | * THIS SOFTWARE IS PROVIDED "AS IS". NO WARRANTIES, WHETHER EXPRESS, IMPLIED |
<> | 144:ef7eb2e8f9f7 | 15 | * OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF |
<> | 144:ef7eb2e8f9f7 | 16 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE. |
<> | 144:ef7eb2e8f9f7 | 17 | * ON SEMICONDUCTOR SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, |
<> | 144:ef7eb2e8f9f7 | 18 | * INCIDENTAL, OR CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER. |
<> | 144:ef7eb2e8f9f7 | 19 | * @endinternal |
<> | 144:ef7eb2e8f9f7 | 20 | * |
<> | 144:ef7eb2e8f9f7 | 21 | * @details |
<> | 144:ef7eb2e8f9f7 | 22 | * A UART driver must comply to the generic driver template (see driver.h), and |
<> | 144:ef7eb2e8f9f7 | 23 | * more specifically to the character driver template (see char_driver.h). All |
<> | 144:ef7eb2e8f9f7 | 24 | * UART drivers share some properties; defining these is the purpose of this file. |
<> | 144:ef7eb2e8f9f7 | 25 | * |
<> | 144:ef7eb2e8f9f7 | 26 | * The options passed when opening a UART device should at least include the |
<> | 144:ef7eb2e8f9f7 | 27 | * flow control type and the baud rate. These are included in the uart_options_t |
<> | 144:ef7eb2e8f9f7 | 28 | * data type. The type can be extended by a UART driver implementation. |
<> | 144:ef7eb2e8f9f7 | 29 | * |
<> | 144:ef7eb2e8f9f7 | 30 | * The UART driver implementation must make its driver publicly available with |
<> | 144:ef7eb2e8f9f7 | 31 | * an external global variable. |
<> | 144:ef7eb2e8f9f7 | 32 | * |
<> | 144:ef7eb2e8f9f7 | 33 | * @ingroup uart |
<> | 144:ef7eb2e8f9f7 | 34 | */ |
<> | 144:ef7eb2e8f9f7 | 35 | |
<> | 144:ef7eb2e8f9f7 | 36 | #ifndef UART_H_ |
<> | 144:ef7eb2e8f9f7 | 37 | #define UART_H_ |
<> | 144:ef7eb2e8f9f7 | 38 | |
<> | 144:ef7eb2e8f9f7 | 39 | //#include "char_driver.h" |
<> | 144:ef7eb2e8f9f7 | 40 | |
<> | 144:ef7eb2e8f9f7 | 41 | /** Type listing the supported kinds of flow control. */ |
<> | 144:ef7eb2e8f9f7 | 42 | typedef enum { |
<> | 144:ef7eb2e8f9f7 | 43 | /** No flow control */ |
<> | 144:ef7eb2e8f9f7 | 44 | none, |
<> | 144:ef7eb2e8f9f7 | 45 | /** use hardware CTS (External CPU indicates it is ok for the modem to transmit) |
<> | 144:ef7eb2e8f9f7 | 46 | * and RTS (modem requests to sent to external CPU) flow control. |
<> | 144:ef7eb2e8f9f7 | 47 | */ |
<> | 144:ef7eb2e8f9f7 | 48 | rtscts, |
<> | 144:ef7eb2e8f9f7 | 49 | /** use hardware CTS/RTS flow control, but CTS is no response to RTS, |
<> | 144:ef7eb2e8f9f7 | 50 | * RTS and CTS are used to indicate intent to transmit. |
<> | 144:ef7eb2e8f9f7 | 51 | */ |
<> | 144:ef7eb2e8f9f7 | 52 | rtscts_e |
<> | 144:ef7eb2e8f9f7 | 53 | } flow_control_t; |
<> | 144:ef7eb2e8f9f7 | 54 | |
<> | 144:ef7eb2e8f9f7 | 55 | /** A set of options to be passed when creating a uart device instance. */ |
<> | 144:ef7eb2e8f9f7 | 56 | typedef struct uart_options { |
<> | 144:ef7eb2e8f9f7 | 57 | uint32_t baudrate; /**< The expected baud rate. */ |
<> | 144:ef7eb2e8f9f7 | 58 | flow_control_t control;/**< Defines type of flow control, none or rtscts */ |
<> | 144:ef7eb2e8f9f7 | 59 | } uart_options_t, *uart_options_pt; |
<> | 144:ef7eb2e8f9f7 | 60 | |
<> | 144:ef7eb2e8f9f7 | 61 | #endif /* UART_H_ */ |