EL4121 Embedded System / mbed-os

Dependents:   cobaLCDJoyMotor_Thread odometry_omni_3roda_v3 odometry_omni_3roda_v1 odometry_omni_3roda_v2 ... more

Committer:
be_bryan
Date:
Mon Dec 11 17:54:04 2017 +0000
Revision:
0:b74591d5ab33
motor ++

Who changed what in which revision?

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