TI-RTOS for SimpleLink Wireless MCUs  2.14.03.28
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  */
47 #ifndef ti_drivers_uart_UARTTivaDMA__include
48 #define ti_drivers_uart_UARTTivaDMA__include
49 
50 #ifdef __cplusplus
51 extern "C" {
52 #endif
53 
54 #include <stdint.h>
55 #include <stdbool.h>
56 #include <ti/drivers/UART.h>
57 
58 #include <ti/sysbios/knl/Semaphore.h>
59 #define ti_sysbios_family_arm_m3_Hwi__nolocalnames
60 #include <ti/sysbios/family/arm/m3/Hwi.h>
61 
62 /* UART function table pointer */
64 
104 typedef struct UARTTivaDMA_HWAttrs {
106  unsigned int baseAddr;
108  unsigned int intNum;
110  unsigned int intPriority;
112  uint32_t rxChannelIndex;
114  uint32_t txChannelIndex;
116 
122 typedef struct UARTTivaDMA_Object {
123  /* UART control variables */
124  bool opened; /* Has the obj been opened */
125  UART_Mode readMode; /* Mode for all read calls */
126  UART_Mode writeMode; /* Mode for all write calls */
127  unsigned int readTimeout; /* Timeout for read semaphore */
128  unsigned int writeTimeout; /* Timeout for write semaphore */
129  UART_Callback readCallback; /* Pointer to read callback */
130  UART_Callback writeCallback; /* Pointer to write callback */
131  UART_ReturnMode readReturnMode; /* Receive return mode */
132  UART_DataMode readDataMode; /* Type of data being read */
133  UART_DataMode writeDataMode; /* Type of data being written */
134  UART_Echo readEcho; /* Echo received data back */
135 
136  /* UART write variables */
137  const void *writeBuf; /* Buffer data pointer */
138  size_t writeCount; /* Number of Chars sent */
139  size_t writeSize; /* Chars remaining in buffer */
140 
141  /* UART receive variables */
142  void *readBuf; /* Buffer data pointer */
143  size_t readCount; /* Number of Chars read */
144  size_t readSize; /* Chars remaining in buffer */
145 
146  /* UART SYS/BIOS objects */
147  ti_sysbios_family_arm_m3_Hwi_Struct hwi; /* Hwi object */
148  Semaphore_Struct writeSem; /* UART write semaphore*/
149  Semaphore_Struct readSem; /* UART read semaphore */
151 
152 /* Do not interfere with the app if they include the family Hwi module */
153 #undef ti_sysbios_family_arm_m3_Hwi__nolocalnames
154 
155 #ifdef __cplusplus
156 }
157 #endif
158 
159 #endif /* ti_drivers_uart_UARTTivaDMA__include */
uint32_t txChannelIndex
Definition: UARTTivaDMA.h:114
size_t writeCount
Definition: UARTTivaDMA.h:138
Semaphore_Struct writeSem
Definition: UARTTivaDMA.h:148
struct UARTTivaDMA_Object UARTTivaDMA_Object
UARTTivaDMA Object.
UARTTivaDMA Object.
Definition: UARTTivaDMA.h:122
struct UARTTivaDMA_HWAttrs UARTTivaDMA_HWAttrs
UARTTivaDMA Hardware attributes.
UART_Callback readCallback
Definition: UARTTivaDMA.h:129
Semaphore_Struct readSem
Definition: UARTTivaDMA.h:149
The definition of a UART function table that contains the required set of functions to control a spec...
Definition: UART.h:497
unsigned int baseAddr
Definition: UARTTivaDMA.h:106
bool opened
Definition: UARTTivaDMA.h:124
unsigned int intPriority
Definition: UARTTivaDMA.h:110
UART_Mode
UART mode settings.
Definition: UART.h:291
unsigned int readTimeout
Definition: UARTTivaDMA.h:127
UART_DataMode
UART data mode settings.
Definition: UART.h:339
UART_ReturnMode
UART return mode settings.
Definition: UART.h:324
UART_Mode writeMode
Definition: UARTTivaDMA.h:126
size_t writeSize
Definition: UARTTivaDMA.h:139
UART_Echo
UART echo settings.
Definition: UART.h:357
void * readBuf
Definition: UARTTivaDMA.h:142
UART_DataMode writeDataMode
Definition: UARTTivaDMA.h:133
UARTTivaDMA Hardware attributes.
Definition: UARTTivaDMA.h:104
ti_sysbios_family_arm_m3_Hwi_Struct hwi
Definition: UARTTivaDMA.h:147
unsigned int intNum
Definition: UARTTivaDMA.h:108
UART_Echo readEcho
Definition: UARTTivaDMA.h:134
struct UARTTivaDMA_Object * UARTTivaDMA_Handle
UART_Callback writeCallback
Definition: UARTTivaDMA.h:130
const void * writeBuf
Definition: UARTTivaDMA.h:137
UART driver interface.
UART_ReturnMode readReturnMode
Definition: UARTTivaDMA.h:131
UART_DataMode readDataMode
Definition: UARTTivaDMA.h:132
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:284
unsigned int writeTimeout
Definition: UARTTivaDMA.h:128
size_t readCount
Definition: UARTTivaDMA.h:143
uint32_t rxChannelIndex
Definition: UARTTivaDMA.h:112
size_t readSize
Definition: UARTTivaDMA.h:144
const UART_FxnTable UARTTivaDMA_fxnTable
UART_Mode readMode
Definition: UARTTivaDMA.h:125
Copyright 2015, Texas Instruments Incorporated