STM32
登录
直播中
斗地主之神
8年用户
725经验值
擅长:嵌入式技术
私信
关注
[问答]
Mbed OS的函数改成HAL函数怎么写?
开启该帖子的消息推送
mbed
函数
HAL
TextLCD::TextLCD(PinName rs, PinName e, PinName d4, PinName d5,
PinName d6, PinName d7, LCDType type) : _rs(rs),
_e(e), _d(d4, d5, d6, d7),
_type(type) {
_e = 1;
_rs = 0; // command mode
wait_us(1500); // Wait 15ms to ensure powered up
/* send "Display Set
ti
ngs" 3 times (Only top nibble of 0x30 as we've got 4-bit bus)*/
for (int i=0; i<3; i++) {
writeByte(0x3);
wait_us(1640); // this command takes 1.64ms, so wait for it
}
writeByte(0x2); // 4-bit mode
wait_us(40); // most instructions take 40us
writeCommand(0x28); // Function set 001 BW N F - -
writeCommand(0x0C);
writeCommand(0x6); // Cursor Direction and Display Shift : 0000 01 CD S (CD 0-left, 1-right S(hift) 0-no, 1-yes
cls();
}
这个原来是Mbed OS 的函数,改成 HAl函数怎么搞?希望大师指导指导
回帖
(1)
李雨欣
2024-3-19 15:34:07
writeByte,你找到这个函数,把这个函数修改过来就行了,还有就是delay也要相应的修改。
writeByte,你找到这个函数,把这个函数修改过来就行了,还有就是delay也要相应的修改。
举报
更多回帖
rotate(-90deg);
回复
相关问答
mbed
函数
HAL
STM32CubeMX自带的FreeROTS怎么
改成
HAL
库
函数
版的?
2020-07-30
1283
如何在
Mbed
OS
操作系统下实现ADC高速数据采样?
2021-12-17
1234
请问Cube MX产生的代码里什么
函数
可以用来计算代码执行时间?
2019-02-15
2517
请问
HAL
库可以
写
一列IO口值的
函数
2019-01-30
5679
Linux下移植
mbed
os
到nucleo_f072开发板
2018-12-17
1852
请问stm32l4xx_
hal
_uart.c文件中的_
HAL
_LOCK(huart)
函数
有什么用
2019-01-18
2819
请问STM32F103如何
写
捕获的中断回调
函数
2018-11-19
5755
请问STM32使用
HAL
库怎么编写SPI全双工使用DMA发送和接收
函数
2018-12-12
11387
HAL
库串口中断接收的回掉
函数
没起作用
2019-01-28
5038
HAL
库有哪些常用的
函数
呢?其
函数
分别有何作用
2022-01-25
796
发帖
登录/注册
20万+
工程师都在用,
免费
PCB检查工具
无需安装、支持浏览器和手机在线查看、实时共享
查看
点击登录
登录更多精彩功能!
首页
论坛版块
小组
免费开发板试用
ebook
直播
搜索
登录
×
20
完善资料,
赚取积分