Toggle navigation
首页
问答
文章
积分商城
专家
专区
更多专区...
文档中心
返回主站
搜索
提问
会员
中心
登录
注册
I2C_IIC
Use of I2C device driver
发布于 2014-12-15 21:38:12 浏览:8758
订阅该版
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
这家伙很懒,什么也没写!
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: ``` { 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); } ```
BubbleBobble
2014-12-16
这家伙很懒,什么也没写!
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: ``` RealBoard4088/software/rtthread_examples/drivers/drv_i2c.c ``` tells me how to write the driver and register the I2C bus, then ``` RealBoard4088/software/rtthread_examples/drivers/drv_uda1380.c ``` 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
这家伙很懒,什么也没写!
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
这家伙很懒,什么也没写!
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 [http://www.rt-thread.org](http://www.rt-thread.org) is recently very slow and sometimes it gets stuck. Thank you to release the RT-Thread RTOS to the public.
bernard
2014-12-23
这家伙很懒,什么也没写!
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: [https://github.com/RT-Thread/rt-thread](https://github.com/RT-Thread/rt-thread) 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
这家伙很懒,什么也没写!
[s:154] [s:154] EU test
ralfak
2015-12-15
这家伙很懒,什么也没写!
I2C device in rt_thread is just a hole! get example from [https://github.com/RT-Thread/realboard-stm32f4/blob/master/software/examples/drivers/stm32_i2c.c](https://github.com/RT-Thread/realboard- ... tm32_i2c.c).
撰写答案
登录
注册新账号
关注者
0
被浏览
8.8k
关于作者
BubbleBobble
这家伙很懒,什么也没写!
提问
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
国产MCU移植系列教程汇总,欢迎查看!
4
机器人操作系统 (ROS2) 和 RT-Thread 通信
5
五分钟玩转RT-Thread新社区
6
【技术三千问】之《玩转ART-Pi》,看这篇就够了!干货汇总
7
关于STM32H7开发板上使用SDIO接口驱动SD卡挂载文件系统的问题总结
8
STM32的“GPU”——DMA2D实例详解
9
RT-Thread隐藏的宝藏之completion
10
【ART-PI】RT-Thread 开启RTC 与 Alarm组件
最新文章
1
简单两步配置RTT源码阅读环境 vsc+clangd
2
恩智浦[FRDM-MCXN947]初探 之 ADC与DAC
3
LVGL使用字库IC芯片显示中文
4
基于STM32H750和Rt-Thread的CANFD通信实现的记录(一)
5
freemodbus主机在freertos的适配,参考rtthread例程
热门标签
RT-Thread Studio
串口
Env
LWIP
SPI
AT
Bootloader
Hardfault
CAN总线
FinSH
ART-Pi
USB
DMA
文件系统
RT-Thread
SCons
RT-Thread Nano
线程
MQTT
STM32
RTC
FAL
rt-smart
ESP8266
I2C_IIC
UART
WIZnet_W5500
ota在线升级
PWM
cubemx
freemodbus
flash
packages_软件包
BSP
潘多拉开发板_Pandora
定时器
ADC
GD32
flashDB
socket
中断
编译报错
Debug
SFUD
msh
rt_mq_消息队列_msg_queue
keil_MDK
ulog
MicroPython
C++_cpp
本月问答贡献
出出啊
1517
个答案
342
次被采纳
小小李sunny
1443
个答案
289
次被采纳
张世争
805
个答案
174
次被采纳
crystal266
547
个答案
161
次被采纳
whj467467222
1222
个答案
148
次被采纳
本月文章贡献
出出啊
1
篇文章
4
次点赞
小小李sunny
1
篇文章
1
次点赞
张世争
1
篇文章
1
次点赞
crystal266
2
篇文章
2
次点赞
whj467467222
2
篇文章
1
次点赞
回到
顶部
发布
问题
分享
好友
手机
浏览
扫码手机浏览
投诉
建议
回到
底部