Hello everybody !
I need I2C slave functionality of I2C HAL driver too and this post is what i found... I have tried to porting code provided by steved to Chibios 3.0 but I'm missing file "i2c_event.h" and i cant find it anywhere. can somebody upload it or maybe provide a link?
Thanks!
I2C Slave mode support?
Moderators: RoccoMarco, lbednarz, utzig, tfAteba, barthess
Re: I2C Slave mode support?
That file shouldn't be necessary with the V3.0 drivers; its not in my libraries.
IIRC it was used with an optional layer of functionality which genosensor provided for the original V2.6 drivers; I never ported that bit.
IIRC it was used with an optional layer of functionality which genosensor provided for the original V2.6 drivers; I never ported that bit.
Re: I2C Slave mode support?
Thank you for quick replay!
In code provided by you on page 3 of this post you use function i2cSlaveAwaitEvent which i think is implemented in "i2c_event.h" file because i didn't found it anywhere else, I guess this function just check SR1 and SR2 register for any status changes but still wanted to see its implementation.
In code provided by you on page 3 of this post you use function i2cSlaveAwaitEvent which i think is implemented in "i2c_event.h" file because i didn't found it anywhere else, I guess this function just check SR1 and SR2 register for any status changes but still wanted to see its implementation.
Re: I2C Slave mode support?
Edit: I think the latest is here: viewtopic.php?f=16&t=3020&p=23414#p23414
Will try and double check tomorrow.
It might be that the routine you're looking for had its name changed; you can always download genosensor's original code for 2.6 and have a look, since I haven't changed the structure significantly for 3.x
What processor are you using?
Will try and double check tomorrow.
It might be that the routine you're looking for had its name changed; you can always download genosensor's original code for 2.6 and have a look, since I haven't changed the structure significantly for 3.x
What processor are you using?
Re: I2C Slave mode support?
I've attached the latest versions of the I2C drivers I'm using; any changes from earlier versions are pretty trivial, I think.
Both I2Cv1 and I2Cv2 drivers have been functioning 24/7 for several months without noticeable problems.
Both I2Cv1 and I2Cv2 drivers have been functioning 24/7 for several months without noticeable problems.
- Attachments
-
- I2C_Master_Slave.zip
- I2C master and slave drivers
- (43.77 KiB) Downloaded 320 times
Re: I2C Slave mode support?
I use STM32F446RE and ChibiOS v 3.0.
I figured out that it use I2CDv1 LLD driver... looks like it is different from the version of your I2CDv1, I tried to port your code but stuck on i2c_lld_master_transmit_timeout, looks like it works differently in v 3.0
I figured out that it use I2CDv1 LLD driver... looks like it is different from the version of your I2CDv1, I tried to port your code but stuck on i2c_lld_master_transmit_timeout, looks like it works differently in v 3.0
Re: I2C Slave mode support?
It should be possible to use my files without any porting - the I2CDv1 files are being used on an STM32F407, which should have the same I2C peripherals as the F446.
Might be worth comparing 'global' features such as interrupts on the two chips to see if they are handled differently.
Might be worth comparing 'global' features such as interrupts on the two chips to see if they are handled differently.
Re: I2C Slave mode support?
I've found a test project for I2C slave using the Nucleo F401 - that should be pretty similar to your board.
- Attachments
-
- F401_Nucleo_I2C_Slave.zip
- (20.18 KiB) Downloaded 300 times
Re: I2C Slave mode support?
Thank you !
I'm using ChibiOS v3.0 and don't know if it will work there, will try to replace I2Cv1 driver...
I'm using ChibiOS v3.0 and don't know if it will work there, will try to replace I2Cv1 driver...
Re: I2C Slave mode support?
All the stuff I've done is for ChibiOS 3.x (rather than 2.x).
It should be as simple as adding the new drivers into your ChibiOS directory (I think they are already structured correctly), overwriting existing files. Then create a project and use slave mode - start with the sample to check everything compiles, then convert to your processor.
It should be as simple as adding the new drivers into your ChibiOS directory (I think they are already structured correctly), overwriting existing files. Then create a project and use slave mode - start with the sample to check everything compiles, then convert to your processor.
Who is online
Users browsing this forum: No registered users and 8 guests