Toggle navigation
首页
问答
文章
话题
专家
专区
更多专区...
文档中心
返回主站
搜索
提问
会员
中心
登录
注册
I2C
Use of I2C device driver
发布于 2014-12-15 21:38:12 浏览:8025
Ni hao, I am working on a board based on STM32F2xx with one I2C bus and three I2C devices. I was looking for some examples how to use the I2C framework, available in i2c_core.c and i2c_dev.c, but I couldn't find anything in the repository. Can you help me to find some good complete examples in order to use I2C with RT-Thread? Xie xie Cesare
查看更多
8
个回答
默认排序
按发布时间排序
bernard
2014-12-16
This guy hasn't written anything yet
Hello, Do you have IIC driver? If you have driver and already register the IIC driver to the RT-Thread device system, you can use IIC device interface to visit IIC devices. For example: [code] { rt_uint8_t reg; rt_uint8_t buf[8]; struct rt_i2c_msg msgs[2]; struct rt_i2c_bus_device* i2c_bus = (struct rt_i2c_bus_device *)rt_device_find("your_iic"); reg = 111; // iic device's register address msgs[0].addr = your_iic_device_addr; msgs[0].flags = RT_I2C_WR; msgs[0].buf = ® msgs[0].len = 1; msgs[1].addr = your_iic_device_addr; msgs[1].flags = RT_I2C_RD; /* Read from slave */ msgs[1].buf = buf; msgs[1].len = sizeof(buf); /* to read some registers on the iic devices */ length = rt_i2c_transfer(i2c_bus, msgs, 2); } [/code]
BubbleBobble
2014-12-16
This guy hasn't written anything yet
Ni hao Bernard, thank you for your reply, I had doubts how the I2C framework is organized in RT-Thread. Anyway I found an example in the RealBoard4088 repository, more precisely: [code]RealBoard4088/software/rtthread_examples/drivers/drv_i2c.c[/code] tells me how to write the driver and register the I2C bus, then [code]RealBoard4088/software/rtthread_examples/drivers/drv_uda1380.c[/code] tells me how to write the driver for the single I2C device and register it on the bus. I think I should be able to go on without problems. But I have the last question: do we have a chance to get the full RT-Thread documentation in english? I really like RT-Thread and I found it quite powerful but my problem is the lack of documentation and examples. Thank you Cesare
bernard
2014-12-17
This guy hasn't written anything yet
Recently, we will have a short guide for RT-Thread kernel. We can translate it to English. But for full book of RT-Thread programming guide, we have no enough time to translate it to English. But it's placed in github.com as markdown file. If possible, you or other guys can translate it to English.
BubbleBobble
2014-12-22
This guy hasn't written anything yet
Despite english is not my native language, I might try to translate the kernel part to english using chinese => english translator. I also have chinese friends who eventually can help me. Now here it is Xmas and New Year period, once I get back from holidays I will check the repository for the translation. I let you know. By the way, just to report to you that here in Europe the website [url=http://www.rt-thread.org]http://www.rt-thread.org[/url] is recently very slow and sometimes it gets stuck. Thank you to release the RT-Thread RTOS to the public.
bernard
2014-12-23
This guy hasn't written anything yet
O, I think English is your native language. The website of "www.rt-thread.org" is placed in China, therefore, it's very slowly to be visited from Europe or US. Actually, You can visit github.com, the development activities is hosted in github: [url=https://github.com/RT-Thread/rt-thread]https://github.com/RT-Thread/rt-thread[/url] And you can submit issue if you have question or some interesting topic etc. I'm using GMail and can receive the notification from github immediately. I will replay the github issue carefully. Hope you enjoy RT-Thread. Next year, we will go out side of China. Merry Christmas!
majianjia
2014-12-28
This guy hasn't written anything yet
[s:154] [s:154] EU test
ralfak
2015-12-15
This guy hasn't written anything yet
I2C device in rt_thread is just a hole! get example from [url=https://github.com/RT-Thread/realboard-stm32f4/blob/master/software/examples/drivers/stm32_i2c.c]https://github.com/RT-Thread/realboard- ... tm32_i2c.c[/url].
撰写答案
登录
注册新账号
关注者
0
被浏览
8k
关于作者
BubbleBobble
This guy hasn't written anything yet
提问
6
回答
4
被采纳
0
关注TA
发私信
相关问题
1
NXP的I2C应该比ST的好用吧
2
关于I2C 驱动问题请教
3
我如何知道这个iic的io配置和我电路设计的是一致的?
4
I2C模拟读操作失败,不知道问什么进不去读函数
5
RTT的I2C有官方文档资料没有
6
求 STM32F103 IIC 自定义IO初始化 代码
7
报一个LPC4008代码中I2C的bug
8
RTOS IIC总线使用
9
关于在RTT中使用STM32 I2C的疑问
10
裸机跑调外设ic程序已经调好,rt-thread系统 在stm32f407如何实现i2c外设
推荐文章
1
RT-Thread应用项目汇总
2
玩转RT-Thread系列教程
3
五分钟玩转RT-Thread新社区
4
机器人操作系统 (ROS2) 和 RT-Thread 通信
5
关于STM32H7开发板上使用SDIO接口驱动SD卡挂载文件系统的问题总结
6
【技术三千问】之《玩转ART-Pi》,看这篇就够了!干货汇总
7
【ART-PI】RT-Thread 开启RTC 与 Alarm组件
8
STM32的“GPU”——DMA2D实例详解
9
RT-Thread隐藏的宝藏之completion
10
国产MCU移植系列教程汇总,欢迎查看!
最新文章
1
ART-Pi-smart在window 10环境开机测试
2
【原创征文】6月RT-Thread原创征文评选结果出来啦!
3
【征文活动】亲爱的开发者,RT-Thread社区喊你投稿啦
4
【BLE蓝牙学习开发笔记】安利一款简单好用且高性价比的BLE蓝牙抓包器
5
发现了1款好用的VSCODE插件,画时序图很方便。(WaveDrom)
热门标签
RT-Thread Studio
串口
LWIP
AT
FinSH
ART-Pi
Env
SPI
Bootloader
USB
Hardfault
CAN
文件系统
DMA
studio
RT-Thread
线程
Nano
stm32
ota
MQTT
SCons
ESP8266
rtthread
freemodbus
软件包
I2C
UART
flash
RTC
cubemx
定时器
W5500
FAL
BSP
rt-smart
rtt
PWM
AB32VG1
ADC
编译报错
msh
socket
SDIO
C++
dfs
at_device
SFUD
MicroPython
RT-Studio
本月问答贡献
出出啊
1275
个答案
277
次被采纳
小小李sunny
1166
个答案
223
次被采纳
whj467467222
1196
个答案
134
次被采纳
flashman2002
1203
个答案
114
次被采纳
张世争
477
个答案
109
次被采纳
本月文章贡献
出出啊
1
篇文章
1
次点赞
小小李sunny
1
篇文章
1
次点赞
whj467467222
2
篇文章
1
次点赞
张世争
11
篇文章
31
次点赞
红枫
0
篇文章
1
次点赞
回到
顶部
发布
问题
分享
好友
手机
浏览
扫码手机浏览
投诉
建议
回到
底部