DisplaySharp.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2018, 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  */
32 
33 #ifndef ti_display_DisplaySharp__include
34 #define ti_display_DisplaySharp__include
35 
36 #include <ti/drivers/dpl/SemaphoreP.h>
37 
38 #include <ti/drivers/SPI.h>
39 
40 #include <ti/display/Display.h>
41 #include <ti/grlib/grlib.h>
42 
43 #include <stdint.h>
44 
63 #define DISPLAYSHARP_CMD_SET_COLORS DISPLAY_CMD_RESERVED + 0
64 
72 
80 typedef struct
81 {
82  uint32_t fg;
83  uint32_t bg;
85 
86 typedef struct DisplaySharp_HWAttrsV1
87 {
88  uint32_t spiIndex;
89  uint32_t csPin;
90  uint32_t powerPin;
91  uint32_t enablePin;
92  uint16_t pixelHeight;
93  uint16_t pixelWidth;
94  void *displayBuf;
96 
97 typedef uint8_t DisplaySharp_Buf_96x96[96 * 96 / 8];
98 typedef uint8_t DisplaySharp_Buf_128x128[128 * 128 / 8];
99 
100 typedef struct DisplaySharp_Object
101 {
102  Graphics_Context g_sContext;
105  Graphics_Display g_sDisplay;
107  SemaphoreP_Handle semLCD;
108  uint8_t *displayBuffer;
110 
111 void DisplaySharp_init(Display_Handle handle);
113  Display_Params * params);
116  uint8_t fromLine,
117  uint8_t toLine);
118 void DisplaySharp_vprintf(Display_Handle handle, uint8_t line,
119  uint8_t column, char *fmt, va_list va);
121 int DisplaySharp_control(Display_Handle handle, unsigned int cmd, void *arg);
122 unsigned int DisplaySharp_getType(void);
123 #endif // ti_display_DisplaySharp__include
struct DisplaySharp_HWAttrsV1 DisplaySharp_HWAttrsV1
uint32_t spiIndex
Definition: DisplaySharp.h:88
SPI_Handle hSpi
Definition: DisplaySharp.h:103
Serial Peripheral Interface (SPI) Driver Interface.
Foreground and background color struct, compatible with GrLib.
Definition: DisplaySharp.h:80
DisplaySharpColor_t displayColor
Definition: DisplaySharp.h:106
Display_Handle DisplaySharp_open(Display_Handle, Display_Params *params)
void * displayBuf
Definition: DisplaySharp.h:94
Graphics_Display g_sDisplay
Definition: DisplaySharp.h:105
Display_LineClearMode lineClearMode
Definition: DisplaySharp.h:104
unsigned int DisplaySharp_getType(void)
uint32_t bg
Definition: DisplaySharp.h:83
uint8_t DisplaySharp_Buf_128x128[128 *128/8]
Definition: DisplaySharp.h:98
Display Parameters.
Definition: Display.h:493
int DisplaySharp_control(Display_Handle handle, unsigned int cmd, void *arg)
void DisplaySharp_clear(Display_Handle handle)
uint8_t * displayBuffer
Definition: DisplaySharp.h:108
SemaphoreP_Handle semLCD
Definition: DisplaySharp.h:107
void DisplaySharp_clearLines(Display_Handle handle, uint8_t fromLine, uint8_t toLine)
Generic interface for text output.
void DisplaySharp_vprintf(Display_Handle handle, uint8_t line, uint8_t column, char *fmt, va_list va)
void DisplaySharp_close(Display_Handle)
uint32_t powerPin
Definition: DisplaySharp.h:90
SPI Global configuration.
Definition: SPI.h:742
The definition of a Display function table that contains the required set of functions to control a s...
Definition: Display.h:552
const Display_FxnTable DisplaySharp_fxnTable
uint16_t pixelHeight
Definition: DisplaySharp.h:92
uint32_t enablePin
Definition: DisplaySharp.h:91
struct DisplaySharp_Object DisplaySharp_Object
Definition: DisplaySharp.h:100
Definition: DisplaySharp.h:86
Graphics_Context g_sContext
Definition: DisplaySharp.h:102
uint32_t fg
Definition: DisplaySharp.h:82
void DisplaySharp_init(Display_Handle handle)
struct DisplaySharp_Object * DisplaySharp_Handle
Display Global configuration.
Definition: Display.h:575
uint32_t csPin
Definition: DisplaySharp.h:89
Display_LineClearMode
How to treat existing elements on a line when writing text.
Definition: Display.h:477
uint8_t DisplaySharp_Buf_96x96[96 *96/8]
Definition: DisplaySharp.h:97
uint16_t pixelWidth
Definition: DisplaySharp.h:93
© Copyright 1995-2019, Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy policy | Terms of use | Terms of sale