TI-RTOS Drivers  tidrivers_full_2_20_00_08
Data Structures | Macros | Typedefs | Functions
DisplayExt.h File Reference

Detailed Description

Extention of Display to access GrLib functionality in capable displays.

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

Driver include

The display header file should be included in an application as follows:

#include <ti/mw/DisplayExt.h>

Operation

This extension depends on an already opened Display interface, and accesses the global Display_config object.

Note
All Display statements will be removed and no display operations will take place if the symbol Display_DISABLE_ALL is defined globally, or before display.h is included.

Using the extension

First, the regular Display interface must be opened, and after that, APIs in this extension become usable.

//...
//Display_open(Display_ALL, &params);
tContext *pContext = DisplayExt_getGrLibContext();
tRectangle rect = {
.sXMin = 10,
.sXMax = 30,
.sYMin = 10,
.sYMax = 20,
};
// It's possible that no compatible Display is available or opened.
if (pContext != NULL)
{
GrRectFill(pContext, &rect);
GrFlush(pContext);
}

Implementation

This interface expects that all Display implementations that report type Display_Type_GRLIB will also 'inherit' the DisplayGrLib_Object so that the implementation specific instance object can be cast to the type DisplayGrLib_Object.

In practice this means that the tContext object used to control GrLib by the display implementation must be the first member of the Object structure used by that implementation.

For example, Display_SharpObject can be cast to DisplayGrLib_Object to access the tContext object, without this interface having prior knowledge about the Sharp display implementation.

Instrumentation

The Display interface produces log statements if instrumentation is enabled.

Diagnostics Mask Log details
Diags_USER1 basic operations performed
Diags_USER2 detailed operations performed

#include <ti/mw/display/Display.h>
#include <ti/mw/grlib/grlib.h>
Include dependency graph for DisplayExt.h:

Go to the source code of this file.

Data Structures

struct  DisplayGrLib_Object
 

Macros

#define DisplayExt_getGrlibContext(handle)   DisplayExt_doGetGrlibContext(handle)
 

Typedefs

typedef struct DisplayGrLib_Object DisplayGrLib_Object
 
typedef struct DisplayGrLib_ObjectDisplayGrLib_Handle
 

Functions

tContextDisplayExt_doGetGrlibContext (Display_Handle handle)
 Get the tContext object of the first available and open Display that uses GrLib for output. More...
 

Macro Definition Documentation

#define DisplayExt_getGrlibContext (   handle)    DisplayExt_doGetGrlibContext(handle)

Get tContext of first opened Display that uses GrLib

See also
Display_doGetGrlibContext()

Typedef Documentation

Function Documentation

tContext* DisplayExt_doGetGrlibContext ( Display_Handle  handle)

Get the tContext object of the first available and open Display that uses GrLib for output.

Useful for drawing graphics if you know that the display is GrLib capable.

Note
Calling GrLib functions directly is not thread-safe, and can conflict with Display calls or other GrLib calls.
Returns
tContext pointer or NULL if no open display is found.
Copyright 2016, Texas Instruments Incorporated