libpynq (release 5EWC0-2023 version 0.2.2 of 2023-09-24 22:22)
Loading...
Searching...
No Matches
display.c File Reference
#include <arm_shared_memory_system.h>
#include <display.h>
#include <gpio.h>
#include <lcdconfig.h>
#include <log.h>
#include <math.h>
#include <platform.h>
#include <string.h>
#include <switchbox.h>
#include <unistd.h>
#include <util.h>
Include dependency graph for display.c:

Go to the source code of this file.

Macros

#define LOG_DOMAIN   "display"
 
#define TAG   "ST7789"
 
#define _DEBUG_   0
 
#define M_PI   3.14159265358979323846
 
#define GPIO_MODE_OUTPUT   1
 

Enumerations

enum  spi_mode_t { SPI_Data_Mode = 1 , SPI_Command_Mode = 0 }
 

Functions

gpio_level_t spi_to_gpio (spi_mode_t mode)
 
bool spi_master_write_command (display_t *display, uint8_t cmd)
 
bool spi_master_write_data_byte (display_t *display, uint8_t data)
 
bool spi_master_write_data_word (display_t *display, uint16_t data)
 
bool spi_master_write_addr (display_t *display, uint16_t addr1, uint16_t addr2)
 
bool spi_master_write_color (display_t *display, uint16_t color, uint16_t size)
 
bool spi_master_write_colors (display_t *display, uint16_t *colors, uint16_t size)
 
void spi_master_init (display_t *display)
 
void displayInit (display_t *display, int width, int height, int offsetx, int offsety)
 
void display_set_flip (display_t *display, bool xflip, bool yflip)
 
void display_init (display_t *display)
 
void display_destroy (display_t *display __attribute__((unused)))
 
void displayDrawPixel (display_t *display, uint16_t x, uint16_t y, uint16_t color)
 
void displayDrawMultiPixels (display_t *display, uint16_t x, uint16_t y, uint16_t size, uint16_t *colors)
 
void displayDrawFillRect (display_t *display, uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2, uint16_t color)
 
void displayDisplayOff (display_t *display)
 
void displayDisplayOn (display_t *display)
 
void displayFillScreen (display_t *display, uint16_t color)
 
void displayDrawLine (display_t *display, uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2, uint16_t color)
 
void displayDrawRect (display_t *display, uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2, uint16_t color)
 
void displayDrawRectAngle (display_t *display, uint16_t xc, uint16_t yc, uint16_t w, uint16_t h, uint16_t angle, uint16_t color)
 
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)
 
void displayDrawTriangleCenter (display_t *display, uint16_t xc, uint16_t yc, uint16_t w, uint16_t h, uint16_t angle, uint16_t color)
 
void displayDrawCircle (display_t *display, uint16_t x_center, uint16_t y_center, uint16_t r, uint16_t color)
 
void displayDrawFillCircle (display_t *display, uint16_t x_center, uint16_t y_center, uint16_t r, uint16_t color)
 
void displayDrawRoundRect (display_t *display, uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2, uint16_t r, uint16_t color)
 
uint16_t rgb_conv (uint16_t r, uint16_t g, uint16_t b)
 
int displayDrawChar (display_t *display, FontxFile *fxs, uint16_t x, uint16_t y, uint8_t ascii, uint16_t color)
 
int displayDrawString (display_t *display, FontxFile *fx, uint16_t x, uint16_t y, uint8_t *ascii, uint16_t color)
 
void displaySetFontDirection (display_t *display, uint16_t dir)
 
void displaySetFontFill (display_t *display, uint16_t color)
 
void displayUnsetFontFill (display_t *display)
 
void displaySetFontUnderLine (display_t *display, uint16_t color)
 
void displayUnsetFontUnderLine (display_t *display)
 
void displayBacklightOff (display_t *display)
 
void displayBacklightOn (display_t *display)
 
void displayInversionOff (display_t *display)
 
void displayInversionOn (display_t *display)
 

Macro Definition Documentation

◆ _DEBUG_

#define _DEBUG_   0

Definition at line 38 of file display.c.

◆ GPIO_MODE_OUTPUT

#define GPIO_MODE_OUTPUT   1

Definition at line 48 of file display.c.

◆ LOG_DOMAIN

#define LOG_DOMAIN   "display"

Definition at line 35 of file display.c.

◆ M_PI

#define M_PI   3.14159265358979323846

Definition at line 40 of file display.c.

◆ TAG

#define TAG   "ST7789"

Definition at line 37 of file display.c.

Enumeration Type Documentation

◆ spi_mode_t

enum spi_mode_t
Enumerator
SPI_Data_Mode 
SPI_Command_Mode 

Definition at line 46 of file display.c.

Function Documentation

◆ display_destroy()

void display_destroy ( display_t *display   __attribute__(unused))

Definition at line 302 of file display.c.

Here is the call graph for this function:

◆ displayDrawMultiPixels()

void displayDrawMultiPixels ( display_t display,
uint16_t  x,
uint16_t  y,
uint16_t  size,
uint16_t *  colors 
)

Definition at line 332 of file display.c.

Here is the call graph for this function:

◆ displayInit()

void displayInit ( display_t display,
int  width,
int  height,
int  offsetx,
int  offsety 
)

Definition at line 225 of file display.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ spi_master_init()

void spi_master_init ( display_t display)

Definition at line 144 of file display.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ spi_master_write_addr()

bool spi_master_write_addr ( display_t display,
uint16_t  addr1,
uint16_t  addr2 
)

Definition at line 92 of file display.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ spi_master_write_color()

bool spi_master_write_color ( display_t display,
uint16_t  color,
uint16_t  size 
)

Definition at line 111 of file display.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ spi_master_write_colors()

bool spi_master_write_colors ( display_t display,
uint16_t *  colors,
uint16_t  size 
)

Definition at line 126 of file display.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ spi_master_write_command()

bool spi_master_write_command ( display_t display,
uint8_t  cmd 
)

Definition at line 61 of file display.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ spi_master_write_data_byte()

bool spi_master_write_data_byte ( display_t display,
uint8_t  data 
)

Definition at line 70 of file display.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ spi_master_write_data_word()

bool spi_master_write_data_word ( display_t display,
uint16_t  data 
)

Definition at line 79 of file display.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ spi_to_gpio()

gpio_level_t spi_to_gpio ( spi_mode_t  mode)

Definition at line 50 of file display.c.

Here is the caller graph for this function: