打印
[其他ST产品]

Mbed OS 的函数,改成HAL函数怎么写?请教请教

[复制链接]
234|11
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
豌豆爹|  楼主 | 2022-12-11 09:41 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
  • 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 Settings" 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函数怎么搞?希望大师指导指导

使用特权

评论回复
发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

500

主题

1906

帖子

4

粉丝