TI-RTOS Drivers  tidrivers_full_2_20_00_08
UARTTivaDMA.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2015, Texas Instruments Incorporated
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  *
9  * * Redistributions of source code must retain the above copyright
10  * notice, this list of conditions and the following disclaimer.
11  *
12  * * Redistributions in binary form must reproduce the above copyright
13  * notice, this list of conditions and the following disclaimer in the
14  * documentation and/or other materials provided with the distribution.
15  *
16  * * Neither the name of Texas Instruments Incorporated nor the names of
17  * its contributors may be used to endorse or promote products derived
18  * from this software without specific prior written permission.
19  *
20  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
22  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
24  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
26  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
27  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
28  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
29  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
30  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31  */
49 #ifndef ti_drivers_uart_UARTTivaDMA__include
50 #define ti_drivers_uart_UARTTivaDMA__include
51 
52 #ifdef __cplusplus
53 extern "C" {
54 #endif
55 
56 #include <stdint.h>
57 #include <stdbool.h>
58 #include <ti/drivers/UART.h>
59 
60 #include <ti/sysbios/knl/Semaphore.h>
61 #define ti_sysbios_family_arm_m3_Hwi__nolocalnames
62 #include <ti/sysbios/family/arm/m3/Hwi.h>
63 
74 /* Add UARTTivaDMA_STATUS_* macros here */
75 
88 /* Add UARTTivaDMA_CMD_* macros here */
89 
92 /* UART function table pointer */
94 
134 typedef struct UARTTivaDMA_HWAttrs {
136  unsigned int baseAddr;
138  unsigned int intNum;
140  unsigned int intPriority;
142  uint32_t rxChannelIndex;
144  uint32_t txChannelIndex;
146 
152 typedef struct UARTTivaDMA_Object {
153  /* UART control variables */
154  bool opened; /* Has the obj been opened */
155  UART_Mode readMode; /* Mode for all read calls */
156  UART_Mode writeMode; /* Mode for all write calls */
157  unsigned int readTimeout; /* Timeout for read semaphore */
158  unsigned int writeTimeout; /* Timeout for write semaphore */
159  UART_Callback readCallback; /* Pointer to read callback */
160  UART_Callback writeCallback; /* Pointer to write callback */
161  UART_ReturnMode readReturnMode; /* Receive return mode */
162  UART_DataMode readDataMode; /* Type of data being read */
163  UART_DataMode writeDataMode; /* Type of data being written */
164  UART_Echo readEcho; /* Echo received data back */
165 
166  /* UART write variables */
167  const void *writeBuf; /* Buffer data pointer */
168  size_t writeCount; /* Number of Chars sent */
169  size_t writeSize; /* Chars remaining in buffer */
170 
171  /* UART receive variables */
172  void *readBuf; /* Buffer data pointer */
173  size_t readCount; /* Number of Chars read */
174  size_t readSize; /* Chars remaining in buffer */
175 
176  /* UART SYS/BIOS objects */
177  ti_sysbios_family_arm_m3_Hwi_Struct hwi; /* Hwi object */
178  Semaphore_Struct writeSem; /* UART write semaphore*/
179  Semaphore_Struct readSem; /* UART read semaphore */
181 
182 /* Do not interfere with the app if they include the family Hwi module */
183 #undef ti_sysbios_family_arm_m3_Hwi__nolocalnames
184 
185 #ifdef __cplusplus
186 }
187 #endif
188 
189 #endif /* ti_drivers_uart_UARTTivaDMA__include */
uint32_t txChannelIndex
Definition: UARTTivaDMA.h:144
size_t writeCount
Definition: UARTTivaDMA.h:168
Semaphore_Struct writeSem
Definition: UARTTivaDMA.h:178
struct UARTTivaDMA_Object UARTTivaDMA_Object
UARTTivaDMA Object.
UARTTivaDMA Object.
Definition: UARTTivaDMA.h:152
struct UARTTivaDMA_HWAttrs UARTTivaDMA_HWAttrs
UARTTivaDMA Hardware attributes.
UART_Callback readCallback
Definition: UARTTivaDMA.h:159
Semaphore_Struct readSem
Definition: UARTTivaDMA.h:179
The definition of a UART function table that contains the required set of functions to control a spec...
Definition: UART.h:528
unsigned int baseAddr
Definition: UARTTivaDMA.h:136
bool opened
Definition: UARTTivaDMA.h:154
unsigned int intPriority
Definition: UARTTivaDMA.h:140
UART_Mode
UART mode settings.
Definition: UART.h:322
unsigned int readTimeout
Definition: UARTTivaDMA.h:157
UART_DataMode
UART data mode settings.
Definition: UART.h:370
UART_ReturnMode
UART return mode settings.
Definition: UART.h:355
UART_Mode writeMode
Definition: UARTTivaDMA.h:156
size_t writeSize
Definition: UARTTivaDMA.h:169
UART_Echo
UART echo settings.
Definition: UART.h:388
void * readBuf
Definition: UARTTivaDMA.h:172
UART_DataMode writeDataMode
Definition: UARTTivaDMA.h:163
UARTTivaDMA Hardware attributes.
Definition: UARTTivaDMA.h:134
ti_sysbios_family_arm_m3_Hwi_Struct hwi
Definition: UARTTivaDMA.h:177
unsigned int intNum
Definition: UARTTivaDMA.h:138
UART_Echo readEcho
Definition: UARTTivaDMA.h:164
struct UARTTivaDMA_Object * UARTTivaDMA_Handle
UART_Callback writeCallback
Definition: UARTTivaDMA.h:160
const void * writeBuf
Definition: UARTTivaDMA.h:167
UART driver interface.
UART_ReturnMode readReturnMode
Definition: UARTTivaDMA.h:161
UART_DataMode readDataMode
Definition: UARTTivaDMA.h:162
void(* UART_Callback)(UART_Handle, void *buf, size_t count)
The definition of a callback function used by the UART driver when used in UART_MODE_CALLBACK The cal...
Definition: UART.h:315
unsigned int writeTimeout
Definition: UARTTivaDMA.h:158
size_t readCount
Definition: UARTTivaDMA.h:173
uint32_t rxChannelIndex
Definition: UARTTivaDMA.h:142
size_t readSize
Definition: UARTTivaDMA.h:174
const UART_FxnTable UARTTivaDMA_fxnTable
UART_Mode readMode
Definition: UARTTivaDMA.h:155
Copyright 2016, Texas Instruments Incorporated