alexander | 3c79893 | 2021-03-26 21:42:19 +0000 | [diff] [blame] | 1 | /* |
| 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 Sisodia | 659fcd9 | 2021-05-19 10:30:06 +0100 | [diff] [blame] | 17 | #ifndef STUBS_SIMPLE_PLATFORM_H |
| 18 | #define STUBS_SIMPLE_PLATFORM_H |
alexander | 3c79893 | 2021-03-26 21:42:19 +0000 | [diff] [blame] | 19 | |
alexander | 3c79893 | 2021-03-26 21:42:19 +0000 | [diff] [blame] | 20 | /****************************************************************************/ |
| 21 | /* Definitions and stub functions for modules currently */ |
Kshitij Sisodia | 659fcd9 | 2021-05-19 10:30:06 +0100 | [diff] [blame] | 22 | /* unavailable on this target platform */ |
alexander | 3c79893 | 2021-03-26 21:42:19 +0000 | [diff] [blame] | 23 | /****************************************************************************/ |
| 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 | |
alexander | 3c79893 | 2021-03-26 21:42:19 +0000 | [diff] [blame] | 29 | /************************ GLCD related functions ****************************/ |
| 30 | /** |
| 31 | * @brief Initialize the Himax LCD with HX8347-D LCD Controller |
alexander | 3c79893 | 2021-03-26 21:42:19 +0000 | [diff] [blame] | 32 | */ |
| 33 | void 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. |
alexander | 3c79893 | 2021-03-26 21:42:19 +0000 | [diff] [blame] | 44 | */ |
| 45 | void 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. |
alexander | 3c79893 | 2021-03-26 21:42:19 +0000 | [diff] [blame] | 60 | */ |
alexander | 31ae9f0 | 2022-02-10 16:15:54 +0000 | [diff] [blame^] | 61 | void 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); |
alexander | 3c79893 | 2021-03-26 21:42:19 +0000 | [diff] [blame] | 65 | |
| 66 | /** |
| 67 | * @brief Clear display |
| 68 | * @param[in] color display clearing color |
alexander | 3c79893 | 2021-03-26 21:42:19 +0000 | [diff] [blame] | 69 | */ |
| 70 | void GLCD_Clear(unsigned short color); |
| 71 | |
| 72 | /** |
| 73 | * @brief Set foreground color |
| 74 | * @param[in] color foreground color |
alexander | 3c79893 | 2021-03-26 21:42:19 +0000 | [diff] [blame] | 75 | */ |
| 76 | void 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 |
alexander | 3c79893 | 2021-03-26 21:42:19 +0000 | [diff] [blame] | 84 | */ |
| 85 | void 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 |
alexander | 3c79893 | 2021-03-26 21:42:19 +0000 | [diff] [blame] | 94 | */ |
| 95 | void 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 |
alexander | 3c79893 | 2021-03-26 21:42:19 +0000 | [diff] [blame] | 105 | */ |
| 106 | void GLCD_Box(unsigned int x, unsigned int y, |
| 107 | unsigned int w, unsigned int h, |
| 108 | unsigned short color); |
| 109 | |
Kshitij Sisodia | 659fcd9 | 2021-05-19 10:30:06 +0100 | [diff] [blame] | 110 | #endif /* STUBS_SIMPLE_PLATFORM_H */ |