blob: b31938fd6476b460e37f9b7ec15d451a523099fa [file] [log] [blame]
alexander3c798932021-03-26 21:42:19 +00001/*
Kshitij Sisodiaa1256e32022-02-23 14:40:45 +00002 * Copyright (c) 2021-2022 Arm Limited. All rights reserved.
alexander3c798932021-03-26 21:42:19 +00003 * 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
Kshitij Sisodiaa1256e32022-02-23 14:40:45 +000020#include <stdint.h>
21
alexander3c798932021-03-26 21:42:19 +000022/****************************************************************************/
23/* Definitions and stub functions for modules currently */
Kshitij Sisodia659fcd92021-05-19 10:30:06 +010024/* unavailable on this target platform */
alexander3c798932021-03-26 21:42:19 +000025/****************************************************************************/
26#define GLCD_WIDTH 320
27#define GLCD_HEIGHT 240
28#define Black 0x0000 /* 0, 0, 0 */
29#define White 0xFFFF /* 255, 255, 255 */
30
alexander3c798932021-03-26 21:42:19 +000031/************************ GLCD related functions ****************************/
32/**
33 * @brief Initialize the Himax LCD with HX8347-D LCD Controller
alexander3c798932021-03-26 21:42:19 +000034 */
35void GLCD_Initialize(void);
36
37/**
38 * @brief Display graphical bitmap image at position x horizontally and y
39 * vertically. This function is optimized for 16 bits per pixel
40 * format, it has to be adapted for any other format.
41 * @param[in] x horizontal position.
42 * @param[in] y vertical position.
43 * @param[in] w width of bitmap.
44 * @param[in] h height of bitmap.
45 * @param[in] bitmap address at which the bitmap data resides.
alexander3c798932021-03-26 21:42:19 +000046 */
47void GLCD_Bitmap(unsigned int x, unsigned int y,
48 unsigned int w, unsigned int h,
49 unsigned short *bitmap);
50
51/**
52 * @brief Displays an 8 bit image, conversion to the LCD's
53 * 16 bit codec is done on the fly.
54 * @param[in] data pointer to the full sized image data.
55 * @param[in] width image width.
56 * @param[in] height image height.
57 * @param[in] channels number of channels in the image.
58 * @param[in] pos_x start x position for the LCD.
59 * @param[in] pos_y start y position for the LCD.
60 * @param[in] downsample_factor factor by which the image
61 * is downsampled by.
alexander3c798932021-03-26 21:42:19 +000062 */
Kshitij Sisodiaa1256e32022-02-23 14:40:45 +000063void GLCD_Image(const void *data, const uint32_t width,
64 const uint32_t height, const uint32_t channels,
65 const uint32_t pos_x, const uint32_t pos_y,
66 const uint32_t downsample_factor);
alexander3c798932021-03-26 21:42:19 +000067
68/**
69 * @brief Clear display
70 * @param[in] color display clearing color
alexander3c798932021-03-26 21:42:19 +000071 */
72void GLCD_Clear(unsigned short color);
73
74/**
75 * @brief Set foreground color
76 * @param[in] color foreground color
alexander3c798932021-03-26 21:42:19 +000077 */
78void GLCD_SetTextColor(unsigned short color);
79
80/**
81 * @brief Display character on given line
82 * @param[in] ln line number
83 * @param[in] col column number
84 * @param[in] fi font index (0 = 9x15)
85 * @param[in] c ASCII character
alexander3c798932021-03-26 21:42:19 +000086 */
87void GLCD_DisplayChar(unsigned int ln, unsigned int col,
88 unsigned char fi, unsigned char c);
89
90/**
91 * @brief Display string on given line
92 * @param[in] ln line number
93 * @param[in] col column number
94 * @param[in] fi font index (0 = 9x15)
95 * @param[in] s pointer to string
alexander3c798932021-03-26 21:42:19 +000096 */
97void GLCD_DisplayString(unsigned int ln, unsigned int col,
98 unsigned char fi, char *s);
99
100/**
101 * @brief Draw box filled with color
102 * @param[in] x horizontal position
103 * @param[in] y: vertical position
104 * @param[in] w: window width in pixels
105 * @param[in] h: window height in pixels
106 * @param[in] color box color
alexander3c798932021-03-26 21:42:19 +0000107 */
108void GLCD_Box(unsigned int x, unsigned int y,
109 unsigned int w, unsigned int h,
110 unsigned short color);
111
Kshitij Sisodia659fcd92021-05-19 10:30:06 +0100112#endif /* STUBS_SIMPLE_PLATFORM_H */