sipeed / Longduino

Longduino is an Arduino port for gd32v mcu.
Other
69 stars 21 forks source link

SPI prescaling wrong? #22

Open joba-1 opened 4 years ago

joba-1 commented 4 years ago

Hi,

just in case someone is still working on this (would be great!) I just read the code to understand why SPI does not work for me and found this:

It seems the prescale parameter is set by calculating it from clock freq / bus freq, then directly use that to call the framework init function. But the framework init function seems to expect some 3-bit pattern which only allows distinct prescales of multiples of 2. So, the SPI configuration is destroyed by this