libpynq  (release 5EID0-2023 version 0.3.0 of 2024-04-25 09:42 )
display.c
Go to the documentation of this file.
1 #include <display.h>
2 void display_init(display_t *display){};
3 void display_destroy(display_t *display){};
4 void displayDrawPixel(display_t *display, uint16_t x, uint16_t y,
5  uint16_t color){
6 #ifdef TRACE_DISPLAY
7 printf("dp %d %d %d\n",x,y,color);
8 #endif
9 };
10 void displayDrawFillRect(display_t *display, uint16_t x1, uint16_t y1,
11  uint16_t x2, uint16_t y2, uint16_t color){
12 #ifdef TRACE_DISPLAY
13 printf("dfr %d %d %d %d %d\n",x1,y1,x2,y2,color);
14 #endif
15 };
16 void displayFillScreen(display_t *display, uint16_t color){
17 };
18 void displayDrawLine(display_t *display, uint16_t x1, uint16_t y1, uint16_t x2,
19  uint16_t y2, uint16_t color){
20 #ifdef TRACE_DISPLAY
21 printf("dl %d %d %d %d %d\n",x1,y1,x2,y2,color);
22 #endif
23 };
24 void displayDrawRect(display_t *display, uint16_t x1, uint16_t y1, uint16_t x2,
25  uint16_t y2, uint16_t color){
26 #ifdef TRACE_DISPLAY
27 printf("dr %d %d %d %d %d\n",x1,y1,x2,y2,color);
28 #endif
29 };
30 void displayDrawRectAngle(display_t *display, uint16_t xc, uint16_t yc,
31  uint16_t w, uint16_t h, uint16_t angle,
32  uint16_t color){};
33 void displayDrawTriangleCenter(display_t *display, uint16_t xc, uint16_t yc,
34  uint16_t w, uint16_t h, uint16_t angle,
35  uint16_t color){};
36 void displayDrawCircle(display_t *display, uint16_t x_center, uint16_t y_center,
37  uint16_t r, uint16_t color){};
38 void displayDrawFillCircle(display_t *display, uint16_t x_center,
39  uint16_t y_center, uint16_t r, uint16_t color){};
40 void displayDrawRoundRect(display_t *display, uint16_t x1, uint16_t y1,
41  uint16_t x2, uint16_t y2, uint16_t r, uint16_t color){};
42 uint16_t rgb_conv(uint16_t r, uint16_t g, uint16_t b){};
43 int displayDrawChar(display_t *display, FontxFile *fx, uint16_t x, uint16_t y,
44  uint8_t ascii, uint16_t color){};
45 int displayDrawString(display_t *display, FontxFile *fx, uint16_t x, uint16_t y,
46  uint8_t *ascii, uint16_t color){};
47 void displaySetFontDirection(display_t *display, uint16_t dir){};
48 void displaySetFontFill(display_t *display, uint16_t color){};
50 void displaySetFontUnderLine(display_t *display, uint16_t color){};
52 void displayDisplayOff(display_t *display){};
53 void displayDisplayOn(display_t *display){};
54 void displayBacklightOff(display_t *display){};
55 void displayBacklightOn(display_t *display){};
56 void displayInversionOff(display_t *display){};
57 void displayInversionOn(display_t *display){};
58 void displayDrawTriangle(display_t *display, uint16_t x1, uint16_t y1,
59  uint16_t x2, uint16_t y2, uint16_t x3, uint16_t y3,
60  uint16_t color){};
61 void display_set_flip(display_t *display, bool xflip, bool yflip){};
display_t
Internal type, do not use. Type of display that stores parameters for usage in different functions.
Definition: display.h:116
displayDisplayOn
void displayDisplayOn(display_t *display)
Initialize DISPLAY screen.
Definition: display.c:413
displayBacklightOff
void displayBacklightOff(display_t *display)
Turn off the display backlight.
Definition: display.c:1017
displayInversionOn
void displayInversionOn(display_t *display)
Turn on inversion of the colors.
Definition: display.c:1042
displaySetFontFill
void displaySetFontFill(display_t *display, uint16_t color)
Enables the _font_fill and sets the _font_fill_color in the display handle.
Definition: display.c:992
displayDrawCircle
void displayDrawCircle(display_t *display, uint16_t x_center, uint16_t y_center, uint16_t r, uint16_t color)
Draw a circle without infill on the display.
Definition: display.c:624
displaySetFontDirection
void displaySetFontDirection(display_t *display, uint16_t dir)
Changes the direction the characters will be printed.
Definition: display.c:985
displayDrawRectAngle
void displayDrawRectAngle(display_t *display, uint16_t xc, uint16_t yc, uint16_t w, uint16_t h, uint16_t angle, uint16_t color)
Draws a rectangle with rounded corners at a specified angle on the display.
Definition: display.c:499
displayUnsetFontFill
void displayUnsetFontFill(display_t *display)
Sets the _font_fill parameter to false in the display handle, turns off the font fill.
Definition: display.c:1000
display_destroy
void display_destroy(display_t *display __attribute__((unused)))
Definition: display.c:309
displayUnsetFontUnderLine
void displayUnsetFontUnderLine(display_t *display)
Turns off _font_underline in the display handle.
Definition: display.c:1010
display_init
void display_init(display_t *display)
Initialize the display display.
Definition: display.c:301
rgb_conv
uint16_t rgb_conv(uint16_t r, uint16_t g, uint16_t b)
RGB conversion for generating a color.
Definition: display.c:781
displayInversionOff
void displayInversionOff(display_t *display)
Turn off inversion of the colors.
Definition: display.c:1035
displayBacklightOn
void displayBacklightOn(display_t *display)
Turn on the display backlight.
Definition: display.c:1026
displayDrawRect
void displayDrawRect(display_t *display, uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2, uint16_t color)
Draw a filled rectangle.
Definition: display.c:481
displayDrawTriangleCenter
void displayDrawTriangleCenter(display_t *display, uint16_t xc, uint16_t yc, uint16_t w, uint16_t h, uint16_t angle, uint16_t color)
Draws a triangle at a specified angle on the display.
Definition: display.c:583
display_set_flip
void display_set_flip(display_t *display, bool xflip, bool yflip)
Flip the drawing off the screen.
Definition: display.c:279
FontxFile
Struct representing a font file.
Definition: fontx.h:28
display.h
displayDrawLine
void displayDrawLine(display_t *display, uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2, uint16_t color)
Draw a line from two coordinates.
Definition: display.c:428
displayDisplayOff
void displayDisplayOff(display_t *display)
Turn off the display.
Definition: display.c:406
displayFillScreen
void displayFillScreen(display_t *display, uint16_t color)
Fill entire display with a single color using the ldcDrawFillRect function.
Definition: display.c:420
displaySetFontUnderLine
void displaySetFontUnderLine(display_t *display, uint16_t color)
Turns on _font_underline in the display handle and sets the _font_underline_color to the specified co...
Definition: display.c:1002
displayDrawTriangle
void displayDrawTriangle(display_t *display, uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2, uint16_t x3, uint16_t y3, uint16_t color)
Draw a triangle without infill between the three given points in the given color.
Definition: display.c:556
displayDrawRoundRect
void displayDrawRoundRect(display_t *display, uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2, uint16_t r, uint16_t color)
Draw a rectangle with rounded angles.
Definition: display.c:711
displayDrawFillRect
void displayDrawFillRect(display_t *display, uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2, uint16_t color)
Draw a filled rectangle to the display.
Definition: display.c:364
displayDrawPixel
void displayDrawPixel(display_t *display, uint16_t x, uint16_t y, uint16_t color)
Draw a single pixel to the display.
Definition: display.c:320
displayDrawFillCircle
void displayDrawFillCircle(display_t *display, uint16_t x_center, uint16_t y_center, uint16_t r, uint16_t color)
Draw a circle with infill on the display.
Definition: display.c:665
displayDrawChar
int displayDrawChar(display_t *display, FontxFile *fxs, uint16_t x, uint16_t y, uint8_t ascii, uint16_t color)
Draws a character on the given coordinates of the display.
Definition: display.c:785
displayDrawString
int displayDrawString(display_t *display, FontxFile *fx, uint16_t x, uint16_t y, uint8_t *ascii, uint16_t color)
Function to draw a string on the display.
Definition: display.c:954