forked from STMicroelectronics/stm32-otm8009a
-
Notifications
You must be signed in to change notification settings - Fork 0
/
otm8009a_reg.h
168 lines (130 loc) · 6.04 KB
/
otm8009a_reg.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
/**
******************************************************************************
* @file otm8009a_reg.h
* @author MCD Application Team
* @brief This file contains all the constants parameters for the OTM8009A
******************************************************************************
* @attention
*
* <h2><center>© Copyright (c) 2019 STMicroelectronics.
* All rights reserved.</center></h2>
*
* This software component is licensed by ST under BSD 3-Clause license,
* the "License"; You may not use this file except in compliance with the
* License. You may obtain a copy of the License at:
* opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef OTM8009A_REG_H
#define OTM8009A_REG_H
/* Includes ------------------------------------------------------------------*/
#include <cmsis_compiler.h>
#ifdef __cplusplus
extern "C" {
#endif
/** @addtogroup BSP
* @{
*/
/** @addtogroup Components
* @{
*/
/** @addtogroup OTM8009A
* @{
*/
/** @defgroup OTM8009A_Exported_Constants
* @{
*/
/* List of OTM8009A used commands */
/* Detailed in OTM8009A Data Sheet 'DATA_SHEET_OTM8009A_V0 92.pdf' */
/* Version of 14 June 2012 */
#define OTM8009A_CMD_NOP 0x00 /* NOP command */
#define OTM8009A_CMD_SWRESET 0x01 /* Sw reset command */
#define OTM8009A_CMD_RDDMADCTL 0x0B /* Read Display MADCTR command : read memory display access ctrl */
#define OTM8009A_CMD_RDDCOLMOD 0x0C /* Read Display pixel format */
#define OTM8009A_CMD_SLPIN 0x10 /* Sleep In command */
#define OTM8009A_CMD_SLPOUT 0x11 /* Sleep Out command */
#define OTM8009A_CMD_PTLON 0x12 /* Partial mode On command */
#define OTM8009A_CMD_DISPOFF 0x28 /* Display Off command */
#define OTM8009A_CMD_DISPON 0x29 /* Display On command */
#define OTM8009A_CMD_CASET 0x2A /* Column address set command */
#define OTM8009A_CMD_PASET 0x2B /* Page address set command */
#define OTM8009A_CMD_RAMWR 0x2C /* Memory (GRAM) write command */
#define OTM8009A_CMD_RAMRD 0x2E /* Memory (GRAM) read command */
#define OTM8009A_CMD_PLTAR 0x30 /* Partial area command (4 parameters) */
#define OTM8009A_CMD_TEOFF 0x34 /* Tearing Effect Line Off command : command with no parameter */
#define OTM8009A_CMD_TEEON 0x35 /* Tearing Effect Line On command : command with 1 parameter 'TELOM' */
/* Parameter TELOM : Tearing Effect Line Output Mode : possible values */
#define OTM8009A_TEEON_TELOM_VBLANKING_INFO_ONLY 0x00
#define OTM8009A_TEEON_TELOM_VBLANKING_AND_HBLANKING_INFO 0x01
#define OTM8009A_CMD_MADCTR 0x36 /* Memory Access write control command */
/* Possible used values of MADCTR */
#define OTM8009A_MADCTR_MODE_PORTRAIT 0x00
#define OTM8009A_MADCTR_MODE_LANDSCAPE 0x60 /* MY = 0, MX = 1, MV = 1, ML = 0, RGB = 0 */
#define OTM8009A_CMD_IDMOFF 0x38 /* Idle mode Off command */
#define OTM8009A_CMD_IDMON 0x39 /* Idle mode On command */
#define OTM8009A_CMD_COLMOD 0x3A /* Interface Pixel format command */
/* Possible values of COLMOD parameter corresponding to used pixel formats */
#define OTM8009A_COLMOD_RGB565 0x55
#define OTM8009A_COLMOD_RGB888 0x77
#define OTM8009A_CMD_RAMWRC 0x3C /* Memory write continue command */
#define OTM8009A_CMD_RAMRDC 0x3E /* Memory read continue command */
#define OTM8009A_CMD_WRTESCN 0x44 /* Write Tearing Effect Scan line command */
#define OTM8009A_CMD_RDSCNL 0x45 /* Read Tearing Effect Scan line command */
/* CABC Management : ie : Content Adaptive Back light Control in IC OTM8009a */
#define OTM8009A_CMD_WRDISBV 0x51 /* Write Display Brightness command */
#define OTM8009A_CMD_WRCTRLD 0x53 /* Write CTRL Display command */
#define OTM8009A_CMD_WRCABC 0x55 /* Write Content Adaptive Brightness command */
#define OTM8009A_CMD_WRCABCMB 0x5E /* Write CABC Minimum Brightness command */
#define OTM8009A_CMD_ID1 0xDA /* Read ID1 command */
#define OTM8009A_CMD_ID2 0xDB /* Read ID2 command */
#define OTM8009A_CMD_ID3 0xDC /* Read ID3 command */
/**
* @}
*/
/* Exported macro ------------------------------------------------------------*/
/** @defgroup OTM8009A_Exported_Macros OTM8009A Exported Macros
* @{
*/
/**
* @}
*/
/* Exported functions --------------------------------------------------------*/
/** @addtogroup OTM8009A_Exported_Functions
* @{
*/
/************** Generic Function *******************/
typedef int32_t (*OTM8009A_Write_Func)(void *, uint16_t, uint8_t*, uint16_t);
typedef int32_t (*OTM8009A_Read_Func) (void *, uint16_t, uint8_t*, uint16_t);
typedef struct
{
OTM8009A_Write_Func WriteReg;
OTM8009A_Read_Func ReadReg;
void *handle;
} otm8009a_ctx_t;
/*******************************************************************************
* Register : Generic - All
* Address : Generic - All
* Bit Group Name: None
* Permission : W
*******************************************************************************/
int32_t otm8009a_read_reg(otm8009a_ctx_t *ctx, uint16_t reg, uint8_t *pdata, uint16_t length);
int32_t otm8009a_write_reg(otm8009a_ctx_t *ctx, uint16_t reg, const uint8_t *pdata, uint16_t length);
/**
* @}
*/
#ifdef __cplusplus
}
#endif
#endif /* OTM8009A_REG_H */
/**
* @}
*/
/**
* @}
*/
/**
* @}
*/
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/