HAL I2C slave with read/write
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2015-08-27 4:08 AM
Posted on August 27, 2015 at 13:08
Hi,
I've been looking over an example of master/slave I2C communication using an interrupt and I just can't seem to figure out how it actually works. The description is really vague and the HAL documentation isn't much better.I need to write some firmware that will receive some commands/data, and act upon the data received, but it will also receive requests where it will have to reply to the master with data.How can I modify this code to either just receive commands when sent to the write address, or respond to commands when sent to the read address?
This discussion is locked. Please start a new topic to ask your question.
2 REPLIES 2
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2015-08-28 3:22 AM
Posted on August 28, 2015 at 12:22
Hi kureigu,
1- What are you using as STM32 product?2- Which example did you looked to?3- What are exactly the problems you faced to adapt it to your specific needs?-Mayla-To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2015-08-28 3:36 AM
Posted on August 28, 2015 at 12:36
This is for an STM32F030F4P6
The example I looked at was one with the STM32CubeMX pack for the STM32F030 family nucleo: ''\STM32Cube_FW_F0_V1.3.0\Projects\STM32F030R8-Nucleo\Examples\I2C\I2C_TwoBoards_ComIT''Firstly I just don't think I understand how to implement the interrupt itself that deals with whatever I2C data is received.Secondly, after reading the documentation I still don't know how to discern the difference between READ and WRITE addresses in an I2C slave interrupt, so that I can act on a command OR send data back in necessary.