blob: 9977cd2277b403b5a0ca4dee957e6800acb92d42 [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
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 */
Kshitij Sisodia659fcd92021-05-19 10:30:06 +010025/* unavailable on this target platform */
alexander3c798932021-03-26 21:42:19 +000026/****************************************************************************/
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 *****************************/
33uint32_t GetCoreClock(void);
34
35/************************ GLCD related functions ****************************/
36/**
37 * @brief Initialize the Himax LCD with HX8347-D LCD Controller
alexander3c798932021-03-26 21:42:19 +000038 */
39void GLCD_Initialize(void);
40
41/**
42 * @brief Display graphical bitmap image at position x horizontally and y
43 * vertically. This function is optimized for 16 bits per pixel
44 * format, it has to be adapted for any other format.
45 * @param[in] x horizontal position.
46 * @param[in] y vertical position.
47 * @param[in] w width of bitmap.
48 * @param[in] h height of bitmap.
49 * @param[in] bitmap address at which the bitmap data resides.
alexander3c798932021-03-26 21:42:19 +000050 */
51void GLCD_Bitmap(unsigned int x, unsigned int y,
52 unsigned int w, unsigned int h,
53 unsigned short *bitmap);
54
55/**
56 * @brief Displays an 8 bit image, conversion to the LCD's
57 * 16 bit codec is done on the fly.
58 * @param[in] data pointer to the full sized image data.
59 * @param[in] width image width.
60 * @param[in] height image height.
61 * @param[in] channels number of channels in the image.
62 * @param[in] pos_x start x position for the LCD.
63 * @param[in] pos_y start y position for the LCD.
64 * @param[in] downsample_factor factor by which the image
65 * is downsampled by.
alexander3c798932021-03-26 21:42:19 +000066 */
67void GLCD_Image(void *data, const uint32_t width,
68 const uint32_t height, const uint32_t channels,
69 const uint32_t pos_x, const uint32_t pos_y,
70 const uint32_t downsample_factor);
71
72/**
73 * @brief Clear display
74 * @param[in] color display clearing color
alexander3c798932021-03-26 21:42:19 +000075 */
76void GLCD_Clear(unsigned short color);
77
78/**
79 * @brief Set foreground color
80 * @param[in] color foreground color
alexander3c798932021-03-26 21:42:19 +000081 */
82void GLCD_SetTextColor(unsigned short color);
83
84/**
85 * @brief Display character on given line
86 * @param[in] ln line number
87 * @param[in] col column number
88 * @param[in] fi font index (0 = 9x15)
89 * @param[in] c ASCII character
alexander3c798932021-03-26 21:42:19 +000090 */
91void GLCD_DisplayChar(unsigned int ln, unsigned int col,
92 unsigned char fi, unsigned char c);
93
94/**
95 * @brief Display string on given line
96 * @param[in] ln line number
97 * @param[in] col column number
98 * @param[in] fi font index (0 = 9x15)
99 * @param[in] s pointer to string
alexander3c798932021-03-26 21:42:19 +0000100 */
101void GLCD_DisplayString(unsigned int ln, unsigned int col,
102 unsigned char fi, char *s);
103
104/**
105 * @brief Draw box filled with color
106 * @param[in] x horizontal position
107 * @param[in] y: vertical position
108 * @param[in] w: window width in pixels
109 * @param[in] h: window height in pixels
110 * @param[in] color box color
alexander3c798932021-03-26 21:42:19 +0000111 */
112void GLCD_Box(unsigned int x, unsigned int y,
113 unsigned int w, unsigned int h,
114 unsigned short color);
115
Kshitij Sisodia659fcd92021-05-19 10:30:06 +0100116#endif /* STUBS_SIMPLE_PLATFORM_H */