DisplayUart.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2016-2019, 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  */
128 #ifndef ti_display_DisplayUart__include
129 #define ti_display_DisplayUart__include
130 
131 #include <ti/drivers/dpl/SemaphoreP.h>
132 #include <ti/drivers/UART.h>
133 #include <ti/display/Display.h>
134 #include <stdint.h>
135 
136 /* Ensure backwards compatibility. Old examples will use Minimal. */
137 #ifndef DisplayUart_fxnTable
138 # define DisplayUart_fxnTable DisplayUartMin_fxnTable
139 #endif
140 
141 /* Line number that means 'put in scrolling section', if exists */
142 #define DisplayUart_SCROLLING 0xFF
143 
146 
156 typedef struct DisplayUart_HWAttrs
157 {
159  unsigned int uartIdx;
161  unsigned int baudRate;
163  unsigned int mutexTimeout;
165  char *strBuf;
167  uint16_t strBufLen;
169 
170 
176 typedef struct DisplayUart_Object
177 {
179  SemaphoreP_Handle mutex;
182 
183 
186 
189 
192 
194  uint8_t fromLine,
195  uint8_t toLine);
197  uint8_t fromLine,
198  uint8_t toLine);
199 
200 void DisplayUartMin_vprintf(Display_Handle handle, uint8_t line,
201  uint8_t column, char *fmt, va_list va);
202 void DisplayUartAnsi_vprintf(Display_Handle handle, uint8_t line,
203  uint8_t column, char *fmt, va_list va);
204 
207 
208 int DisplayUartMin_control(Display_Handle handle, unsigned int cmd, void *arg);
209 int DisplayUartAnsi_control(Display_Handle handle, unsigned int cmd, void *arg);
210 
211 unsigned int DisplayUartMin_getType(void);
212 unsigned int DisplayUartAnsi_getType(void);
213 
214 #endif /* ti_display_DisplayUart__include */
const Display_FxnTable DisplayUartMin_fxnTable
SemaphoreP_Handle mutex
Definition: DisplayUart.h:179
unsigned int DisplayUartMin_getType(void)
void DisplayUartMin_clear(Display_Handle handle)
char * lineClearSeq
Definition: DisplayUart.h:180
const Display_FxnTable DisplayUartAnsi_fxnTable
void DisplayUartAnsi_vprintf(Display_Handle handle, uint8_t line, uint8_t column, char *fmt, va_list va)
void DisplayUartAnsi_clear(Display_Handle handle)
unsigned int mutexTimeout
Definition: DisplayUart.h:163
Display Parameters.
Definition: Display.h:493
UART Global configuration.
Definition: UART.h:678
DisplayUart Object.
Definition: DisplayUart.h:176
void DisplayUartAnsi_clearLines(Display_Handle handle, uint8_t fromLine, uint8_t toLine)
struct DisplayUart_Object * DisplayUart_Handle
Generic interface for text output.
void DisplayUartMin_clearLines(Display_Handle handle, uint8_t fromLine, uint8_t toLine)
unsigned int uartIdx
Definition: DisplayUart.h:159
void DisplayUartAnsi_init(Display_Handle handle)
char * strBuf
Definition: DisplayUart.h:165
Universal Asynchronous Receiver-Transmitter (UART) Driver.
DisplayUart Attributes.
Definition: DisplayUart.h:156
unsigned int DisplayUartAnsi_getType(void)
uint16_t strBufLen
Definition: DisplayUart.h:167
UART_Handle hUart
Definition: DisplayUart.h:178
void DisplayUartMin_vprintf(Display_Handle handle, uint8_t line, uint8_t column, char *fmt, va_list va)
unsigned int baudRate
Definition: DisplayUart.h:161
The definition of a Display function table that contains the required set of functions to control a s...
Definition: Display.h:552
int DisplayUartAnsi_control(Display_Handle handle, unsigned int cmd, void *arg)
void DisplayUartMin_init(Display_Handle handle)
void DisplayUartMin_close(Display_Handle)
Display_Handle DisplayUartAnsi_open(Display_Handle, Display_Params *params)
int DisplayUartMin_control(Display_Handle handle, unsigned int cmd, void *arg)
Display_Handle DisplayUartMin_open(Display_Handle, Display_Params *params)
Display Global configuration.
Definition: Display.h:575
struct DisplayUart_HWAttrs DisplayUart_HWAttrs
DisplayUart Attributes.
void DisplayUartAnsi_close(Display_Handle)
struct DisplayUart_Object DisplayUart_Object
DisplayUart Object.
© Copyright 1995-2019, Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy policy | Terms of use | Terms of sale