API Documentation  9.14.00
DisplaySharp.h
1 /*
2  * Copyright (c) 2018-2023, 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 
71 extern const Display_FxnTable DisplaySharp_fxnTable;
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;
95  const Graphics_Font *font;
97 
98 typedef uint8_t DisplaySharp_Buf_96x96[96 * 96 / 8];
99 typedef uint8_t DisplaySharp_Buf_128x128[128 * 128 / 8];
100 
101 typedef struct DisplaySharp_Object
102 {
103  Graphics_Context g_sContext;
104  SPI_Handle hSpi;
105  Display_LineClearMode lineClearMode;
106  Graphics_Display g_sDisplay;
107  DisplaySharpColor_t displayColor;
108  SemaphoreP_Handle semLCD;
109  uint8_t *displayBuffer;
111 
112 void DisplaySharp_init(Display_Handle handle);
113 Display_Handle DisplaySharp_open(Display_Handle handle, Display_Params *params);
114 void DisplaySharp_clear(Display_Handle handle);
115 void DisplaySharp_clearLines(Display_Handle handle, uint8_t fromLine, uint8_t toLine);
116 void DisplaySharp_vprintf(Display_Handle handle, uint8_t line, uint8_t column, const char *fmt, va_list va);
117 void DisplaySharp_close(Display_Handle handle);
118 int DisplaySharp_control(Display_Handle handle, unsigned int cmd, void *arg);
119 unsigned int DisplaySharp_getType(void);
120 #endif // ti_display_DisplaySharp__include
Serial Peripheral Interface (SPI) Driver Interface.
Foreground and background color struct, compatible with GrLib.
Definition: DisplaySharp.h:80
Display Parameters.
Definition: Display.h:485
Generic interface for text output.
SPI Global configuration.
Definition: SPI.h:746
The definition of a Display function table that contains the required set of functions to control a s...
Definition: Display.h:535
Definition: DisplaySharp.h:101
Definition: DisplaySharp.h:86
Display Global configuration.
Definition: Display.h:558
Display_LineClearMode
How to treat existing elements on a line when writing text.
Definition: Display.h:469