Qcom LK阶段如何使用I2C介绍
来源:互联网 发布:单片机为什么需要复位 编辑:程序博客网 时间:2024/06/05 02:28
下面是Qcom LK阶段使用I2C的代码:
#include <i2c_qup.h>#include <blsp_qup.h>static struct qup_i2c_dev *i2c_dev;i2c_dev = qup_blsp_i2c_init(BLSP_ID_1, QUP_ID_1, 100000, 19200000);static int qrd_lcd_i2c_read(uint8_t addr){int ret = 0;/* Create a i2c_msg buffer, that is used to put the controller into read mode and then to read some data. */struct i2c_msg msg_buf[] = {{QRD_LCD_I2C_ADDRESS, I2C_M_WR, 1, &addr},{QRD_LCD_I2C_ADDRESS, I2C_M_RD, 1, &ret}};ret = qup_i2c_xfer(i2c_dev, msg_buf, 2);if(ret < 0) {dprintf(CRITICAL, "qup_i2c_xfer error %d\n", ret);return ret;}return 0;}static int qrd_lcd_i2c_write(uint8_t addr, uint8_t val){int ret = 0;uint8_t data_buf[] = { addr, val };/* Create a i2c_msg buffer, that is used to put the controller into write mode and then to write some data. */struct i2c_msg msg_buf[] = { {QRD_LCD_I2C_ADDRESS, I2C_M_WR, 2, data_buf}};ret = qup_i2c_xfer(i2c_dev, msg_buf, 1);if(ret < 0) {dprintf(CRITICAL, "qup_i2c_xfer error %d\n", ret);return ret;}return 0;}
1 0
- Qcom LK阶段如何使用I2C介绍
- Qcom LK阶段如何使用ADC介绍
- Qcom LK阶段如何使用ADC介绍
- Qcom LK阶段如何使用ADC介绍
- [MTK软件原创] [I2C]如何在lk和preloader阶段进行i2c通讯
- 高通LK阶段使用模拟i2c--附i2c子协议smbus-protocol
- [Vibrator]LK阶段如何实现开机震动
- qcom linux kernel 如何控制i2c的gpio
- 高通msm8916 LK阶段配置使用i2c5
- mms8916 lk阶段ADC
- qcom I2C driver : i2c-msm-v2.c
- qcom 8916平台的i2c init部分
- qcom I2C driver i2c-msm-v2.c code analysis
- android lk机制介绍
- Qualcomm LK机制介绍
- 如何使用W7100A模拟I2C总线
- MTK lk源码解析1( lk 阶段汇编代码crt0.S解析)
- MTK lk源码解析2( lk 阶段main.c中的kmain.c函数解析)
- mt.exe : general error c101008d 解决方法
- Pushlet 2.0.3 源码分析
- UVA 1363
- JS 获取浏览器窗口大小
- 关于程序工作路径问问题setcurrentdirectory
- Qcom LK阶段如何使用I2C介绍
- MyBatis传入多个参数的问题
- 联通sp对接记录
- libevent源码剖析-事件主循环
- Python安装库的时候出现Error: Microsoft Visual C++ 10.0 is required (Unable to find vcvarsall.bat)
- 动态table 动态增加删除行
- QT程序调试(资源死锁问题)
- GridView在ListVi中不能完全显示或只显示一行的解决方法
- C# 监听串口数据并触发事件