cvra / platform-abstraction

Platform abstraction layer for microcontrollers
3 stars 6 forks source link

Device drivers #30

Open antoinealb opened 10 years ago

antoinealb commented 10 years ago

So, let's talk about device drivers.

  1. Will we write our own ? I think @Stapelzeiger said he would like to roll his own CAN. I think for other simpler drivers like RCC, timers, etc., we can simply write some wrappers around libopencm3 ?
  2. Do they belong to this repository ? I would say no.
  3. Do we want to test the drivers ? yes, absolutely. James Grenning's book has an example about how to do it, and a shorter version can be found there : http://www.renaissancesoftware.net/blog/archives/7
antoinealb commented 10 years ago

Maybe more useful ressource : http://www.renaissancesoftware.net/blog/archives/8

Stapelzeiger commented 10 years ago

For drivers where we need properly blocking IO we need to write our own drivers, since those from libopencm3 use busy-waiting. But of course we can use the low level parts of those drivers to set registers etc. I suggest to create a single new repo for all drivers. I agree about the testing. Most importantly for the state machines used for the more complicated peripherals.

antoinealb commented 10 years ago

I would prefer a repo per driver because all drivers might not compile on all boards. For example the Ethernet driver will only compile on the master, but the CAN will be shared between master / slave / power.

pierluca commented 10 years ago

Also, shared repository is useful when different parts are to remain in sync. Drivers being independent of each other, no point in doing so here.