Created
April 3, 2019 14:28
-
-
Save pklazy/e9df5be72305f178f6a2384ae1532793 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// SPDX-License-Identifier: GPL-2.0+ | |
#include <linux/module.h> | |
#include <linux/kernel.h> | |
#include <linux/init.h> | |
#include <video/mipi_display.h> | |
#include "fbtft.h" | |
#define DRVNAME "fb_st7789vw" | |
static const s16 default_init_sequence[] = { | |
-1, MIPI_DCS_SOFT_RESET, | |
-2, 150, | |
-1, MIPI_DCS_EXIT_SLEEP_MODE, | |
-2, 255, | |
-1, MIPI_DCS_SET_PIXEL_FORMAT, MIPI_DCS_PIXEL_FMT_16BIT, | |
-2, 10, | |
-1, MIPI_DCS_SET_ADDRESS_MODE, 0x00, | |
-1, MIPI_DCS_SET_COLUMN_ADDRESS, 0x00, 0x00, 0x00, 0xf0, | |
-1, MIPI_DCS_SET_PAGE_ADDRESS, 0x00, 0x50, 0x01, 0x40, | |
-1, MIPI_DCS_ENTER_INVERT_MODE, | |
-2, 10, | |
-1, MIPI_DCS_ENTER_NORMAL_MODE, | |
-2, 10, | |
-1, MIPI_DCS_SET_DISPLAY_ON, | |
-3 | |
}; | |
static struct fbtft_display display = { | |
.regwidth = 8, | |
.width = 240, | |
.height = 240, | |
.init_sequence = default_init_sequence, | |
}; | |
FBTFT_REGISTER_DRIVER(DRVNAME, "sitronix,st7789vw", &display); | |
MODULE_ALIAS("spi:" DRVNAME); | |
MODULE_LICENSE("GPL"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment