TI-RTOS Drivers  tidrivers_full_2_20_00_08
DisplaySharp.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2016, 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 _DISPLAY_SHARP_H_
34 #define _DISPLAY_SHARP_H_
35 
36 #include <ti/sysbios/knl/Semaphore.h>
37 
38 #include <ti/drivers/PIN.h>
39 #include <ti/drivers/SPI.h>
40 
41 #include <ti/mw/display/Display.h>
42 #include <ti/mw/grlib/grlib.h>
43 
44 #include <stdint.h>
45 
64 #define DISPLAYSHARP_CMD_SET_COLORS DISPLAY_CMD_RESERVED + 0
65 
73 
81 typedef struct
82 {
83  uint32_t fg;
84  uint32_t bg;
86 
87 typedef struct DisplaySharp_HWAttrs
88 {
89  uint32_t spiIndex;
94  uint16_t pixelHeight;
95  uint16_t pixelWidth;
96  void *displayBuf;
98 
99 typedef uint8_t DisplaySharp_Buf_96x96[96 * 96 / 8];
100 typedef uint8_t DisplaySharp_Buf_128x128[128 * 128 / 8];
101 
102 typedef struct DisplaySharp_Object
103 {
111  Semaphore_Struct semLCD;
112  uint8_t *displayBuffer;
114 
115 
117  Display_Params * params);
120  uint8_t fromLine,
121  uint8_t toLine);
122 void DisplaySharp_put5(Display_Handle handle, uint8_t line,
123  uint8_t column, uintptr_t fmt, uintptr_t a0,
124  uintptr_t a1, uintptr_t a2, uintptr_t a3,
125  uintptr_t a4);
127 int DisplaySharp_control(Display_Handle handle, unsigned int cmd, void *arg);
128 unsigned int DisplaySharp_getType(void);
129 #endif // _DISPLAY_SHARP_H_
uint8_t PIN_Id
Pin identifier data type.
Definition: PIN.h:557
tContext g_sContext
Definition: DisplaySharp.h:104
SPI_Handle hSpi
Definition: DisplaySharp.h:105
SPI driver interface.
Foreground and background color struct, compatible with GrLib.
Definition: DisplaySharp.h:81
DisplaySharpColor_t displayColor
Definition: DisplaySharp.h:110
Display_Handle DisplaySharp_open(Display_Handle, Display_Params *params)
Definition: DisplaySharp.h:87
SPI Global configuration.
Definition: SPI.h:436
tDisplay g_sDisplay
Definition: DisplaySharp.h:109
Display_LineClearMode lineClearMode
Definition: DisplaySharp.h:108
unsigned int DisplaySharp_getType(void)
uint32_t bg
Definition: DisplaySharp.h:84
uint8_t DisplaySharp_Buf_128x128[128 *128/8]
Definition: DisplaySharp.h:100
Display Parameters.
Definition: Display.h:386
uint16_t pixelWidth
Definition: DisplaySharp.h:95
int DisplaySharp_control(Display_Handle handle, unsigned int cmd, void *arg)
PIN_Id powerPin
Definition: DisplaySharp.h:92
void DisplaySharp_clear(Display_Handle handle)
uint8_t * displayBuffer
Definition: DisplaySharp.h:112
Definition: grlib.h:507
void DisplaySharp_clearLines(Display_Handle handle, uint8_t fromLine, uint8_t toLine)
Generic interface for text output.
void DisplaySharp_close(Display_Handle)
PIN_Handle hPins
Definition: DisplaySharp.h:107
The definition of a Display function table that contains the required set of functions to control a s...
Definition: Display.h:447
PIN_Id enablePin
Definition: DisplaySharp.h:93
const Display_FxnTable DisplaySharp_fxnTable
uint32_t spiIndex
Definition: DisplaySharp.h:89
underlying data structure for type PIN_State
Definition: PIN.h:687
void * displayBuf
Definition: DisplaySharp.h:96
struct DisplaySharp_Object DisplaySharp_Object
Definition: DisplaySharp.h:102
PIN_State pinState
Definition: DisplaySharp.h:106
uint32_t fg
Definition: DisplaySharp.h:83
This structure defines the characteristics of a display driver.
Definition: grlib.h:196
PIN_Id extcominPin
Definition: DisplaySharp.h:91
Semaphore_Struct semLCD
Definition: DisplaySharp.h:111
uint16_t pixelHeight
Definition: DisplaySharp.h:94
struct DisplaySharp_Object * DisplaySharp_Handle
void DisplaySharp_put5(Display_Handle handle, uint8_t line, uint8_t column, uintptr_t fmt, uintptr_t a0, uintptr_t a1, uintptr_t a2, uintptr_t a3, uintptr_t a4)
Display Global configuration.
Definition: Display.h:469
struct DisplaySharp_HWAttrs DisplaySharp_HWAttrs
Display_LineClearMode
How to treat existing elements on a line when writing text.
Definition: Display.h:370
uint8_t DisplaySharp_Buf_96x96[96 *96/8]
Definition: DisplaySharp.h:99
Generic PIN & GPIO driver.
PIN_Id csPin
Definition: DisplaySharp.h:90
Copyright 2016, Texas Instruments Incorporated