Skip to content

Add SPI slave support and basic example - #1612

Closed
brainelectronics wants to merge 4 commits into
stm32duino:mainfrom
brainelectronics:feature/add-SPI-slave-support-and-dirty-example
Closed

Add SPI slave support and basic example#1612
brainelectronics wants to merge 4 commits into
stm32duino:mainfrom
brainelectronics:feature/add-SPI-slave-support-and-dirty-example

Conversation

@brainelectronics

Copy link
Copy Markdown

Summary

This PR implements SPI slave mode.

References

This is a follow up for the ticket #1600.

Motivation

Most high level possible functions to implement this feature were used. In
order to be as close as possible to other Arduino examples.

SPIClass functions have not been touched as much as possible.

Validation

Example sketches for SPI master and slave are provided with this PR.

@fpistm
fpistm requested a review from ABOSTM January 3, 2022 09:55

@ABOSTM ABOSTM left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@brainelectronics,
Thanks for this Pull Request.

This is a good starting point, but if we go for an implementation of SPI slave in this core, your proposal doesn't match with Arduino API spirit:

  • user application should access to SPIClass API
    but it should not access to spi_init() for example (which is more for an internal core usage)
  • user application (like the proposed example) should not use STM32 HAL API like HAL_SPI_Receive(), ...
  • ... on the contrary, all this HAL_SPI_xxx() stuff should be part of the driver itself:
    For example by reusing/extending SPIClass like begin() with an optional parameter to specify the mode (with default master).
    Also maybe adding new function to this class like a function to register slave receive call back, and another function to provide the slave response ...
  • Driver, as well as example, should be compatible with any stm32 series supported.
    This means that :
    • driver implementation should use STM32 HAL/LL API common to STM32 series (or should be implement with compilation switch depending on series).
    • Example should use the default and predefined variable SPI (default SPI instance)
      Instead of defining DEBUG_LED, you can use predefined LED_BUILTIN
      and remove reference to specific MCU pin like PA4

Comment thread libraries/SPI/src/utility/spi_com.h
@brainelectronics
brainelectronics marked this pull request as draft January 11, 2022 09:30
@ric96

ric96 commented Apr 21, 2022

Copy link
Copy Markdown
Contributor

Hi, is this actively being worked on?
I wanted to use this functionality and am willing to test and co-auth if required.

@brainelectronics

Copy link
Copy Markdown
Author

Hi @ric96
Unfortunately I don't have much time to work on it. Another project is taking all my free time right now. Of course I'm happy with any contributions here

@mirko

mirko commented Jan 1, 2023

Copy link
Copy Markdown

I'd also really like to see this going upstream and I think it'd be worth putting some effort into once for a peace of mind later on, when using it in a project and not having to continuously level local patchsets.
How can I help?

@fpistm fpistm added the abandoned No more work on this label Nov 28, 2023
@fpistm

fpistm commented Nov 28, 2023

Copy link
Copy Markdown
Member

Superseded by #2050.

@fpistm fpistm closed this Nov 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

abandoned No more work on this

Projects

Development

Successfully merging this pull request may close these issues.

5 participants