blob: 5915f7d280281269cb8ca9f24210d4304c95d2f3 [file] [log] [blame]
alexander3c798932021-03-26 21:42:19 +00001/*
2 * Copyright (c) 2021 Arm Limited. All rights reserved.
3 * SPDX-License-Identifier: Apache-2.0
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
Kshitij Sisodia659fcd92021-05-19 10:30:06 +010017#ifndef STUBS_SIMPLE_PLATFORM_H
18#define STUBS_SIMPLE_PLATFORM_H
alexander3c798932021-03-26 21:42:19 +000019
alexander3c798932021-03-26 21:42:19 +000020/****************************************************************************/
21/* Definitions and stub functions for modules currently */
Kshitij Sisodia659fcd92021-05-19 10:30:06 +010022/* unavailable on this target platform */
alexander3c798932021-03-26 21:42:19 +000023/****************************************************************************/
24#define GLCD_WIDTH 320
25#define GLCD_HEIGHT 240
26#define Black 0x0000 /* 0, 0, 0 */
27#define White 0xFFFF /* 255, 255, 255 */
28
alexander3c798932021-03-26 21:42:19 +000029/************************ GLCD related functions ****************************/
30/**
31 * @brief Initialize the Himax LCD with HX8347-D LCD Controller
alexander3c798932021-03-26 21:42:19 +000032 */
33void GLCD_Initialize(void);
34
35/**
36 * @brief Display graphical bitmap image at position x horizontally and y
37 * vertically. This function is optimized for 16 bits per pixel
38 * format, it has to be adapted for any other format.
39 * @param[in] x horizontal position.
40 * @param[in] y vertical position.
41 * @param[in] w width of bitmap.
42 * @param[in] h height of bitmap.
43 * @param[in] bitmap address at which the bitmap data resides.
alexander3c798932021-03-26 21:42:19 +000044 */
45void GLCD_Bitmap(unsigned int x, unsigned int y,
46 unsigned int w, unsigned int h,
47 unsigned short *bitmap);
48
49/**
50 * @brief Displays an 8 bit image, conversion to the LCD's
51 * 16 bit codec is done on the fly.
52 * @param[in] data pointer to the full sized image data.
53 * @param[in] width image width.
54 * @param[in] height image height.
55 * @param[in] channels number of channels in the image.
56 * @param[in] pos_x start x position for the LCD.
57 * @param[in] pos_y start y position for the LCD.
58 * @param[in] downsample_factor factor by which the image
59 * is downsampled by.
alexander3c798932021-03-26 21:42:19 +000060 */
alexander31ae9f02022-02-10 16:15:54 +000061void GLCD_Image(void *data, const unsigned int width,
62 const unsigned int height, const unsigned int channels,
63 const unsigned int pos_x, const unsigned int pos_y,
64 const unsigned int downsample_factor);
alexander3c798932021-03-26 21:42:19 +000065
66/**
67 * @brief Clear display
68 * @param[in] color display clearing color
alexander3c798932021-03-26 21:42:19 +000069 */
70void GLCD_Clear(unsigned short color);
71
72/**
73 * @brief Set foreground color
74 * @param[in] color foreground color
alexander3c798932021-03-26 21:42:19 +000075 */
76void GLCD_SetTextColor(unsigned short color);
77
78/**
79 * @brief Display character on given line
80 * @param[in] ln line number
81 * @param[in] col column number
82 * @param[in] fi font index (0 = 9x15)
83 * @param[in] c ASCII character
alexander3c798932021-03-26 21:42:19 +000084 */
85void GLCD_DisplayChar(unsigned int ln, unsigned int col,
86 unsigned char fi, unsigned char c);
87
88/**
89 * @brief Display string on given line
90 * @param[in] ln line number
91 * @param[in] col column number
92 * @param[in] fi font index (0 = 9x15)
93 * @param[in] s pointer to string
alexander3c798932021-03-26 21:42:19 +000094 */
95void GLCD_DisplayString(unsigned int ln, unsigned int col,
96 unsigned char fi, char *s);
97
98/**
99 * @brief Draw box filled with color
100 * @param[in] x horizontal position
101 * @param[in] y: vertical position
102 * @param[in] w: window width in pixels
103 * @param[in] h: window height in pixels
104 * @param[in] color box color
alexander3c798932021-03-26 21:42:19 +0000105 */
106void GLCD_Box(unsigned int x, unsigned int y,
107 unsigned int w, unsigned int h,
108 unsigned short color);
109
Kshitij Sisodia659fcd92021-05-19 10:30:06 +0100110#endif /* STUBS_SIMPLE_PLATFORM_H */