Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 37 additions & 4 deletions ST7789/st7789.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
extern SPI_HandleTypeDef ST7789_SPI_PORT;

/* choose whether use DMA or not */
#define USE_DMA
#define USE_DMA

/* If u need CS control, comment below*/
//#define CFG_NO_CS
Expand Down Expand Up @@ -39,13 +39,14 @@ extern SPI_HandleTypeDef ST7789_SPI_PORT;

/* Choose a type you are using */
//#define USING_135X240
#define USING_240X240
//#define USING_240X240
//#define USING_170X320
#define USING_320X480

/* Choose a display rotation you want to use: (0-3) */
//#define ST7789_ROTATION 0
//#define ST7789_ROTATION 1
#define ST7789_ROTATION 2 // use Normally on 240x240
#define ST7789_ROTATION 1
//#define ST7789_ROTATION 2 // use Normally on 240x240
//#define ST7789_ROTATION 3

#ifdef USING_135X240
Expand Down Expand Up @@ -133,6 +134,38 @@ extern SPI_HandleTypeDef ST7789_SPI_PORT;

#endif

#ifdef USING_320X480

#if ST7789_ROTATION == 0
#define ST7789_WIDTH 320
#define ST7789_HEIGHT 420
#define X_SHIFT 0
#define Y_SHIFT 0
#endif

#if ST7789_ROTATION == 1
#define ST7789_WIDTH 320
#define ST7789_HEIGHT 420
#define X_SHIFT 0
#define Y_SHIFT 0
#endif

#if ST7789_ROTATION == 2
#define ST7789_WIDTH 320
#define ST7789_HEIGHT 420
#define X_SHIFT 0
#define Y_SHIFT 0
#endif

#if ST7789_ROTATION == 3
#define ST7789_WIDTH 320
#define ST7789_HEIGHT 170
#define X_SHIFT 0
#define Y_SHIFT 0
#endif

#endif

/**
*Color of pen
*If you want to use another color, you can choose one in RGB565 format.
Expand Down