arch/arm/src/stm32/stm32_i2cslave_v2.c: add STM32 I2C Slave support f…
This commit adds the lowerhalf driver support for the I2C Slave. While not currently ideal, it is compatible with the upperhalf i2c slave driver. A workqueue can be used to delegate the isr work to the upperhalf driver. But keep in mind wq introduces a lot of delay and in certain scenarios, it is better to write your own better upperhalf driver.
Summary and impact
Added I2C Slave support for the STM32 devices. Use with the current implementation of upper half driver.
Testing
Tested on a custom STM32F302 board with two I2C peripherals configured as slaves. Succesfully tested basic posix calls (open, close, read, write). Tested primarly with CMake but also compiled with the default makefile system. Tested on WSL/Win10.
Thank you Mateusz and Alan, as soon as I touch the company's PC I'll fix the issues. Also I realized I forgot to commit the headers so the peripherals could be initialized in the board config. Also I'll add some documentation and basic usage.
Fixed coding issues. Compiles OK. But I've got a question - where should I put the documentation? I found a generic page (https://nuttx.apache.org/docs/latest/components/drivers/special/i2c.html) about the I2C drivers, but not arch related.
@raiden00pl @acassis just reminding myself :)
@zdebanos I saw it is failing because of typos only:
/home/runner/work/nuttx/nuttx/nuttx/arch/arm/src/stm32/Kconfig:10762: retransfered ==> retransferred /home/runner/work/nuttx/nuttx/nuttx/arch/arm/src/stm32/Kconfig:10765: transfered ==> transferred /home/runner/work/nuttx/nuttx/nuttx/arch/arm/src/stm32/Kconfig:10766: reseted ==> reset /home/runner/work/nuttx/nuttx/nuttx/arch/arm/src/stm32/stm32_i2cslave_v2.c:100: deffering ==> differing, deferring
Please send a fix to the Kconfig
oh, I did not understand the output of the check, thanks for clearing that up!
Yes, it is confuse, I think it should just show a summary with errors instead of the verbose log
Fixed
@acassis @raiden00pl I modified the I2C Documentation in Documentation/components/drivers/special/i2c.rst, the documentation now elaborates further on the I2C slave and features an example with STM32 initialization.