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