2 * Copyright (c) 2013-2016 ARM Limited. All rights reserved.
\r
4 * SPDX-License-Identifier: Apache-2.0
\r
6 * Licensed under the Apache License, Version 2.0 (the License); you may
\r
7 * not use this file except in compliance with the License.
\r
8 * You may obtain a copy of the License at
\r
10 * http://www.apache.org/licenses/LICENSE-2.0
\r
12 * Unless required by applicable law or agreed to in writing, software
\r
13 * distributed under the License is distributed on an AS IS BASIS, WITHOUT
\r
14 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
\r
15 * See the License for the specific language governing permissions and
\r
16 * limitations under the License.
\r
19 #include "Driver_USART.h"
\r
21 #define ARM_USART_DRV_VERSION ARM_DRIVER_VERSION_MAJOR_MINOR(2, 0) /* driver version */
\r
23 /* Driver Version */
\r
24 static const ARM_DRIVER_VERSION DriverVersion = {
\r
25 ARM_USART_API_VERSION,
\r
26 ARM_USART_DRV_VERSION
\r
29 /* Driver Capabilities */
\r
30 static const ARM_USART_CAPABILITIES DriverCapabilities = {
\r
31 1, /* supports UART (Asynchronous) mode */
\r
32 0, /* supports Synchronous Master mode */
\r
33 0, /* supports Synchronous Slave mode */
\r
34 0, /* supports UART Single-wire mode */
\r
35 0, /* supports UART IrDA mode */
\r
36 0, /* supports UART Smart Card mode */
\r
37 0, /* Smart Card Clock generator available */
\r
38 0, /* RTS Flow Control available */
\r
39 0, /* CTS Flow Control available */
\r
40 0, /* Transmit completed event: \ref ARM_USART_EVENT_TX_COMPLETE */
\r
41 0, /* Signal receive character timeout event: \ref ARM_USART_EVENT_RX_TIMEOUT */
\r
42 0, /* RTS Line: 0=not available, 1=available */
\r
43 0, /* CTS Line: 0=not available, 1=available */
\r
44 0, /* DTR Line: 0=not available, 1=available */
\r
45 0, /* DSR Line: 0=not available, 1=available */
\r
46 0, /* DCD Line: 0=not available, 1=available */
\r
47 0, /* RI Line: 0=not available, 1=available */
\r
48 0, /* Signal CTS change event: \ref ARM_USART_EVENT_CTS */
\r
49 0, /* Signal DSR change event: \ref ARM_USART_EVENT_DSR */
\r
50 0, /* Signal DCD change event: \ref ARM_USART_EVENT_DCD */
\r
51 0 /* Signal RI change event: \ref ARM_USART_EVENT_RI */
\r
58 ARM_DRIVER_VERSION ARM_USART_GetVersion(void)
\r
62 ARM_USART_CAPABILITIES ARM_USART_GetCapabilities(void)
\r
66 int32_t ARM_USART_Initialize(ARM_USART_SignalEvent_t cb_event)
\r
70 int32_t ARM_USART_Uninitialize(void)
\r
74 int32_t ARM_USART_PowerControl(ARM_POWER_STATE state)
\r
84 case ARM_POWER_FULL:
\r
88 return ARM_DRIVER_ERROR_UNSUPPORTED;
\r
92 int32_t ARM_USART_Send(const void *data, uint32_t num)
\r
96 int32_t ARM_USART_Receive(void *data, uint32_t num)
\r
100 int32_t ARM_USART_Transfer(const void *data_out, void *data_in, uint32_t num)
\r
104 uint32_t ARM_USART_GetTxCount(void)
\r
108 uint32_t ARM_USART_GetRxCount(void)
\r
112 int32_t ARM_USART_Control(uint32_t control, uint32_t arg)
\r
116 ARM_USART_STATUS ARM_USART_GetStatus(void)
\r
120 int32_t ARM_USART_SetModemControl(ARM_USART_MODEM_CONTROL control)
\r
124 ARM_USART_MODEM_STATUS ARM_USART_GetModemStatus(void)
\r
128 void ARM_USART_SignalEvent(uint32_t event)
\r
133 // End USART Interface
\r
135 ARM_DRIVER_USART Driver_USART = {
\r
136 ARM_USART_GetVersion,
\r
137 ARM_USART_GetCapabilities,
\r
138 ARM_USART_Initialize,
\r
139 ARM_USART_Uninitialize,
\r
140 ARM_USART_PowerControl,
\r
143 ARM_USART_Transfer,
\r
144 ARM_USART_GetTxCount,
\r
145 ARM_USART_GetRxCount,
\r
147 ARM_USART_GetStatus,
\r
148 ARM_USART_SetModemControl,
\r
149 ARM_USART_GetModemStatus
\r