apps/examples: Add path option to SPI Slave test#3467
apps/examples: Add path option to SPI Slave test#3467eren-terzioglu wants to merge 1 commit intoapache:masterfrom
Conversation
| #define RX_BUFFER_SIZE 64 | ||
| #define TX_BUFFER_SIZE 64 | ||
| #define SOURCE_FILE "dev/spislv2" /* SPI device path */ | ||
| #define DEFAULT_SPI_PATH "dev/spislv2" |
There was a problem hiding this comment.
@eren-terzioglu why is it spislv2 instead of spislv0 ?
There was a problem hiding this comment.
Yup, example usage mentions printf(" spislv -p /dev/spislv0\n\n"); and 0 seems to be a defalut, please update to 0 unless other reason not to use it? :-)
There was a problem hiding this comment.
Default path was spislv2. I did not break any workflow with this update. I can change example usage to spislv2 if it is fine for you? What do you think?
There was a problem hiding this comment.
Yes, I noticed that, I just asked why spislv2? I suggest you trying it to understand why it was this way. It could be a typo in the original config
There was a problem hiding this comment.
Example creator created this to test SPI Slave for ESP32-C6. On Espressif devices we register SPI devices starting from SPI2 (because of general purpose SPI starts from SPI2) and probably he did not want to work on it much with parameter option. Only meaningfull reason comes to my mind is this.
There was a problem hiding this comment.
Can we add the default value print to the help message? :-)
There was a problem hiding this comment.
Added, please take a look
b7ad46d
b7ad46d to
efbf644
Compare
Add path option to spislv_test example Signed-off-by: Eren Terzioglu <eren.terzioglu@espressif.com>
cederom
left a comment
There was a problem hiding this comment.
Thank you @eren-terzioglu :-)
acassis
left a comment
There was a problem hiding this comment.
@eren-terzioglu normally other applications on NuttX let the user define the device file in the menuconfig. Please change this application to do it, then the users can change it easily
We can add it but do we need to add for already parameterized example? |
I think we can use slv0 and add the default CONFIG_ to slv2 for ESP32xx board. |
Yes, I did this implementation and tested it only in esp32 env. Maybe I did a mistake using slv2. |
Summary
Add path option to spislv_test example
Impact
Impact on user: Yes. Users can test different SPI slave interface just changing command
Impact on build: No.
Impact on hardware: No.
Impact on documentation: No.
Impact on security: No.
Impact on compatibility: No.
Testing
esp32c6-devkitc:spislvconfig used.Building
Command to build:
Running
spislv -p /dev/spislv0 -x 2 abbaandspislv -p /dev/spislv2 -x 2 abbacommands used to testOutput
Here is the output