diff --git a/controller/hd44780/hd44780.go b/controller/hd44780/hd44780.go index 45eae34..7e5c692 100644 --- a/controller/hd44780/hd44780.go +++ b/controller/hd44780/hd44780.go @@ -15,8 +15,8 @@ package hd44780 import ( "time" - "github.com/golang/glog" "github.com/cfreeman/embd" + "github.com/golang/glog" ) type entryMode byte diff --git a/controller/mcp4725/mcp4725.go b/controller/mcp4725/mcp4725.go index 169d13b..969dd48 100644 --- a/controller/mcp4725/mcp4725.go +++ b/controller/mcp4725/mcp4725.go @@ -4,8 +4,8 @@ package mcp4725 import ( "sync" - "github.com/golang/glog" "github.com/cfreeman/embd" + "github.com/golang/glog" ) const ( diff --git a/controller/pca9685/pca9685.go b/controller/pca9685/pca9685.go index a9e9545..98acf0f 100644 --- a/controller/pca9685/pca9685.go +++ b/controller/pca9685/pca9685.go @@ -6,9 +6,9 @@ import ( "sync" "time" - "github.com/golang/glog" "github.com/cfreeman/embd" "github.com/cfreeman/embd/util" + "github.com/golang/glog" ) const ( diff --git a/controller/pcal9535a/pcal9535a.go b/controller/pcal9535a/pcal9535a.go index 8322a5e..02e7414 100644 --- a/controller/pcal9535a/pcal9535a.go +++ b/controller/pcal9535a/pcal9535a.go @@ -1,13 +1,31 @@ -// PCAL953A, low volage GPIO expander as found in the Raspberry +/* + * Copyright (c) Clinton Freeman 2016 + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and + * associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT + * NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +// Package pcal9535a adds support for the low volage GPIO expander as found in the Raspberry // Pi Relay board by Seeed Studio. -// -// http://wiki.seeedstudio.com/wiki/Raspberry_Pi_Relay_Board_v1.0 package pcal9535a import ( "github.com/cfreeman/embd" ) +// More details at - http://wiki.seeedstudio.com/wiki/Raspberry_Pi_Relay_Board_v1.0 const ( REG_MODE = 0x06 ) @@ -38,6 +56,7 @@ func (c *PCAL9535A) SetPin(pin uint, on bool) error { return c.Bus.WriteByteToReg(c.Addr, REG_MODE, c.D) } +// Gets the state of supplied pin true = high or on, while false = low or off. func (c *PCAL9535A) GetPin(pin uint) bool { return (((c.D >> pin) & 1) == 0) } diff --git a/convertors/mcp3008/mcp3008.go b/convertors/mcp3008/mcp3008.go index 1b21752..30d6373 100644 --- a/convertors/mcp3008/mcp3008.go +++ b/convertors/mcp3008/mcp3008.go @@ -2,8 +2,8 @@ package mcp3008 import ( - "github.com/golang/glog" "github.com/cfreeman/embd" + "github.com/golang/glog" ) // MCP3008 represents a mcp3008 8bit DAC. diff --git a/embd/detect.go b/embd/detect.go index 183ce08..2a62010 100644 --- a/embd/detect.go +++ b/embd/detect.go @@ -4,8 +4,8 @@ import ( "fmt" "os" - "github.com/codegangsta/cli" "github.com/cfreeman/embd" + "github.com/codegangsta/cli" ) func detect(c *cli.Context) { diff --git a/embd/main.go b/embd/main.go index 7e50047..57ef4de 100644 --- a/embd/main.go +++ b/embd/main.go @@ -3,8 +3,8 @@ package main import ( "os" - "github.com/codegangsta/cli" _ "github.com/cfreeman/embd/host/all" + "github.com/codegangsta/cli" ) var version = "0.1.0" diff --git a/host/bbb/bbb.go b/host/bbb/bbb.go index c5e4bbc..cc203c2 100644 --- a/host/bbb/bbb.go +++ b/host/bbb/bbb.go @@ -15,9 +15,9 @@ import ( "os" "strings" - "github.com/golang/glog" "github.com/cfreeman/embd" "github.com/cfreeman/embd/host/generic" + "github.com/golang/glog" ) var pins = embd.PinMap{ diff --git a/host/bbb/pwmpin.go b/host/bbb/pwmpin.go index eb2234e..da0f978 100644 --- a/host/bbb/pwmpin.go +++ b/host/bbb/pwmpin.go @@ -10,9 +10,9 @@ import ( "strconv" "time" - "github.com/golang/glog" "github.com/cfreeman/embd" "github.com/cfreeman/embd/util" + "github.com/golang/glog" ) const ( diff --git a/host/edison/edison.go b/host/edison/edison.go index e675684..62be092 100644 --- a/host/edison/edison.go +++ b/host/edison/edison.go @@ -1,6 +1,23 @@ /* - Package edison provides Intel Edison support. -*/ + * Copyright (c) Clinton Freeman 2016 + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and + * associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT + * NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +// Package edison Provides Intel Edison support. package edison import ( diff --git a/host/generic/i2cbus.go b/host/generic/i2cbus.go index 0f38510..0f32d62 100644 --- a/host/generic/i2cbus.go +++ b/host/generic/i2cbus.go @@ -11,8 +11,8 @@ import ( "time" "unsafe" - "github.com/golang/glog" "github.com/cfreeman/embd" + "github.com/golang/glog" ) const ( diff --git a/host/generic/spibus.go b/host/generic/spibus.go index 439cd46..402e1c4 100644 --- a/host/generic/spibus.go +++ b/host/generic/spibus.go @@ -7,8 +7,8 @@ import ( "syscall" "unsafe" - "github.com/golang/glog" "github.com/cfreeman/embd" + "github.com/golang/glog" ) const ( diff --git a/motion/servo/servo.go b/motion/servo/servo.go index 2246077..1a54a70 100644 --- a/motion/servo/servo.go +++ b/motion/servo/servo.go @@ -2,8 +2,8 @@ package servo import ( - "github.com/golang/glog" "github.com/cfreeman/embd/util" + "github.com/golang/glog" ) const ( diff --git a/samples/watersensor.go b/samples/watersensor.go index 3fc0eff..ac0267b 100644 --- a/samples/watersensor.go +++ b/samples/watersensor.go @@ -6,9 +6,9 @@ import ( "flag" "time" - "github.com/golang/glog" "github.com/cfreeman/embd" "github.com/cfreeman/embd/sensor/watersensor" + "github.com/golang/glog" _ "github.com/cfreeman/embd/host/all" ) diff --git a/sensor/bmp085/bmp085.go b/sensor/bmp085/bmp085.go index eea540e..c18250f 100644 --- a/sensor/bmp085/bmp085.go +++ b/sensor/bmp085/bmp085.go @@ -7,8 +7,8 @@ import ( "sync" "time" - "github.com/golang/glog" "github.com/cfreeman/embd" + "github.com/golang/glog" ) const ( diff --git a/sensor/bmp180/bmp180.go b/sensor/bmp180/bmp180.go index bb18a6a..02ba8f6 100644 --- a/sensor/bmp180/bmp180.go +++ b/sensor/bmp180/bmp180.go @@ -7,8 +7,8 @@ import ( "sync" "time" - "github.com/golang/glog" "github.com/cfreeman/embd" + "github.com/golang/glog" ) const ( diff --git a/sensor/l3gd20/l3gd20.go b/sensor/l3gd20/l3gd20.go index c3a6c75..6ce20d1 100644 --- a/sensor/l3gd20/l3gd20.go +++ b/sensor/l3gd20/l3gd20.go @@ -7,8 +7,8 @@ import ( "sync" "time" - "github.com/golang/glog" "github.com/cfreeman/embd" + "github.com/golang/glog" ) const ( diff --git a/sensor/lsm303/lsm303.go b/sensor/lsm303/lsm303.go index 40e4d31..5af95e0 100644 --- a/sensor/lsm303/lsm303.go +++ b/sensor/lsm303/lsm303.go @@ -6,8 +6,8 @@ import ( "sync" "time" - "github.com/golang/glog" "github.com/cfreeman/embd" + "github.com/golang/glog" ) const ( diff --git a/sensor/tmp006/tmp006.go b/sensor/tmp006/tmp006.go index 42ca679..7788996 100644 --- a/sensor/tmp006/tmp006.go +++ b/sensor/tmp006/tmp006.go @@ -8,8 +8,8 @@ import ( "sync" "time" - "github.com/golang/glog" "github.com/cfreeman/embd" + "github.com/golang/glog" ) const ( diff --git a/sensor/us020/us020.go b/sensor/us020/us020.go index 0d021ce..694acff 100644 --- a/sensor/us020/us020.go +++ b/sensor/us020/us020.go @@ -5,8 +5,8 @@ import ( "sync" "time" - "github.com/golang/glog" "github.com/cfreeman/embd" + "github.com/golang/glog" ) const ( diff --git a/sensor/watersensor/watersensor.go b/sensor/watersensor/watersensor.go index 1fd6d98..8bc3e8b 100644 --- a/sensor/watersensor/watersensor.go +++ b/sensor/watersensor/watersensor.go @@ -4,8 +4,8 @@ package watersensor import ( "sync" - "github.com/golang/glog" "github.com/cfreeman/embd" + "github.com/golang/glog" ) // WaterSensor represents a water sensor.