完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
大家好,我配置了和声来使用I2C驱动程序,主模式(强制写入和中断激活)。在应用程序部分,我生成了I2C主字符串传输应用程序的代码。在生成的文件中,我最终得到了从模式I2C的回调声明:app.h//*********************************************************************************//部分:应用程序回调例程//**************************************************************************************************************************************************************************************************************************************************************************************************当某些事件发生时。*/void(DRV_I2C_BUFFER_EVENT,void*);在app.c//********************************************************************************************************************************************************void(DRV_I2C_BUFFER_EVEN)T事件,void*上下文){.(event){case DRV_I2C_BUFFER_SLAVE_READ_REQUESTED:.._appData.I2CBufferHandle=DRV_I2C_Receive(.._appData.handleI2C1)、.._appSlaveAddress、.._appReadBuffer、sizeof(.._appReadBuffer)、NULL);break;case DRV_I2C_BUFFER_break;case DRV_I2C_BUFFER_Receive_SLAVE_WRITE_REQUESTED:.._appData.I2CBufferHandle=DRV_I2C_Transmit(.._appData.handleI2C1,.._appSlaveAddress,.._appReadBuffer,sizeof(.._appReadBuffer),NULL);Nop();break;default:break;}这是最新的X32编译器无法识别的。我认为它不是有效的语句。在驱动程序代码中,您会发现typedef:typedef void(*DRV_I2C_CallBack)(DRV_I2C_BUFFER_EVENT事件,void*context);所以我认为回调声明应该类似于DRV_I2C_CallBack I2C_slave_Callback(DRV_I2C_BUFFER_EVENT事件,void*上下文)。有谁能帮我做对吗?
以上来自于百度翻译 以下为原文 Hi guys, I Configured hARMony to use I2C driver, master mode (forced write and interrupt activated). In the application section i generated the code for the I2C master string transmit app. In the generated files, i end up with this callback declaration for slave mode I2C: in app.h // ***************************************************************************** // Section: Application Callback Routines // ***************************************************************************** // ***************************************************************************** /* These routines are called by drivers when certain events occur. */ void (DRV_I2C_BUFFER_EVENT, void *); in app.c // ***************************************************************************** // Section: Application Callback Functions // ***************************************************************************** void (DRV_I2C_BUFFER_EVENT event, void * context) { switch (event) { case DRV_I2C_BUFFER_SLAVE_READ_REQUESTED: acquisition_appData.I2CBufferHandle = DRV_I2C_Receive ( acquisition_appData.handleI2C1, acquisition_appSlaveAddress, acquisition_appReadBuffer, sizeof(acquisition_appReadBuffer), NULL); break; case DRV_I2C_BUFFER_SLAVE_WRITE_REQUESTED: acquisition_appData.I2CBufferHandle = DRV_I2C_Transmit ( acquisition_appData.handleI2C1, acquisition_appSlaveAddress, acquisition_appReadBuffer, sizeof(acquisition_appReadBuffer), NULL); Nop(); break; default: break; } } Which is not recognized by the latest X32 compiler. I don't think it is a valid statement. In the driver code, you find this typedef: typedef void (*DRV_I2C_CallBack) ( DRV_I2C_BUFFER_EVENT event, void * context ); So i think the callback declaration should be something like: DRV_I2C_CallBack I2C_slave_Callback(DRV_I2C_BUFFER_EVENT event, void * context); Can anyone help me get this right? |
|
相关推荐
1个回答
|
|
你是对的。这不是一个有效的陈述。它是配置脚本中的一个错误。它已经被删除了下一个版本。
以上来自于百度翻译 以下为原文 You are correct. That is not a valid statement. It is a bug in the configuration scripts. It has been removed for the next release. |
|
|
|
只有小组成员才能发言,加入小组>>
5139 浏览 9 评论
1987 浏览 8 评论
1917 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
3158 浏览 3 评论
请问电源和晶体值之间有什么关系吗?PIC在正常条件下运行4MHz需要多少电压?
2215 浏览 5 评论
708浏览 1评论
598浏览 1评论
有偿咨询,关于MPLAB X IPE烧录PIC32MX所遇到的问题
480浏览 1评论
PIC Kit3出现目标设备ID(00000000)与预期的设备ID(02c20000)不匹配。是什么原因
609浏览 0评论
505浏览 0评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-8 13:35 , Processed in 1.458726 second(s), Total 78, Slave 61 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号