TI-RTOS Drivers  tidrivers_cc32xx_2_16_00_08
UARTCC3200DMA.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2014-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_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>
65 
76 /* Add UARTCC3200DMA_STATUS_* macros here */
77 
90 /* Add UARTCC3200DMA_CMD_* macros here */
91 
94 /* UART function table pointer */
96 
136 typedef struct UARTCC3200DMA_HWAttrs {
138  unsigned int baseAddr;
140  unsigned int intNum;
142  unsigned int intPriority;
144  unsigned long rxChannelIndex;
146  unsigned long txChannelIndex;
148 
154 typedef struct UARTCC3200DMA_Object {
155  /* UART control variables */
156  bool opened; /* Has the obj been opened */
157  UART_Mode readMode; /* Mode for all read calls */
158  UART_Mode writeMode; /* Mode for all write calls */
159  unsigned int readTimeout; /* Timeout for read semaphore */
160  unsigned int writeTimeout; /* Timeout for write semaphore */
161  UART_Callback readCallback; /* Pointer to read callback */
162  UART_Callback writeCallback; /* Pointer to write callback */
163  UART_ReturnMode readReturnMode; /* Receive return mode */
164  UART_DataMode readDataMode; /* Type of data being read */
165  UART_DataMode writeDataMode; /* Type of data being written */
166  uint32_t baudRate; /* Baud rate for UART */
167  UART_LEN dataLength; /* Data length for UART */
168  UART_STOP stopBits; /* Stop bits for UART */
169  UART_PAR parityType; /* Parity bit type for UART */
170  UART_Echo readEcho; /* Echo received data back */
171 
172  /* UART write variables */
173  const void *writeBuf; /* Buffer data pointer */
174  size_t writeCount; /* Number of Chars sent */
175  size_t writeSize; /* Chars remaining in buffer */
176 
177  /* UART receive variables */
178  void *readBuf; /* Buffer data pointer */
179  size_t readCount; /* Number of Chars read */
180  size_t readSize; /* Chars remaining in buffer */
181 
182  /* Semaphores for blocking mode */
183  SemaphoreP_Handle writeSem; /* UART write semaphore */
184  SemaphoreP_Handle readSem; /* UART read semaphore */
185 
187 
188  /* For Power management */
189  ClockP_Handle txFifoEmptyClk; /* UART TX FIFO empty clock */
190  Power_NotifyObj postNotify; /* LPDS wake-up notify object */
191  unsigned int powerMgrId; /* Determined from base address */
193 
194 #ifdef __cplusplus
195 }
196 #endif
197 
198 #endif /* ti_drivers_uart_UARTCC3200DMA__include */
UART_STOP
UART stop bit settings.
Definition: UART.h:396
unsigned int readTimeout
Definition: UARTCC3200DMA.h:159
UART_Echo readEcho
Definition: UARTCC3200DMA.h:170
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:514
Power manager interface.
UART_PAR
UART parity type settings.
Definition: UART.h:406
UART_DataMode writeDataMode
Definition: UARTCC3200DMA.h:165
struct UARTCC3200DMA_Object UARTCC3200DMA_Object
UARTCC3200DMA Object.
UART_Mode
UART mode settings.
Definition: UART.h:308
UART_DataMode
UART data mode settings.
Definition: UART.h:356
struct UARTCC3200DMA_HWAttrs UARTCC3200DMA_HWAttrs
UARTCC3200DMA Hardware attributes.
UART_ReturnMode
UART return mode settings.
Definition: UART.h:341
Power_NotifyObj postNotify
Definition: UARTCC3200DMA.h:190
size_t readCount
Definition: UARTCC3200DMA.h:179
UART_Echo
UART echo settings.
Definition: UART.h:374
uint32_t baudRate
Definition: UARTCC3200DMA.h:166
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:164
ClockP_Handle txFifoEmptyClk
Definition: UARTCC3200DMA.h:189
SemaphoreP_Handle readSem
Definition: UARTCC3200DMA.h:184
size_t writeSize
Definition: UARTCC3200DMA.h:175
void * readBuf
Definition: UARTCC3200DMA.h:178
UART_Mode readMode
Definition: UARTCC3200DMA.h:157
unsigned int intNum
Definition: UARTCC3200DMA.h:140
Power notify object structure.
Definition: Power.h:112
UART driver interface.
UART_STOP stopBits
Definition: UARTCC3200DMA.h:168
SemaphoreP_Handle writeSem
Definition: UARTCC3200DMA.h:183
UART_LEN dataLength
Definition: UARTCC3200DMA.h:167
unsigned int intPriority
Definition: UARTCC3200DMA.h:142
const UART_FxnTable UARTCC3200DMA_fxnTable
const void * writeBuf
Definition: UARTCC3200DMA.h:173
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:301
UART_PAR parityType
Definition: UARTCC3200DMA.h:169
UARTCC3200DMA Hardware attributes.
Definition: UARTCC3200DMA.h:136
unsigned long rxChannelIndex
Definition: UARTCC3200DMA.h:144
unsigned int writeTimeout
Definition: UARTCC3200DMA.h:160
HwiP_Handle hwiHandle
Definition: UARTCC3200DMA.h:186
unsigned int baseAddr
Definition: UARTCC3200DMA.h:138
size_t readSize
Definition: UARTCC3200DMA.h:180
UART_LEN
UART data length settings.
Definition: UART.h:384
UART_Callback writeCallback
Definition: UARTCC3200DMA.h:162
size_t writeCount
Definition: UARTCC3200DMA.h:174
unsigned int powerMgrId
Definition: UARTCC3200DMA.h:191
void * HwiP_Handle
Opaque client reference to an instance of a HwiP.
Definition: HwiP.h:66
UART_ReturnMode readReturnMode
Definition: UARTCC3200DMA.h:163
UARTCC3200DMA Object.
Definition: UARTCC3200DMA.h:154
struct UARTCC3200DMA_Object * UARTCC3200DMA_Handle
UART_Callback readCallback
Definition: UARTCC3200DMA.h:161
unsigned long txChannelIndex
Definition: UARTCC3200DMA.h:146
Hardware Interrupt module for the RTOS Porting Interface.
bool opened
Definition: UARTCC3200DMA.h:156
UART_Mode writeMode
Definition: UARTCC3200DMA.h:158
void * ClockP_Handle
Opaque client reference to an instance of a ClockP.
Definition: ClockP.h:91
Copyright 2016, Texas Instruments Incorporated