-
Notifications
You must be signed in to change notification settings - Fork 2
Add spi #32
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
base: main
Are you sure you want to change the base?
Add spi #32
Conversation
… and test_main.ino. Signed-off-by: Frederikwag <[email protected]>
@@ -13,7 +15,7 @@ | |||
|
|||
// defines | |||
// Variables for SPI testing | |||
static SPIClassPSOC *spi = nullptr; | |||
static SPIClass *spi = nullptr; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good try 😬
Now this is fixed for xmc-for-arduino, but it won´t work for arduino-core-psoc.
The tests are meant to be reusable across cores. So when we identify that some core specific implementation is present, we should:
- generalize it using any standard common API.
- If generalization is not possible, use some mechanism to conditionally set certain specialization. For example, use the preprocessor to identify the core -> https://github.com/Infineon/arduino-core-tests/blob/main/src/corelibs/uart/test_uart_tx.cpp#L151-L163
@@ -5,6 +5,8 @@ | |||
* MISO pin for the test cases to work as expected. | |||
*/ | |||
|
|||
// THIS IS THE BRANCH ADD_SPI |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove comment.
@@ -70,7 +72,7 @@ TEST_IFX(spi_connected1_loopback, test_spi_mode_configuration) { | |||
TEST_IFX(spi_connected1_loopback, test_spi_reinitialization) { | |||
spi->end(); | |||
spi->begin(); | |||
TEST_ASSERT_EQUAL_MESSAGE(CY_RSLT_SUCCESS, spi->status, "SPI reinitialization failed"); | |||
TEST_ASSERT_TRUE_MESSAGE(true, "SPI reinitialization completed"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test might not be available for the standard Arduino coreAPI?
*/ | ||
|
||
// std includes | ||
#include <tlx5012-arduino.hpp> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might not be easy to test the 3-wire SPI interface... But this is not a 3wire SPI test, it is a TLE5012 test. Of course, if it works, then the affected 3-wire spi functionalities are as well validated.
We should be using the 3wire spi class and functions for it to belong in this project.
By creating this pull request you agree to the terms in CONTRIBUTING.md.
https://github.com/Infineon/.github/blob/master/CONTRIBUTING.md
--- DO NOT DELETE ANYTHING ABOVE THIS LINE ---
CONTRIBUTING.md also tells you what to expect in the PR process.
Description
Added the 3 wire test for SPI. 3 tests are executed:
Related Issue
The test requires the sensor tlx5012. Later on, we need to "professionalize" it so that it communicates with another board. Setting up the XMC as slave is the critical part.
Context