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 | */ |
| 17 | #ifndef BSP_PACK_FASTMODEL_H |
| 18 | #define BSP_PACK_FASTMODEL_H |
| 19 | |
| 20 | #include "cmsis.h" /* device specific header file */ |
| 21 | #include "peripheral_memmap.h" /* peripheral memory map definitions */ |
| 22 | |
| 23 | /****************************************************************************/ |
| 24 | /* Definitions and stub functions for modules currently */ |
| 25 | /* unavailable on the model */ |
| 26 | /****************************************************************************/ |
| 27 | #define GLCD_WIDTH 320 |
| 28 | #define GLCD_HEIGHT 240 |
| 29 | #define Black 0x0000 /* 0, 0, 0 */ |
| 30 | #define White 0xFFFF /* 255, 255, 255 */ |
| 31 | |
| 32 | /*********************** Clock related functions *****************************/ |
| 33 | uint32_t GetCoreClock(void); |
| 34 | |
| 35 | /************************ GLCD related functions ****************************/ |
| 36 | /** |
| 37 | * @brief Initialize the Himax LCD with HX8347-D LCD Controller |
| 38 | * @return none |
| 39 | */ |
| 40 | void GLCD_Initialize(void); |
| 41 | |
| 42 | /** |
| 43 | * @brief Display graphical bitmap image at position x horizontally and y |
| 44 | * vertically. This function is optimized for 16 bits per pixel |
| 45 | * format, it has to be adapted for any other format. |
| 46 | * @param[in] x horizontal position. |
| 47 | * @param[in] y vertical position. |
| 48 | * @param[in] w width of bitmap. |
| 49 | * @param[in] h height of bitmap. |
| 50 | * @param[in] bitmap address at which the bitmap data resides. |
| 51 | * @return none |
| 52 | */ |
| 53 | void GLCD_Bitmap(unsigned int x, unsigned int y, |
| 54 | unsigned int w, unsigned int h, |
| 55 | unsigned short *bitmap); |
| 56 | |
| 57 | /** |
| 58 | * @brief Displays an 8 bit image, conversion to the LCD's |
| 59 | * 16 bit codec is done on the fly. |
| 60 | * @param[in] data pointer to the full sized image data. |
| 61 | * @param[in] width image width. |
| 62 | * @param[in] height image height. |
| 63 | * @param[in] channels number of channels in the image. |
| 64 | * @param[in] pos_x start x position for the LCD. |
| 65 | * @param[in] pos_y start y position for the LCD. |
| 66 | * @param[in] downsample_factor factor by which the image |
| 67 | * is downsampled by. |
| 68 | * @return none |
| 69 | */ |
| 70 | void GLCD_Image(void *data, const uint32_t width, |
| 71 | const uint32_t height, const uint32_t channels, |
| 72 | const uint32_t pos_x, const uint32_t pos_y, |
| 73 | const uint32_t downsample_factor); |
| 74 | |
| 75 | /** |
| 76 | * @brief Clear display |
| 77 | * @param[in] color display clearing color |
| 78 | * @return none |
| 79 | */ |
| 80 | void GLCD_Clear(unsigned short color); |
| 81 | |
| 82 | /** |
| 83 | * @brief Set foreground color |
| 84 | * @param[in] color foreground color |
| 85 | * @return none |
| 86 | */ |
| 87 | void GLCD_SetTextColor(unsigned short color); |
| 88 | |
| 89 | /** |
| 90 | * @brief Display character on given line |
| 91 | * @param[in] ln line number |
| 92 | * @param[in] col column number |
| 93 | * @param[in] fi font index (0 = 9x15) |
| 94 | * @param[in] c ASCII character |
| 95 | * @return none |
| 96 | */ |
| 97 | void GLCD_DisplayChar(unsigned int ln, unsigned int col, |
| 98 | unsigned char fi, unsigned char c); |
| 99 | |
| 100 | /** |
| 101 | * @brief Display string on given line |
| 102 | * @param[in] ln line number |
| 103 | * @param[in] col column number |
| 104 | * @param[in] fi font index (0 = 9x15) |
| 105 | * @param[in] s pointer to string |
| 106 | * @return none |
| 107 | */ |
| 108 | void GLCD_DisplayString(unsigned int ln, unsigned int col, |
| 109 | unsigned char fi, char *s); |
| 110 | |
| 111 | /** |
| 112 | * @brief Draw box filled with color |
| 113 | * @param[in] x horizontal position |
| 114 | * @param[in] y: vertical position |
| 115 | * @param[in] w: window width in pixels |
| 116 | * @param[in] h: window height in pixels |
| 117 | * @param[in] color box color |
| 118 | * @return none |
| 119 | */ |
| 120 | void GLCD_Box(unsigned int x, unsigned int y, |
| 121 | unsigned int w, unsigned int h, |
| 122 | unsigned short color); |
| 123 | |
| 124 | #endif /* BSP_PACK_FASTMODEL_H */ |