TI-RTOS Drivers  tidrivers_full_2_20_00_08
UARTCC3200DMA.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2014-2016, 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_UARTCC3200DMA__include
50 #define ti_drivers_uart_UARTCC3200DMA__include
51 
52 #ifdef __cplusplus
53 extern "C" {
54 #endif
55 
56 #include <stdint.h>
57 #include <stdbool.h>
58 
60 #include <ti/drivers/ports/HwiP.h>
61 
63 #include <ti/drivers/Power.h>
64 #include <ti/drivers/UART.h>
66 
77 /* Add UARTCC3200DMA_STATUS_* macros here */
78 
91 /* Add UARTCC3200DMA_CMD_* macros here */
92 
95 /* UART function table pointer */
97 
137 typedef struct UARTCC3200DMA_HWAttrs {
139  unsigned int baseAddr;
141  unsigned int intNum;
143  unsigned int intPriority;
145  unsigned long rxChannelIndex;
147  unsigned long txChannelIndex;
149 
155 typedef struct UARTCC3200DMA_Object {
156  /* UART control variables */
157  bool opened; /* Has the obj been opened */
158  UART_Mode readMode; /* Mode for all read calls */
159  UART_Mode writeMode; /* Mode for all write calls */
160  unsigned int readTimeout; /* Timeout for read semaphore */
161  unsigned int writeTimeout; /* Timeout for write semaphore */
162  UART_Callback readCallback; /* Pointer to read callback */
163  UART_Callback writeCallback; /* Pointer to write callback */
164  UART_ReturnMode readReturnMode; /* Receive return mode */
165  UART_DataMode readDataMode; /* Type of data being read */
166  UART_DataMode writeDataMode; /* Type of data being written */
167  uint32_t baudRate; /* Baud rate for UART */
168  UART_LEN dataLength; /* Data length for UART */
169  UART_STOP stopBits; /* Stop bits for UART */
170  UART_PAR parityType; /* Parity bit type for UART */
171  UART_Echo readEcho; /* Echo received data back */
172 
173  /* UART write variables */
174  const void *writeBuf; /* Buffer data pointer */
175  size_t writeCount; /* Number of Chars sent */
176  size_t writeSize; /* Chars remaining in buffer */
177 
178  /* UART receive variables */
179  void *readBuf; /* Buffer data pointer */
180  size_t readCount; /* Number of Chars read */
181  size_t readSize; /* Chars remaining in buffer */
182 
183  /* Semaphores for blocking mode */
184  SemaphoreP_Handle writeSem; /* UART write semaphore */
185  SemaphoreP_Handle readSem; /* UART read semaphore */
186 
188 
189  /* For Power management */
190  ClockP_Handle txFifoEmptyClk; /* UART TX FIFO empty clock */
191  Power_NotifyObj postNotify; /* LPDS wake-up notify object */
192  unsigned int powerMgrId; /* Determined from base address */
193 
194  /* UDMA */
197 
198 #ifdef __cplusplus
199 }
200 #endif
201 
202 #endif /* ti_drivers_uart_UARTCC3200DMA__include */
UART_STOP
UART stop bit settings.
Definition: UART.h:410
unsigned int readTimeout
Definition: UARTCC3200DMA.h:160
uDMA driver implementation for CC3200.
UART_Echo readEcho
Definition: UARTCC3200DMA.h:171
Clock interface for the RTOS Porting Interface.
The definition of a UART function table that contains the required set of functions to control a spec...
Definition: UART.h:528
Power manager interface.
UART_PAR
UART parity type settings.
Definition: UART.h:420
UART_DataMode writeDataMode
Definition: UARTCC3200DMA.h:166
struct UARTCC3200DMA_Object UARTCC3200DMA_Object
UARTCC3200DMA Object.
UART_Mode
UART mode settings.
Definition: UART.h:322
UDMACC3200_Handle dmaHandle
Definition: UARTCC3200DMA.h:195
UART_DataMode
UART data mode settings.
Definition: UART.h:370
struct UARTCC3200DMA_HWAttrs UARTCC3200DMA_HWAttrs
UARTCC3200DMA Hardware attributes.
UART_ReturnMode
UART return mode settings.
Definition: UART.h:355
Power_NotifyObj postNotify
Definition: UARTCC3200DMA.h:191
size_t readCount
Definition: UARTCC3200DMA.h:180
UART_Echo
UART echo settings.
Definition: UART.h:388
uint32_t baudRate
Definition: UARTCC3200DMA.h:167
void * SemaphoreP_Handle
Opaque client reference to an instance of a SemaphoreP.
Definition: SemaphoreP.h:96
Semaphore module for the RTOS Porting Interface.
UART_DataMode readDataMode
Definition: UARTCC3200DMA.h:165
ClockP_Handle txFifoEmptyClk
Definition: UARTCC3200DMA.h:190
SemaphoreP_Handle readSem
Definition: UARTCC3200DMA.h:185
size_t writeSize
Definition: UARTCC3200DMA.h:176
void * readBuf
Definition: UARTCC3200DMA.h:179
UART_Mode readMode
Definition: UARTCC3200DMA.h:158
unsigned int intNum
Definition: UARTCC3200DMA.h:141
Power notify object structure.
Definition: Power.h:112
UART driver interface.
UART_STOP stopBits
Definition: UARTCC3200DMA.h:169
SemaphoreP_Handle writeSem
Definition: UARTCC3200DMA.h:184
UDMACC3200 Global configuration.
Definition: UDMACC3200.h:135
UART_LEN dataLength
Definition: UARTCC3200DMA.h:168
unsigned int intPriority
Definition: UARTCC3200DMA.h:143
const UART_FxnTable UARTCC3200DMA_fxnTable
const void * writeBuf
Definition: UARTCC3200DMA.h:174
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
UART_PAR parityType
Definition: UARTCC3200DMA.h:170
UARTCC3200DMA Hardware attributes.
Definition: UARTCC3200DMA.h:137
unsigned long rxChannelIndex
Definition: UARTCC3200DMA.h:145
unsigned int writeTimeout
Definition: UARTCC3200DMA.h:161
HwiP_Handle hwiHandle
Definition: UARTCC3200DMA.h:187
unsigned int baseAddr
Definition: UARTCC3200DMA.h:139
size_t readSize
Definition: UARTCC3200DMA.h:181
UART_LEN
UART data length settings.
Definition: UART.h:398
UART_Callback writeCallback
Definition: UARTCC3200DMA.h:163
size_t writeCount
Definition: UARTCC3200DMA.h:175
unsigned int powerMgrId
Definition: UARTCC3200DMA.h:192
void * HwiP_Handle
Opaque client reference to an instance of a HwiP.
Definition: HwiP.h:66
UART_ReturnMode readReturnMode
Definition: UARTCC3200DMA.h:164
UARTCC3200DMA Object.
Definition: UARTCC3200DMA.h:155
struct UARTCC3200DMA_Object * UARTCC3200DMA_Handle
UART_Callback readCallback
Definition: UARTCC3200DMA.h:162
unsigned long txChannelIndex
Definition: UARTCC3200DMA.h:147
Hardware Interrupt module for the RTOS Porting Interface.
bool opened
Definition: UARTCC3200DMA.h:157
UART_Mode writeMode
Definition: UARTCC3200DMA.h:159
void * ClockP_Handle
Opaque client reference to an instance of a ClockP.
Definition: ClockP.h:91
Copyright 2016, Texas Instruments Incorporated