进行简单修改测试,竟然点亮了。屏幕分辨率240X320
st7789.rar
两个文件放入 rt-thread\drivers 目录
测试代码:applications\main.c
#include "rtthread.h"
#include "drv_clock.h"
#include "board.h"
#include "st7789.h"
uint8_t data[LCD_RAM_SIZE];
int main(int argc, char **argv)
{
rt_kprintf("periph_get_pll_clk:%d\n", periph_get_pll_clk());
rt_kprintf("cpu_get_clk:%d\n", cpu_get_clk());
rt_kprintf("ahb_get_clk:%d\n", ahb_get_clk());
rt_kprintf("apb_get_clk:%d\n", apb_get_clk());
static uint16_t color;
rt_tick_t t1,t2;
color=0;
while(1)
{
color +=0x3333;
for(uint32_t j = 0; j < (uint32_t)Pixel_NUM; j++)
{
data[j * 2] = color >> 8;
data[j * 2 + 1] = color;
}
t1 = rt_tick_get();
lcd_hw_write(0, 0, LCD_Width-1, LCD_Height-1, data, LCD_RAM_SIZE);
t2 = rt_tick_get();
rt_kprintf("tick = %d\r\n", t2-t1);
rt_thread_delay(500);
}
return 0;
}
最近编辑记录 go369 (2022-06-21 22:49:53)
离线