alexander | 3c79893 | 2021-03-26 21:42:19 +0000 | [diff] [blame] | 1 | /* |
Kshitij Sisodia | a1256e3 | 2022-02-23 14:40:45 +0000 | [diff] [blame^] | 2 | * Copyright (c) 2021-2022 Arm Limited. All rights reserved. |
alexander | 3c79893 | 2021-03-26 21:42:19 +0000 | [diff] [blame] | 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 | |
Kshitij Sisodia | a1256e3 | 2022-02-23 14:40:45 +0000 | [diff] [blame^] | 20 | #include <stdint.h> |
| 21 | |
alexander | 3c79893 | 2021-03-26 21:42:19 +0000 | [diff] [blame] | 22 | /****************************************************************************/ |
| 23 | /* Definitions and stub functions for modules currently */ |
Kshitij Sisodia | 659fcd9 | 2021-05-19 10:30:06 +0100 | [diff] [blame] | 24 | /* unavailable on this target platform */ |
alexander | 3c79893 | 2021-03-26 21:42:19 +0000 | [diff] [blame] | 25 | /****************************************************************************/ |
| 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 | |
alexander | 3c79893 | 2021-03-26 21:42:19 +0000 | [diff] [blame] | 31 | /************************ GLCD related functions ****************************/ |
| 32 | /** |
| 33 | * @brief Initialize the Himax LCD with HX8347-D LCD Controller |
alexander | 3c79893 | 2021-03-26 21:42:19 +0000 | [diff] [blame] | 34 | */ |
| 35 | void 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. |
alexander | 3c79893 | 2021-03-26 21:42:19 +0000 | [diff] [blame] | 46 | */ |
| 47 | void 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. |
alexander | 3c79893 | 2021-03-26 21:42:19 +0000 | [diff] [blame] | 62 | */ |
Kshitij Sisodia | a1256e3 | 2022-02-23 14:40:45 +0000 | [diff] [blame^] | 63 | void 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); |
alexander | 3c79893 | 2021-03-26 21:42:19 +0000 | [diff] [blame] | 67 | |
| 68 | /** |
| 69 | * @brief Clear display |
| 70 | * @param[in] color display clearing color |
alexander | 3c79893 | 2021-03-26 21:42:19 +0000 | [diff] [blame] | 71 | */ |
| 72 | void GLCD_Clear(unsigned short color); |
| 73 | |
| 74 | /** |
| 75 | * @brief Set foreground color |
| 76 | * @param[in] color foreground color |
alexander | 3c79893 | 2021-03-26 21:42:19 +0000 | [diff] [blame] | 77 | */ |
| 78 | void 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 |
alexander | 3c79893 | 2021-03-26 21:42:19 +0000 | [diff] [blame] | 86 | */ |
| 87 | void 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 |
alexander | 3c79893 | 2021-03-26 21:42:19 +0000 | [diff] [blame] | 96 | */ |
| 97 | void 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 |
alexander | 3c79893 | 2021-03-26 21:42:19 +0000 | [diff] [blame] | 107 | */ |
| 108 | void GLCD_Box(unsigned int x, unsigned int y, |
| 109 | unsigned int w, unsigned int h, |
| 110 | unsigned short color); |
| 111 | |
Kshitij Sisodia | 659fcd9 | 2021-05-19 10:30:06 +0100 | [diff] [blame] | 112 | #endif /* STUBS_SIMPLE_PLATFORM_H */ |