-
Notifications
You must be signed in to change notification settings - Fork 39
Example: STM32F4 Discovery SPI #174
Example: STM32F4 Discovery SPI #174
Conversation
Could you make the |
I'd like to vote against that in order to keep the magic (i.e. indirection) to a minimum in the examples. |
A |
I disagree: |
This example is so pointless (but thanks for making it less broken ;-). We're connecting And then we're sending What is this example supposed to show exactly? That our documentation isn't lying? Shouldn't this rather be part of the documentation of the SpiMaster interface? It's not even specific to the STM32F4, certainly not to the SPI2 of the STM32F4. This could (and should) work on the AVR, or the STM32F1 or the F3.
We'd be advocating hardcoding the instance of the SPI driver. How is that useful? The I think it's obvious enough that I'd even go a step further and advocate that you should ALWAYS use the bit-banged masters for SPI and I2C especially when developing an external chip driver, since they are more stable than the hardware drivers (see #127). You can then switch to the hardware implementations and see if it still works. |
ALWAYS is ALWAYS wrong ;-)
Well, that's what I thought until last year. I discovered the known anomality that the ENC28J60 to run the SPI at frequencies of at least 8 MHz. (at least ist Rev. B4 Silicon). |
That's it. I'm becoming a farmer. |
Merged and modified manually in b327877. |
There was a typo in the SPI example.
SpiMaster2
has been initialized butSpiMaster1
used in the while loop.