SPI Interfacing

Firmware/software/electronics/mechanics
Post Reply
camow7
Beginner
Posts: 2
Joined: Tue Apr 14, 2015 5:30 am

SPI Interfacing

Post 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
arnaud
Bitcraze
Posts: 2538
Joined: Tue Feb 06, 2007 12:36 pm

Re: SPI Interfacing

Post 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
camow7
Beginner
Posts: 2
Joined: Tue Apr 14, 2015 5:30 am

Re: SPI Interfacing

Post by camow7 »

Ok so is there any SPI libraries for the CrazyFlie?

Is there drivers in the VM?
arnaud
Bitcraze
Posts: 2538
Joined: Tue Feb 06, 2007 12:36 pm

Re: SPI Interfacing

Post 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
Post Reply