Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added SPI class transmission #48

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

AleksandraFomina
Copy link

Added the ability to change the SPI interface pins to which MISO, MOSI and SCK are connected. First we initialize SPI class using SPIClass::SPIClass(uint8_t mosi, uint8_t miso, uint8_t sclk) constructor, more details in documentation https://github.com/stm32duino/Arduino_Core_STM32/wiki/API#built-in-library, and then pass it to SPI initialization function.

    modified:   src/AS5047P.cpp
    modified:   src/AS5047P.h
modified:   src/spi/AS5047P_SPI_Arduino.cpp
modified:   src/spi/AS5047P_SPI_Arduino.h

	modified:   src/AS5047P.h
	modified:   src/spi/AS5047P_SPI_Arduino.cpp
	modified:   src/spi/AS5047P_SPI_Arduino.h
@jonas-merkle
Copy link
Owner

Hey @AleksandraFomina 👋🏼
Thanks for your contribution! 🎉
In itself, I find your idea with the expansion of interchangeable SPI pins great. But I'm afraid that with your changes the library loses compatibility with Arduinos that are not based on a STM32 chip. That's why I can't merge your changes at the moment. You would have to separate the implementation for STM32 based chips from the other implementation and use e.g. preprocessor instructions to switch between the implementations. If you have time to come up with something like that it would be great and an enrichment for the library.

@jonas-merkle jonas-merkle marked this pull request as draft July 13, 2023 13:46
@jonas-merkle jonas-merkle self-assigned this Jul 13, 2023
@jonas-merkle jonas-merkle added the enhancement New feature or request label Jul 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants