基于Wolf32F031 自由评估板的LCD display(SPI接口)实验硬件原理及软件API使用方法(适用于STM32F030/031)
来源:互联网 发布:qq没有软件升级 编辑:程序博客网 时间:2024/06/06 04:25
●共分为五部分:
(一)相关知识
(二)硬件原理
(三)软件API
(四)调用方法
(五)实验现象
●相关知识:
1.SPI总线是电子设计中,板级内部互联常见形式之一,STM32F032内部提供一路SPI接口最高速率可达18 Mbit/s。
2.TFT LCD是电子开发中常用的信息输出设备,本例中选取的LCD参数如下:2.4寸,分辨率320x240,ILI931驱动器,SPI接口,262k 色,带背光。
●硬件准备:
1.Wolf32F031 自由 评估板
2.电源适配器
3.JLink/ULink/STLink(本文以STLink为例)
4.USB转串口(RS232)
●硬件原理框图:
●硬件原理图:
●软件资源准备:
LCD工程文件:
wolf32f031_LCD_display.uvproj
●软件API介绍:
函数介绍:
//Init LCD port
void wolf_LCD9341_Init(void);
//Clear LCD with specified color
void wolf_LCD9341_clear_screen(uint16_t color);
//Draw one dot with color at (xpos,ypos)
void wolf_LCD9341_point(uint16_t xpos, uint16_t ypos,uint16_t color);
//Fill a rectangle with color at ([xsta,ysta],[xend,yend])
void wolf_LCD9341_fill(uint16_t xsta, uint16_t ysta, uint16_t xend, uint16_t yend, uint16_t color);
//Draw a line whit color from (x1,y1) to (x2,y2)
void wolf_LCD9341_line(uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2, uint16_t color);
//Draw a rectangle with color at ([x1,y1],[x2,y2])
void wolf_LCD9341_rect(uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2, uint16_t color);
//Draw a circle with color at center (Xpos,Ypos),R is Radius
void wolf_LCD9341_circle(uint16_t Xpos, uint16_t Ypos, uint16_t Radius, uint16_t color);
//Print a char at (x,y) with different mode
void wolf_LCD9341_char(uint16_t x,uint16_t y,uint8_t num,uint8_t mode);
//Print number at (x,y)
void wolf_LCD9341_num(uint16_t x, uint16_t y, int32_t num, uint8_t len, uint8_t mode);
//Draw a picture at area ([xsta,ysta],[xend,yend]) with picture data
void wolf_LCD9341_pic(uint16_t xsta, uint16_t ysta, uint16_t xend, uint16_t yend, uint8_t *pdat);
●调用方法:
初始化LCD端口
wolf_LCD9341_Init();
使能LCD背光
LCD_BACKUP_ENABLE(); //Light up LCD backup LED
LCD显示为全屏深蓝色
wolf_LCD9341_clear_screen(DARKBLUE);
画方框
wolf_LCD9341_rect(80,80, LCD_WIDTH-80,LCD_HEIGHT-80, GREEN);
画线
wolf_LCD9341_line(0,0, LCD_WIDTH-1,LCD_HEIGHT-1, BRED);
画圆
wolf_LCD9341_circle(120, 160, 110, BLACK);
画矩形填充
wolf_LCD9341_fill(100,100,LCD_WIDTH-100,LCD_HEIGHT-100,RED);
显示数组
wolf_LCD9341_num(115, 60,86, 2, 1);
显示字符串
wolf_LCD9341_string(85,240,"EDREAMTEK",1);
更改画笔颜色
POINT_COLOR = CYAN;
显示字符串,显示为设置的画笔颜色
wolf_LCD9341_string(40,300,"edreamtek.taobao.com",1);
●实验现象
3.1硬件连接实物
3.2编译代码并下载
打开code\1.basic\LCD_display\Project\wolf32f031_LCD_display.uvproj,编译并下载工程。
3.3 下载完成后,观察LCD状态。
依梦科技,或许可以帮到你
- 基于Wolf32F031 自由评估板的LCD display(SPI接口)实验硬件原理及软件API使用方法(适用于STM32F030/031)
- 基于Wolf32F031 自由评估板的LED Control实验硬件原理及软件API使用方法(适用于STM32F030/031)
- 基于Wolf32F031 自由评估板的ADC实验硬件原理及软件API使用方法(适用于STM32F030/031)
- 基于Wolf32F031 自由评估板的RTC实验硬件原理及软件API使用方法(适用于STM32F030/031)
- 基于Wolf32F031 自由评估板的IIC EEPROM实验硬件原理及软件API使用方法(适用于STM32F030/031)
- 基于Wolf32F031 自由评估板的Accelerometer(MMA7455)实验硬件原理及软件API使用方法(适用于STM32F030/031)
- 基于Wolf32F031 自由评估板的KEY scan(查询方式)实验硬件原理及软件API使用方法(适用于STM32F030/031)
- 基于Wolf32F031 自由评估板的Buzzer(PWM控制方式)实验硬件原理及软件API使用方法(适用于STM32F030/031)
- 基于Wolf32F031 自由评估板的Buzzer(PWM控制方式)实验硬件原理及软件API使用方法(适用于STM32F030/031)
- 基于Wolf32F031 自由评估板的UART Txpoll RX interrupt实验硬件原理及软件API使用方法(适用于STM32F030/031)
- 嵌入式项目1--修改LCD为使用硬件SPI(之前为软件模拟SPI协议)
- LCD的SPI接口分析
- 嵌入式学习--work11 关于SPI的深入学习及软件模拟SPI(LCD调试所遇)
- 关于spi接口的lcd初始化
- 基于ARM处理器的LCD控制及触摸屏接口设计
- 基于ARM处理器的LCD控制及触摸屏接口设计
- 基于stm32f103zet6之硬件SPI的学习
- MSP430 SPI硬件接口
- HashMap的使用
- CocoaPods详解之----制作篇
- EventBus 注册错误no public methods with the @Subscribe annotation
- 浅谈AngularJS的$parse服务 这篇可以让你看明白
- 第15周项目3 - B-树的基本操作
- 基于Wolf32F031 自由评估板的LCD display(SPI接口)实验硬件原理及软件API使用方法(适用于STM32F030/031)
- for循环与while循环
- HDFS(2)
- web自动化(7)----模拟事件
- handler
- iOS中英文混排,获取字符串长度(中文字符数)
- 进程启动与动态加载库信息
- 类及类的成员函数的定义
- web自动化(8)----验证码