otm8009a.h
Go to the documentation of this file.
1 
22 /* Define to prevent recursive inclusion -------------------------------------*/
23 #ifndef OTM8009A_H
24 #define OTM8009A_H
25 
26 #ifdef __cplusplus
27  extern "C" {
28 #endif
29 
30 /* Includes ------------------------------------------------------------------*/
31 #include "otm8009a_reg.h"
32 
49 typedef int32_t (*OTM8009A_GetTick_Func) (void);
50 typedef int32_t (*OTM8009A_Delay_Func) (uint32_t);
51 typedef int32_t (*OTM8009A_WriteReg_Func)(uint16_t, uint16_t, uint8_t*, uint16_t);
52 typedef int32_t (*OTM8009A_ReadReg_Func) (uint16_t, uint16_t, uint8_t*, uint16_t);
53 
58 typedef struct
59 {
60  uint32_t Orientation;
61  uint32_t ColorCode;
62  uint32_t Brightness;
64 
65 typedef struct
66 {
67  uint16_t Address;
72 
73 typedef struct
74 {
77  uint8_t IsInitialized;
79 
80 typedef struct
81 {
82  /* Control functions */
83  int32_t (*Init )(OTM8009A_Object_t*, uint32_t, uint32_t);
84  int32_t (*DeInit )(OTM8009A_Object_t*);
85  int32_t (*ReadID )(OTM8009A_Object_t*, uint32_t*);
86  int32_t (*DisplayOn )(OTM8009A_Object_t*);
87  int32_t (*DisplayOff )(OTM8009A_Object_t*);
88  int32_t (*SetBrightness )(OTM8009A_Object_t*, uint32_t);
89  int32_t (*GetBrightness )(OTM8009A_Object_t*, uint32_t*);
90  int32_t (*SetOrientation )(OTM8009A_Object_t*, uint32_t);
91  int32_t (*GetOrientation )(OTM8009A_Object_t*, uint32_t*);
92 
93  /* Drawing functions*/
94  int32_t ( *SetCursor ) (OTM8009A_Object_t*, uint32_t, uint32_t);
95  int32_t ( *DrawBitmap ) (OTM8009A_Object_t*, uint32_t, uint32_t, uint8_t *);
96  int32_t ( *FillRGBRect ) (OTM8009A_Object_t *pObj, uint32_t Xpos, uint32_t Ypos, uint8_t *pData, uint32_t Width, uint32_t Height);
97  int32_t ( *DrawHLine ) (OTM8009A_Object_t*, uint32_t, uint32_t, uint32_t, uint32_t);
98  int32_t ( *DrawVLine ) (OTM8009A_Object_t*, uint32_t, uint32_t, uint32_t, uint32_t);
99  int32_t ( *FillRect ) (OTM8009A_Object_t*, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t);
100  int32_t ( *GetPixel ) (OTM8009A_Object_t*, uint32_t, uint32_t, uint32_t*);
101  int32_t ( *SetPixel ) (OTM8009A_Object_t*, uint32_t, uint32_t, uint32_t);
102  int32_t ( *GetXSize ) (OTM8009A_Object_t*, uint32_t *);
103  int32_t ( *GetYSize ) (OTM8009A_Object_t*, uint32_t *);
104 
106 
111 #define OTM8009A_OK (0)
112 #define OTM8009A_ERROR (-1)
113 
114 /* OTM8009A ID */
115 #define OTM8009A_ID 0x40U
116 
120 #define OTM8009A_ORIENTATION_PORTRAIT 0U /* Portrait orientation choice of LCD screen */
121 #define OTM8009A_ORIENTATION_LANDSCAPE 1U /* Landscape orientation choice of LCD screen */
122 
127 #define OTM8009A_FORMAT_RGB888 ((uint32_t)0x00) /* Pixel format chosen is RGB888 : 24 bpp */
128 #define OTM8009A_FORMAT_RBG565 ((uint32_t)0x02) /* Pixel format chosen is RGB565 : 16 bpp */
129 
134 /* Width and Height in Portrait mode */
135 #define OTM8009A_480X800_WIDTH ((uint16_t)480) /* LCD PIXEL WIDTH */
136 #define OTM8009A_480X800_HEIGHT ((uint16_t)800) /* LCD PIXEL HEIGHT */
137 
138 /* Width and Height in Landscape mode */
139 #define OTM8009A_800X480_WIDTH ((uint16_t)800) /* LCD PIXEL WIDTH */
140 #define OTM8009A_800X480_HEIGHT ((uint16_t)480) /* LCD PIXEL HEIGHT */
141 
145 #define OTM8009A_480X800_HSYNC ((uint16_t)2) /* Horizontal synchronization */
146 #define OTM8009A_480X800_HBP ((uint16_t)34) /* Horizontal back porch */
147 #define OTM8009A_480X800_HFP ((uint16_t)34) /* Horizontal front porch */
148 #define OTM8009A_480X800_VSYNC ((uint16_t)1) /* Vertical synchronization */
149 #define OTM8009A_480X800_VBP ((uint16_t)15) /* Vertical back porch */
150 #define OTM8009A_480X800_VFP ((uint16_t)16) /* Vertical front porch */
151 
156 #define OTM8009A_800X480_HSYNC OTM8009A_480X800_HSYNC /* Horizontal synchronization */
157 #define OTM8009A_800X480_HBP OTM8009A_480X800_HBP /* Horizontal back porch */
158 #define OTM8009A_800X480_HFP OTM8009A_480X800_HFP /* Horizontal front porch */
159 #define OTM8009A_800X480_VSYNC OTM8009A_480X800_VSYNC /* Vertical synchronization */
160 #define OTM8009A_800X480_VBP OTM8009A_480X800_VBP /* Vertical back porch */
161 #define OTM8009A_800X480_VFP OTM8009A_480X800_VFP /* Vertical front porch */
162 
166 #define OTM8009A_480X800_FREQUENCY_DIVIDER 2 /* LCD Frequency divider */
167 
172 /* Exported macro ------------------------------------------------------------*/
173 
182 /* Exported functions --------------------------------------------------------*/
183 
188 int32_t OTM8009A_Init(OTM8009A_Object_t *pObj, uint32_t ColorCoding, uint32_t Orientation);
189 int32_t OTM8009A_DeInit(OTM8009A_Object_t *pObj);
190 int32_t OTM8009A_ReadID(OTM8009A_Object_t *pObj, uint32_t *Id);
193 int32_t OTM8009A_SetBrightness(OTM8009A_Object_t *pObj, uint32_t Brightness);
194 int32_t OTM8009A_GetBrightness(OTM8009A_Object_t *pObj, uint32_t *Brightness);
195 int32_t OTM8009A_SetOrientation(OTM8009A_Object_t *pObj, uint32_t Orientation);
196 int32_t OTM8009A_GetOrientation(OTM8009A_Object_t *pObj, uint32_t *Orientation);
197 
198 
199 int32_t OTM8009A_SetCursor(OTM8009A_Object_t *pObj, uint32_t Xpos, uint32_t Ypos);
200 int32_t OTM8009A_DrawBitmap(OTM8009A_Object_t *pObj, uint32_t Xpos, uint32_t Ypos, uint8_t *pBmp);
201 int32_t OTM8009A_FillRGBRect(OTM8009A_Object_t *pObj, uint32_t Xpos, uint32_t Ypos, uint8_t *pData, uint32_t Width, uint32_t Height);
202 int32_t OTM8009A_DrawHLine(OTM8009A_Object_t *pObj, uint32_t Xpos, uint32_t Ypos, uint32_t Length, uint32_t Color);
203 int32_t OTM8009A_DrawVLine(OTM8009A_Object_t *pObj, uint32_t Xpos, uint32_t Ypos, uint32_t Length, uint32_t Color);
204 int32_t OTM8009A_FillRect(OTM8009A_Object_t *pObj, uint32_t Xpos, uint32_t Ypos, uint32_t Width, uint32_t Height, uint32_t Color);
205 int32_t OTM8009A_SetPixel(OTM8009A_Object_t *pObj, uint32_t Xpos, uint32_t Ypos, uint32_t Color);
206 int32_t OTM8009A_GetPixel(OTM8009A_Object_t *pObj, uint32_t Xpos, uint32_t Ypos, uint32_t *Color);
207 int32_t OTM8009A_GetXSize(OTM8009A_Object_t *pObj, uint32_t *XSize);
208 int32_t OTM8009A_GetYSize(OTM8009A_Object_t *pObj, uint32_t *YSize);
209 
211 
215 #ifdef __cplusplus
216 }
217 #endif
218 
219 #endif /* OTM8009A_H */
220 
232 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
OTM8009A_SetBrightness
int32_t OTM8009A_SetBrightness(OTM8009A_Object_t *pObj, uint32_t Brightness)
Set the display brightness.
Definition: otm8009a.c:491
OTM8009A_DrawBitmap
int32_t OTM8009A_DrawBitmap(OTM8009A_Object_t *pObj, uint32_t Xpos, uint32_t Ypos, uint8_t *pBmp)
Draw Bitmap image.
Definition: otm8009a.c:702
OTM8009A_IO_t::ReadReg
OTM8009A_ReadReg_Func ReadReg
Definition: otm8009a.h:69
Init
napi_value Init(napi_env env, napi_value exports)
Definition: porcupine/demo/c/pvrecorder/node/pv_recorder_napi.c:197
OTM8009A_ReadID
int32_t OTM8009A_ReadID(OTM8009A_Object_t *pObj, uint32_t *Id)
Read the component ID.
Definition: otm8009a.c:469
OTM8009A_GetTick_Func
int32_t(* OTM8009A_GetTick_Func)(void)
Definition: otm8009a.h:49
OTM8009A_Object_t::Ctx
otm8009a_ctx_t Ctx
Definition: otm8009a.h:76
OTM8009A_LCD_Ctx_t
Definition: otm8009a.h:58
OTM8009A_SetOrientation
int32_t OTM8009A_SetOrientation(OTM8009A_Object_t *pObj, uint32_t Orientation)
Set the display Orientation.
Definition: otm8009a.c:574
OTM8009A_FillRect
int32_t OTM8009A_FillRect(OTM8009A_Object_t *pObj, uint32_t Xpos, uint32_t Ypos, uint32_t Width, uint32_t Height, uint32_t Color)
Fill rectangle.
Definition: otm8009a.c:761
OTM8009A_LCD_Ctx_t::ColorCode
uint32_t ColorCode
Definition: otm8009a.h:61
OTM8009A_SetPixel
int32_t OTM8009A_SetPixel(OTM8009A_Object_t *pObj, uint32_t Xpos, uint32_t Ypos, uint32_t Color)
Set pixel color.
Definition: otm8009a.c:793
OTM8009A_GetPixel
int32_t OTM8009A_GetPixel(OTM8009A_Object_t *pObj, uint32_t Xpos, uint32_t Ypos, uint32_t *Color)
Get pixel color.
Definition: otm8009a.c:777
OTM8009A_DrawVLine
int32_t OTM8009A_DrawVLine(OTM8009A_Object_t *pObj, uint32_t Xpos, uint32_t Ypos, uint32_t Length, uint32_t Color)
Draw Vertical line.
Definition: otm8009a.c:743
OTM8009A_Init
int32_t OTM8009A_Init(OTM8009A_Object_t *pObj, uint32_t ColorCoding, uint32_t Orientation)
Initializes the LCD KoD display part by communication in DSI mode in Video Mode with IC Display Drive...
Definition: otm8009a.c:157
OTM8009A_GetYSize
int32_t OTM8009A_GetYSize(OTM8009A_Object_t *pObj, uint32_t *Ysize)
Set the display Height.
Definition: otm8009a.c:658
OTM8009A_GetOrientation
int32_t OTM8009A_GetOrientation(OTM8009A_Object_t *pObj, uint32_t *Orientation)
Set the display Orientation.
Definition: otm8009a.c:615
OTM8009A_LCD_Ctx_t::Brightness
uint32_t Brightness
Definition: otm8009a.h:62
OTM8009A_GetXSize
int32_t OTM8009A_GetXSize(OTM8009A_Object_t *pObj, uint32_t *Xsize)
Set the display Width.
Definition: otm8009a.c:631
OTM8009A_DisplayOn
int32_t OTM8009A_DisplayOn(OTM8009A_Object_t *pObj)
Set the display On.
Definition: otm8009a.c:527
OTM8009A_RegisterBusIO
int32_t OTM8009A_RegisterBusIO(OTM8009A_Object_t *pObj, OTM8009A_IO_t *pIO)
Register component IO bus.
Definition: otm8009a.c:127
otm8009a_ctx_t
Definition: otm8009a_reg.h:133
OTM8009A_IO_t::Address
uint16_t Address
Definition: otm8009a.h:67
OTM8009A_Object_t
Definition: otm8009a.h:73
OTM8009A_SetCursor
int32_t OTM8009A_SetCursor(OTM8009A_Object_t *pObj, uint32_t Xpos, uint32_t Ypos)
Set the display cursor.
Definition: otm8009a.c:686
OTM8009A_IO_t
Definition: otm8009a.h:65
OTM8009A_DrawHLine
int32_t OTM8009A_DrawHLine(OTM8009A_Object_t *pObj, uint32_t Xpos, uint32_t Ypos, uint32_t Length, uint32_t Color)
Draw Horizontal Line.
Definition: otm8009a.c:726
OTM8009A_GetBrightness
int32_t OTM8009A_GetBrightness(OTM8009A_Object_t *pObj, uint32_t *Brightness)
Get the display brightness.
Definition: otm8009a.c:516
OTM8009A_FillRGBRect
int32_t OTM8009A_FillRGBRect(OTM8009A_Object_t *pObj, uint32_t Xpos, uint32_t Ypos, uint8_t *pData, uint32_t Width, uint32_t Height)
Definition: otm8009a.c:710
OTM8009A_LCD_Drv_t
Definition: otm8009a.h:80
OTM8009A_Object_t::IsInitialized
uint8_t IsInitialized
Definition: otm8009a.h:77
OTM8009A_DisplayOff
int32_t OTM8009A_DisplayOff(OTM8009A_Object_t *pObj)
Set the display Off.
Definition: otm8009a.c:550
OTM8009A_LCD_Ctx_t::Orientation
uint32_t Orientation
Definition: otm8009a.h:60
otm8009a_reg.h
This file contains all the constants parameters for the OTM8009A.
OTM8009A_IO_t::GetTick
OTM8009A_GetTick_Func GetTick
Definition: otm8009a.h:70
OTM8009A_WriteReg_Func
int32_t(* OTM8009A_WriteReg_Func)(uint16_t, uint16_t, uint8_t *, uint16_t)
Definition: otm8009a.h:51
OTM8009A_ReadReg_Func
int32_t(* OTM8009A_ReadReg_Func)(uint16_t, uint16_t, uint8_t *, uint16_t)
Definition: otm8009a.h:52
OTM8009A_Object_t::IO
OTM8009A_IO_t IO
Definition: otm8009a.h:75
OTM8009A_IO_t::WriteReg
OTM8009A_WriteReg_Func WriteReg
Definition: otm8009a.h:68
OTM8009A_LCD_Driver
OTM8009A_LCD_Drv_t OTM8009A_LCD_Driver
Definition: otm8009a.c:42
OTM8009A_DeInit
int32_t OTM8009A_DeInit(OTM8009A_Object_t *pObj)
De-Initializes the component.
Definition: otm8009a.c:458
OTM8009A_Delay_Func
int32_t(* OTM8009A_Delay_Func)(uint32_t)
Definition: otm8009a.h:50


picovoice_driver
Author(s):
autogenerated on Fri Apr 1 2022 02:14:50