Data Structures | Macros | Typedefs | Functions | Variables
DisplayUart2.h File Reference

Detailed Description

Display.h implementation for UART output.

============================================================================

DisplayUart2 specifics

DisplayUart2 has two sets of function pointer tables. One which adds some ANSI/VT100 codes to the output, for cursor placement etc, and a minimal implementation which basically is a wrapper for UART2_write.

DisplayUart2Min

DisplayUart2Min simply formats and outputs the text over UART and adds a newline at the end of each statement.

Calls to Display_clear, Display_clearLine(s), and the line and column specifiers in Display_printf(handle, line, col, fmt, ...) are ignored.

DisplayUart2Ansi

DisplayUart2Ansi will send the following escape-strings to the UART when it is opened:

When Display_print(handle, line, col, fmt, ...) is called with a line number the following is sent:

If Display_printf is called with the line "number" DisplayUart2_SCROLLING, the string to be printed is simply output at the current cursor location, without saving or restoring the position. If the terminal supports the scrolling region feature, as most do, then the terminal will ensure that the content output here will scroll up but not overwrite the text written outside the scroll region.

In this manner it is possible to have two separate outputs, one with a log of events, and one with fixed positions as on an LCD. Unless the DisplayUart_SCROLLING line specifier is used, any line number can be used, also those nominally inside the scrolling region.

There is also a helper file <ti/display/AnsiColor.h> with a macro to set the color and style of the text.

Usage Example

#define MAXPRINTLEN 128
DisplayUart2_Object displayUart2Object;
static char uartStringBuf[MAXPRINTLEN];
const DisplayUart2_HWAttrs displayUart2HWAttrs = {
.uartIdx = CONFIG_UART0,
.baudRate = 115200,
.mutexTimeout = BIOS_WAIT_FOREVER,
.strBuf = uartStringBuf,
.strBufLen = MAXPRINTLEN,
};
const Display_Config Display_config[] = {
{
//.fxnTablePtr = &DisplayUart2Min_fxnTable,
.object = &displayUartObject,
.hwAttrs = &displayUartHWAttrs
}
};
const uint8_t Display_count = sizeof(Display_config) / sizeof(Display_Config);
void myTask(uintptr_t a0, uintptr_t a1)
{
Display_printf(handle, 1, 0, "Hello");
Display_printf(handle, 2, 6, ANSI_COLOR(FG_GREEN) "World!" ANSI_COLOR(ATTR_RESET));
}

#include <ti/drivers/dpl/SemaphoreP.h>
#include <ti/drivers/UART2.h>
#include <ti/display/Display.h>
#include <stdint.h>
Include dependency graph for DisplayUart2.h:

Go to the source code of this file.

Data Structures

struct  DisplayUart2_HWAttrs
 DisplayUart2 Attributes. More...
 
struct  DisplayUart2_Object
 DisplayUart2 Object. More...
 

Macros

#define DisplayUart2_SCROLLING   0xFF
 

Typedefs

typedef struct DisplayUart2_ObjectDisplayUart2_Handle
 

Functions

void DisplayUart2Min_init (Display_Handle handle)
 
void DisplayUart2Ansi_init (Display_Handle handle)
 
Display_Handle DisplayUart2Min_open (Display_Handle handle, Display_Params *params)
 
Display_Handle DisplayUart2Ansi_open (Display_Handle handle, Display_Params *params)
 
void DisplayUart2Min_clear (Display_Handle handle)
 
void DisplayUart2Ansi_clear (Display_Handle handle)
 
void DisplayUart2Min_clearLines (Display_Handle handle, uint8_t fromLine, uint8_t toLine)
 
void DisplayUart2Ansi_clearLines (Display_Handle handle, uint8_t fromLine, uint8_t toLine)
 
void DisplayUart2Min_vprintf (Display_Handle handle, uint8_t line, uint8_t column, const char *fmt, va_list va)
 
void DisplayUart2Ansi_vprintf (Display_Handle handle, uint8_t line, uint8_t column, const char *fmt, va_list va)
 
void DisplayUart2Min_close (Display_Handle handle)
 
void DisplayUart2Ansi_close (Display_Handle handle)
 
int DisplayUart2Min_control (Display_Handle handle, unsigned int cmd, void *arg)
 
int DisplayUart2Ansi_control (Display_Handle handle, unsigned int cmd, void *arg)
 
unsigned int DisplayUart2Min_getType (void)
 
unsigned int DisplayUart2Ansi_getType (void)
 

Variables

const Display_FxnTable DisplayUart2Min_fxnTable
 
const Display_FxnTable DisplayUart2Ansi_fxnTable
 

Macro Definition Documentation

§ DisplayUart2_SCROLLING

#define DisplayUart2_SCROLLING   0xFF

Typedef Documentation

§ DisplayUart2_Handle

Function Documentation

§ DisplayUart2Min_init()

void DisplayUart2Min_init ( Display_Handle  handle)

§ DisplayUart2Ansi_init()

void DisplayUart2Ansi_init ( Display_Handle  handle)

§ DisplayUart2Min_open()

Display_Handle DisplayUart2Min_open ( Display_Handle  handle,
Display_Params params 
)

§ DisplayUart2Ansi_open()

Display_Handle DisplayUart2Ansi_open ( Display_Handle  handle,
Display_Params params 
)

§ DisplayUart2Min_clear()

void DisplayUart2Min_clear ( Display_Handle  handle)

§ DisplayUart2Ansi_clear()

void DisplayUart2Ansi_clear ( Display_Handle  handle)

§ DisplayUart2Min_clearLines()

void DisplayUart2Min_clearLines ( Display_Handle  handle,
uint8_t  fromLine,
uint8_t  toLine 
)

§ DisplayUart2Ansi_clearLines()

void DisplayUart2Ansi_clearLines ( Display_Handle  handle,
uint8_t  fromLine,
uint8_t  toLine 
)

§ DisplayUart2Min_vprintf()

void DisplayUart2Min_vprintf ( Display_Handle  handle,
uint8_t  line,
uint8_t  column,
const char *  fmt,
va_list  va 
)

§ DisplayUart2Ansi_vprintf()

void DisplayUart2Ansi_vprintf ( Display_Handle  handle,
uint8_t  line,
uint8_t  column,
const char *  fmt,
va_list  va 
)

§ DisplayUart2Min_close()

void DisplayUart2Min_close ( Display_Handle  handle)

§ DisplayUart2Ansi_close()

void DisplayUart2Ansi_close ( Display_Handle  handle)

§ DisplayUart2Min_control()

int DisplayUart2Min_control ( Display_Handle  handle,
unsigned int  cmd,
void *  arg 
)

§ DisplayUart2Ansi_control()

int DisplayUart2Ansi_control ( Display_Handle  handle,
unsigned int  cmd,
void *  arg 
)

§ DisplayUart2Min_getType()

unsigned int DisplayUart2Min_getType ( void  )

§ DisplayUart2Ansi_getType()

unsigned int DisplayUart2Ansi_getType ( void  )

Variable Documentation

§ DisplayUart2Min_fxnTable

const Display_FxnTable DisplayUart2Min_fxnTable

§ DisplayUart2Ansi_fxnTable

const Display_FxnTable DisplayUart2Ansi_fxnTable
© Copyright 1995-2023, Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy policy | Terms of use | Terms of sale