Leonidas-from-XIV / ocaml-wiringpi

Binding to the WiringPi library

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

type-safe interface to wiringpi

co-dan opened this issue · comments

I am interested in having a slightly more generic type-safe interface to wiringpi.
Specifically this entails having variants pin = .. | GPIO4 | GPIO5 | .., pin_mode = IN | OUT, etc, and make all the functions operate on those types. So, instead of

val pin_mode : int -> int -> unit

have

val pin_mode : pin -> mode -> unit

I was planning to write some sort of typed interface for GPIO using your library as a backend. But if you are interesting, I can keep it close to the wiringpi API and have it part of this package? That is, if you still have time to maintain this.

I think a higher level, type-safe variant would make a lot of sense. I would guess such a layer would be rather small (since it is mostly mapping, I assume), so why don't you add it to ocaml-wiringpi directly? I can make you co-maintainer if you're interested. That saves a bit of maintenance for both of us (maintaining package, releases and such stuff).