Driver framework proposal

Hello again.

The last couple of days I've been coding with the periph API, but I'm finding it some what limiting and not so hardware independent, like enums for settings, #defines for structure augmenting/compressing, different interfaces for consuming different buses, etc.

I would like to start a proposal for a really hardware independent device, bus and DMA access.

I would consume the API on my porting effort of the LPCxpresso board, and I also have some other boards for porting (ArmadaXP and SMT32).

Should I give it a go? should I discuss design ideas first with some of you?

Nice day everyone.

Hi Guillermo,

Hello again.

The last couple of days I've been coding with the periph API, but I'm finding it some what limiting and not so hardware independent, like enums for settings, #defines for structure augmenting/compressing, different interfaces for consuming different buses, etc.

You are completely right, the low-level (or periph) driver API is limited and maybe not-so-nice to read in some parts. But it is important to understand the concept behind it. The notion was not to create a more or less abstract driver model as e.g. in Linux, where you do a true abstraction of char, block etc. devices. The idea behind the low-level driver is to give unified, platform independent access to typical micro-controller peripherals while keeping the overhead as low as possible. The API does furthermore not aim at utilizing all the functions that MCUs offer (which are indeed very different), but it focuses on the core functions that will suffice for say 90-95% of the use cases.

However: I think it would be very nice to have a more abstract peripheral/device abstraction the is designed about some more general concepts. I my opinion it should even be possible to put this abstraction on top of the existing low-level driver API...

I would like to start a proposal for a really hardware independent device, bus and DMA access.

I would consume the API on my porting effort of the LPCxpresso board, and I also have some other boards for porting (ArmadaXP and SMT32).

Should I give it a go? should I discuss design ideas first with some of you?

Yes please! Maybe you can sketch your concepts with some drawings or something on a wiki page or similar? I am looking very much forward to this discussion!

Best, Hauke

Hi,

I would like to start a proposal for a really hardware independent device, bus and DMA access.

Should I give it a go? should I discuss design ideas first with some of you?

Yes please! Maybe you can sketch your concepts with some drawings or something on a wiki page or similar? I am looking very much forward to this discussion!

Me too!

We've had a very abstract driver/device model in early versions of RIOT. At some point it was generic and hardware independant, but also overengineered and complicated - so we dropped it.

So explaining or sketching ideas before investing too much implementation work is probably useful, so we don't repeat the past. :wink:

Cheers, Kaspar