Expose gpio functionality from pi/cmd/gpio-netsender

Issue #32 resolved
Saxon Milton created an issue

Currently we have unexported functions in pi/cmd/gpio-netsender/main.go that implement netsender.InitPin and netsender.PinReadWrite for handling init, read and write using gpio pins on raspberry pi. These are not accessible outside of the gpio-netsender driver, but would be really useful to any other netsender client that needs to gpio stuff. It is therefore proposed that we create a gpio.go file in the pi/netsender package and have these functions exported. They can then be used with any netsender client, for example even in revid (this will be useful when we’d like to control LEDs inside the camera housings).

Rationale for location:
With our arduino netsender code under arduino/netsender hardware pin reading/writing is handled there. I.e. if we are to located the gpio stuff as specified above, we have consistency with structure.

Comments (3)

  1. Saxon Milton reporter

    It’s now proposed that rather than having a gpio.go under pi/netsender we will create a new package “gpio” to hold gpio.go. This will fix a cyclic dependency that we get between sds and netsender (gpio.go requires sds i.e. netsender would require sds…… but sds requires netsender)

  2. Log in to comment