Prusa MINI Firmware overview
st7789v.h
Go to the documentation of this file.
1 //st7789v.h
2 #ifndef _ST7789V_H
3 #define _ST7789V_H
4 
5 #include "display.h"
6 #include "stm32f4xx_hal.h"
7 
8 //public flags (config)
9 #define ST7789V_FLG_DMA 0x08 // DMA enabled
10 #define ST7789V_FLG_MISO 0x10 // MISO enabled
11 #define ST7789V_FLG_SAFE 0x20 // SAFE mode (no DMA and safe delay)
12 
13 #define ST7789V_DEF_COLMOD 0x05 // interface pixel format (5-6-5, hi-color)
14 #define ST7789V_DEF_MADCTL 0xC0 // memory data access control (mirror XY)
15 
16 #pragma pack(push)
17 #pragma pack(1)
18 
19 typedef struct _st7789v_config_t {
20  SPI_HandleTypeDef *phspi; // spi handle pointer
21  uint8_t pinCS; // CS pin
22  uint8_t pinRS; // RS pin
23  uint8_t pinRST; // RST pin
24  uint8_t flg; // flags (DMA, MISO)
25  uint8_t colmod; // interface pixel format
26  uint8_t madctl; // memory data access control
27 
33 
34 #pragma pack(pop)
35 
36 #ifdef __cplusplus
37 extern "C" {
38 #endif //__cplusplus
39 
40 extern void st7789v_inversion_on(void);
41 extern void st7789v_inversion_off(void);
42 extern void st7789v_inversion_tgl(void);
43 extern uint8_t st7789v_inversion_get(void);
44 
45 extern void st7789v_gamma_next(void);
46 extern void st7789v_gamma_prev(void);
47 extern void st7789v_gamma_set(uint8_t gamma);
48 extern uint8_t st7789v_gamma_get(void);
49 
50 extern void st7789v_brightness_set(uint8_t brightness);
51 extern uint8_t st7789v_brightness_get(void);
52 
53 extern void st7789v_brightness_enable(void);
54 extern void st7789v_brightness_disable(void);
55 
57 extern void st7789v_set_pixel_directColor(point_ui16_t pt, uint16_t noClr);
59 
60 extern const display_t st7789v_display;
61 
63 
64 extern uint16_t st7789v_reset_delay;
65 
66 extern void st7789v_enable_safe_mode(void);
67 
68 extern void st7789v_spi_tx_complete(void);
69 
70 #ifdef __cplusplus
71 }
72 #endif //__cplusplus
73 
74 #endif // _ST7789V_H
st7789v_spi_tx_complete
void st7789v_spi_tx_complete(void)
Definition: st7789v.c:927
st7789v_set_pixel_directColor
void st7789v_set_pixel_directColor(point_ui16_t pt, uint16_t noClr)
Definition: st7789v.c:383
st7789v_gamma_set
void st7789v_gamma_set(uint8_t gamma)
st7789v_inversion_get
uint8_t st7789v_inversion_get(void)
st7789v_brightness_disable
void st7789v_brightness_disable(void)
__SPI_HandleTypeDef
SPI handle Structure definition.
Definition: stm32f4xx_hal_spi.h:120
_st7789v_config_t::phspi
SPI_HandleTypeDef * phspi
Definition: st7789v.h:20
_st7789v_config_t
Definition: st7789v.h:19
_st7789v_config_t::gamma
uint8_t gamma
Definition: st7789v.h:28
st7789v_gamma_prev
void st7789v_gamma_prev(void)
_st7789v_config_t::control
uint8_t control
Definition: st7789v.h:31
_st7789v_config_t::colmod
uint8_t colmod
Definition: st7789v.h:25
_st7789v_config_t::pinCS
uint8_t pinCS
Definition: st7789v.h:21
st7789v_get_pixel_directColor
uint16_t st7789v_get_pixel_directColor(point_ui16_t pt)
Definition: st7789v.c:422
_st7789v_config_t::pinRS
uint8_t pinRS
Definition: st7789v.h:22
_point_ui16_t
Definition: guitypes.h:64
_display_t
Definition: display.h:24
st7789v_get_pixel
color_t st7789v_get_pixel(point_ui16_t pt)
Definition: st7789v.c:373
_st7789v_config_t::madctl
uint8_t madctl
Definition: st7789v.h:26
_st7789v_config_t::brightness
uint8_t brightness
Definition: st7789v.h:29
st7789v_enable_safe_mode
void st7789v_enable_safe_mode(void)
enable safe mode (direct acces + safe delay)
Definition: st7789v.c:923
_st7789v_config_t::pinRST
uint8_t pinRST
Definition: st7789v.h:23
st7789v_inversion_on
void st7789v_inversion_on(void)
st7789v_brightness_get
uint8_t st7789v_brightness_get(void)
uint8_t
const uint8_t[]
Definition: 404_html.c:3
display.h
stm32f4xx_hal.h
This file contains all the functions prototypes for the HAL module driver.
st7789v_gamma_get
uint8_t st7789v_gamma_get(void)
color_t
uint32_t color_t
Definition: guitypes.h:62
st7789v_brightness_set
void st7789v_brightness_set(uint8_t brightness)
st7789v_config_t
struct _st7789v_config_t st7789v_config_t
st7789v_reset_delay
uint16_t st7789v_reset_delay
Definition: st7789v.c:920
_st7789v_config_t::is_inverted
uint8_t is_inverted
Definition: st7789v.h:30
_st7789v_config_t::flg
uint8_t flg
Definition: st7789v.h:24
st7789v_inversion_off
void st7789v_inversion_off(void)
st7789v_gamma_next
void st7789v_gamma_next(void)
st7789v_display
const display_t st7789v_display
Definition: st7789v.c:889
st7789v_config
st7789v_config_t st7789v_config
Definition: st7789v.c:905
st7789v_brightness_enable
void st7789v_brightness_enable(void)
st7789v_inversion_tgl
void st7789v_inversion_tgl(void)