AdaCore / Ada_Drivers_Library

Ada source code and complete sample GNAT projects for selected bare-board platforms supported by GNAT.
BSD 3-Clause "New" or "Revised" License
241 stars 142 forks source link

Add board feature to initialize the Crazyflie external SPI. #346

Closed simonjwright closed 4 years ago

simonjwright commented 4 years ago

This unit already contains procedures (Initialize_I2C_GPIO, Configure_I2C) to do the hard work of initializing I2C.

There was no need to initialize SPI, because the basic Crazyflie doesn’t use it; however, SPI is used to communicate with the various decks.

This patch introduces a procedure to initialize the external SPI port.

Fabien-Chouteau commented 4 years ago

Thank you @simonjwright , look like I have to fix the continuous integration before we can merge this PR.

simonjwright commented 4 years ago

I only realised after the fact that I should have included a procedure to initialize the Chip Select pin; done now

Fabien-Chouteau commented 4 years ago

Why don't you use the CS pin as an argument to the first procedure and merge the two?

simonjwright commented 4 years ago

Why don't you use the CS pin as an argument to the first procedure and merge the two?

Hadn’t thought of that - but I think the reason is, there could be more than one peripheral, sharing the SPI but each with its own CS line.

Fabien-Chouteau commented 4 years ago

Hi @simonjwright , do you mind re-basing your patches on master? I have merged the Community 2020 support.

Thanks,

simonjwright commented 4 years ago

I think I didn’t do the rebasing as neatly as I could, sorry

Fabien-Chouteau commented 4 years ago

You can use this command:

git pull --rebase --autostash https://github.com/AdaCore/Ada_Drivers_Library master
simonjwright commented 4 years ago

Replaced by #349 .