contiki-os / contiki

The official git repository for Contiki, the open source OS for the Internet of Things
http://www.contiki-os.org/
Other
3.72k stars 2.58k forks source link

GPIO API missing #1713

Open alignan opened 8 years ago

alignan commented 8 years ago

More than an issue this is a call for discussion and comments.

CPU implementations define their own GPIO functions and calls, but I think we need to have an unified GPIO API, even if the current register-based macros are more efficient. This will allow more portable implementations of sensors and actuators, as well as implement guidelines for people contributing their own platforms.

tonnenpinguin commented 8 years ago

How about using the arduino GPIO API as a starting point?

alignan commented 8 years ago

[rant] God no! [/rant]

Joking :smile:

bthebaudeau commented 8 years ago

We would need that, not only for GPIO, but for all drivers. CMSIS aims at standardizing APIs for Cortex-M, but this could probably apply to other platforms too.

Regarding GPIOs, there are two parts:

jnohlgard commented 8 years ago

We have been using the RIOT API for GPIOs 1 in our Mulle Contiki port 2, (as well as most other in-CPU peripherals) to reduce the maintenance burden and to make apps easily portable between the two systems. We have also modified the Makefiles to build the RIOT drivers in a separate archive so it is easily replaceable (to clearly show the intent to comply with the LGPL and its requirements on modifying and relinking).

alignan commented 8 years ago

Thanks @gebart! I have also reviewed the RIOT API while porting the RE-Mote and is OK. The link to your Contiki port seems broken.

alignan commented 8 years ago

@bthebaudeau I will check U-Boot also, I only used it briefly but having something close to Unix users seems a good idea.

greg-king5 commented 8 years ago

Thanks, @gebart! I have also reviewed the RIOT API while porting the RE-Mote; and, it is OK. The link to your Contiki port seems broken.

Yes, he used an unusual style of writing URL links. Then, he put a phrase in parentheses next to the second link. Unfortunately, that made the phrase look like a standard Markdown link. Here is his comment again, written in the standard Markdown style:

We have been using the RIOT API for GPIOs [1] in our Mulle Contiki port [2] (as well as most other in-CPU peripherals) to reduce the maintenance burden and to make apps easily portable between the two systems. We have also modified the Makefiles to build the RIOT drivers in a separate archive so it is easily replaceable (to clearly show the intent to comply with the LGPL and its requirements on modifying and relinking).

jnohlgard commented 8 years ago

sorry about that, I have edited my comment above to fix the links