|
本帖最后由 LHY666999 于 2025-1-6 20:46 编辑
当前/dev/fb1已经存在,但是屏幕处于三分之二亮三分之一不亮的状态,然后命令行输入cat /dev/urandom > /dev/fb1进行测试,发现右侧花屏可以根据每次命令行的输入依次刷新,感觉连线应该是对了,但是还有问题,求大佬们指点
贴一下驱动代码:
ili9488.c
// SPDX-License-Identifier: GPL-2.0+
/*
* FB driver for the ILI9488 LCD Controller
*
* Copyright (C) 2014 Noralf Tronnes
*/
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/init.h>
#include <video/mipi_display.h>
#include "fbtft.h"
#define DRVNAME "fb_ili9488"
#define WIDTH 320
#define HEIGHT 480
/* this init sequence matches PiScreen */
static const s16 default_init_sequence[] = {
-1, 0x01, /* Software Reset */
-1, 0xF7, 0xA9, 0x51, 0x2C, 0x82, /* Power Control 1 */
-1, 0xC0, 0x18, 0x17, /* Power Control 2 */
-1, 0xC1, 0x41, /* Power Control 3 */
-1, 0xC5, 0x00, 0x1A, 0x80, /* VCOM Control 1 */
-1, 0xB1, 0xB0, 0x11, /* Frame Rate Control */
-1, 0xB4, 0x02, /* Display Inversion Control */
-1, 0xB6, 0x02, 0x22, 0x3B, /* Display Function Control */
-1, 0xE9, 0x00, /* Positive Gamma Correction */
-1, 0xE0, 0x00, 0x13, 0x18, 0x04, 0x0F, 0x06, 0x3A, 0x56, 0x4D, 0x03, 0x0A, 0x06, 0x30, 0x3E, 0x0F, /* Positive Gamma Correction */
-1, 0xE1, 0x00, 0x13, 0x18, 0x01, 0x11, 0x06, 0x38, 0x34, 0x4D, 0x06, 0x0D, 0x0B, 0x31, 0x37, 0x0F, /* Negative Gamma Correction */
-1, 0x36, 0x08, /* Memory Access Control */
-1, 0x3A, 0x66, /* Interface Pixel Format */
-1, 0x21, /* Display Inversion On */
-1, 0x11,
-2, 120, /* Delay 120ms */
-1, 0x29,
-3 /* End marker */
};
static void set_addr_win(struct fbtft_par *par, int xs, int ys, int xe, int ye)
{
write_reg(par, MIPI_DCS_SET_COLUMN_ADDRESS,
xs >> 8, xs & 0xFF, xe >> 8, xe & 0xFF);
write_reg(par, MIPI_DCS_SET_PAGE_ADDRESS,
ys >> 8, ys & 0xFF, ye >> 8, ye & 0xFF);
write_reg(par, MIPI_DCS_WRITE_MEMORY_START);
}
static int set_var(struct fbtft_par *par)
{
switch (par->info->var.rotate) {
case 0:
write_reg(par, MIPI_DCS_SET_ADDRESS_MODE,
0x80 | (par->bgr << 3));
break;
case 90:
write_reg(par, MIPI_DCS_SET_ADDRESS_MODE,
0x20 | (par->bgr << 3));
break;
case 180:
write_reg(par, MIPI_DCS_SET_ADDRESS_MODE,
0x40 | (par->bgr << 3));
break;
case 270:
write_reg(par, MIPI_DCS_SET_ADDRESS_MODE,
0xE0 | (par->bgr << 3));
break;
default:
break;
}
return 0;
}
static struct fbtft_display display = {
.regwidth = 8,
.width = WIDTH,
.height = HEIGHT,
.init_sequence = default_init_sequence,
.fbtftops = {
.set_addr_win = set_addr_win,
.set_var = set_var
},
};
FBTFT_REGISTER_DRIVER(DRVNAME, "ilitek,ili9488", &display);
MODULE_ALIAS("spi:" DRVNAME);
MODULE_ALIAS("platform:" DRVNAME);
MODULE_ALIAS("spi:ili9488");
MODULE_ALIAS("platform:ili9488");
MODULE_DESCRIPTION("FB driver for the ILI9488 LCD Controller");
MODULE_AUTHOR("Noralf Tronnes");
MODULE_LICENSE("GPL");
|
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有账号?立即注册
×
|