ST7789V TFT Controller (display-tft-st7789v)
TFT Display

General Description

APIs for controlling the TFT display on the board.

Data Structures

struct  mtb_st7789v_pins_t
 Configuration structure defining the pins used to communicate with the TFT display. More...
 

Functions

cy_rslt_t mtb_st7789v_init8 (const mtb_st7789v_pins_t *pins)
 Initializes GPIOs for the software i8080 8-bit interface. More...
 
void mtb_st7789v_write_reset_pin (bool value)
 Sets value of the display Reset pin. More...
 
void mtb_st7789v_write_command (uint8_t command)
 Writes one byte of data to the software i8080 interface with the LCD_DC pin set to 0. More...
 
void mtb_st7789v_write_data (uint8_t data)
 Writes one byte of data to the software i8080 interface with the LCD_DC pin set to 1. More...
 
void mtb_st7789v_write_command_stream (uint8_t *data, int num)
 Writes multiple command bytes to the software i8080 interface with the LCD_DC pin set to 0. More...
 
void mtb_st7789v_write_data_stream (uint8_t *data, int num)
 Writes multiple bytes of data to the software i8080 interface with the LCD_DC pin set to 1. More...
 
uint8_t mtb_st7789v_read_data (void)
 Reads one byte of data from the software i8080 interface with the LCD_DC pin set to 1. More...
 
void mtb_st7789v_read_data_stream (uint8_t *data, int num)
 Reads multiple bytes of data from the software i8080 interface with the LCD_DC pin set to 1. More...
 
void mtb_st7789v_free (void)
 Free all resources used for the software i8080 interface.
 

Data Structure Documentation

◆ mtb_st7789v_pins_t

struct mtb_st7789v_pins_t
Data Fields
cyhal_gpio_t db08 Pin for the Display Data8 signal.
cyhal_gpio_t db09 Pin for the Display Data9 signal.
cyhal_gpio_t db10 Pin for the Display Data10 signal.
cyhal_gpio_t db11 Pin for the Display Data11 signal.
cyhal_gpio_t db12 Pin for the Display Data12 signal.
cyhal_gpio_t db13 Pin for the Display Data13 signal.
cyhal_gpio_t db14 Pin for the Display Data14 signal.
cyhal_gpio_t db15 Pin for the Display Data15 signal.
cyhal_gpio_t nrd
cyhal_gpio_t nwr Pin for the Display Read signal.
cyhal_gpio_t dc Pin for the Display Write signal.
cyhal_gpio_t rst Pin for the Display D/C signal.

Function Documentation

◆ mtb_st7789v_init8()

cy_rslt_t mtb_st7789v_init8 ( const mtb_st7789v_pins_t pins)

Initializes GPIOs for the software i8080 8-bit interface.

Parameters
[in]pinsStructure providing the pins to use for the display
Returns
CY_RSLT_SUCCESS if successfully initialized, else an error about what went wrong

◆ mtb_st7789v_write_reset_pin()

void mtb_st7789v_write_reset_pin ( bool  value)

Sets value of the display Reset pin.

Parameters
[in]valueThe value to set on the pin

◆ mtb_st7789v_write_command()

void mtb_st7789v_write_command ( uint8_t  command)

Writes one byte of data to the software i8080 interface with the LCD_DC pin set to 0.

Followed by a low pulse on the NWR line to complete the write.

Parameters
[in]commandThe command to issue to the display

◆ mtb_st7789v_write_data()

void mtb_st7789v_write_data ( uint8_t  data)

Writes one byte of data to the software i8080 interface with the LCD_DC pin set to 1.

Followed by a low pulse on the NWR line to complete the write.

Parameters
[in]dataThe value to issue to the display

◆ mtb_st7789v_write_command_stream()

void mtb_st7789v_write_command_stream ( uint8_t *  data,
int  num 
)

Writes multiple command bytes to the software i8080 interface with the LCD_DC pin set to 0.

Parameters
[in]dataPointer to the commands to send to the display
[in]numThe number of commands in the data array to send to the display

◆ mtb_st7789v_write_data_stream()

void mtb_st7789v_write_data_stream ( uint8_t *  data,
int  num 
)

Writes multiple bytes of data to the software i8080 interface with the LCD_DC pin set to 1.

Parameters
[in]dataPointer to the data to send to the display
[in]numThe number of bytes in the data array to send to the display

◆ mtb_st7789v_read_data()

uint8_t mtb_st7789v_read_data ( void  )

Reads one byte of data from the software i8080 interface with the LCD_DC pin set to 1.

Returns
The byte read from the display

◆ mtb_st7789v_read_data_stream()

void mtb_st7789v_read_data_stream ( uint8_t *  data,
int  num 
)

Reads multiple bytes of data from the software i8080 interface with the LCD_DC pin set to 1.

Parameters
[in,out]dataPointer to where to store the bytes read from the display
[in]numThe number of bytes to read from the display