Page 1 of 1
SPI Interfacing
Posted: Tue Apr 14, 2015 6:00 am
by camow7
Hi all,
I need the CrazyFlie to read an on board sensor and relay the data back to me. The sensor communication interface is SPI. Is this possible?
I noticed the CrazyFlie breakout gives you access to the SPI port however I'm worried this is only for flashing/debugging?
Regards,
Cameron
Re: SPI Interfacing
Posted: Tue Apr 14, 2015 6:31 am
by arnaud
Hi Cameron,
For Crazyflie 2.0 all expansion port pin are free to use, the programming is done by another port on the side of the copter.
For Crazyflie 1, the SPI is also free. The pin used for programming are TMS/TCK/TDO/TDI.
So yes it is possible

.
Regards,
Arnaud
Re: SPI Interfacing
Posted: Tue Apr 14, 2015 8:52 am
by camow7
Ok so is there any SPI libraries for the CrazyFlie?
Is there drivers in the VM?
Re: SPI Interfacing
Posted: Tue Apr 14, 2015 12:06 pm
by arnaud
We are using the ST standard peripheral libraries do access peripheral, it is part of the project and the SPI lib is compiled. In the following link I assume you are using Crazyflie 2. Crazyflie 1 uses an STM32F103
The SPI driver header is here (you can see the function you have to use):
https://github.com/bitcraze/crazyflie-f ... f4xx_spi.h
You can find documentation on the st lib in this package:
http://www.st.com/web/en/catalog/tools/PF257901