From fb8e15108ecf3ecb060503273b2475f58fc98cc4 Mon Sep 17 00:00:00 2001 From: clinton Date: Thu, 29 Sep 2016 12:58:36 +1000 Subject: [PATCH 01/15] Added support for the BME280 from Bosch. --- sensor/bme280/bme280.go | 393 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 393 insertions(+) create mode 100644 sensor/bme280/bme280.go diff --git a/sensor/bme280/bme280.go b/sensor/bme280/bme280.go new file mode 100644 index 0000000..1a1d88e --- /dev/null +++ b/sensor/bme280/bme280.go @@ -0,0 +1,393 @@ +// Package bme280 allows interfacing with Bosch BME280 digital humidity, pressure +// and temperature sensor. +package bme280 + +import ( + "fmt" + "github.com/kidoman/embd" +) + +const ( + CAL_T1_LSB_REG = 0x88 + CAL_T1_MSB_REG = 0x89 + CAL_T2_LSB_REG = 0x8A + CAL_T2_MSB_REG = 0x8B + CAL_T3_LSB_REG = 0x8C + CAL_T3_MSB_REG = 0x8D + + CAL_P1_LSB_REG = 0x8E + CAL_P1_MSB_REG = 0x8F + CAL_P2_LSB_REG = 0x90 + CAL_P2_MSB_REG = 0x91 + CAL_P3_LSB_REG = 0x92 + CAL_P3_MSB_REG = 0x93 + CAL_P4_LSB_REG = 0x94 + CAL_P4_MSB_REG = 0x95 + CAL_P5_LSB_REG = 0x96 + CAL_P5_MSB_REG = 0x97 + CAL_P6_LSB_REG = 0x98 + CAL_P6_MSB_REG = 0x99 + CAL_P7_LSB_REG = 0x9A + CAL_P7_MSB_REG = 0x9B + CAL_P8_LSB_REG = 0x9C + CAL_P8_MSB_REG = 0x9D + CAL_P9_LSB_REG = 0x9E + CAL_P9_MSB_REG = 0x9F + + CAL_H1_REG = 0xA1 + CAL_H2_LSB_REG = 0xE1 + CAL_H2_MSB_REG = 0xE2 + CAL_H3_REG = 0xE3 + CAL_H4_MSB_REG = 0xE4 + CAL_H4_LSB_REG = 0xE5 + CAL_H5_MSB_REG = 0xE6 + CAL_H6_REG = 0xE7 + + TMP_MSB_REG = 0xFA + TMP_LSB_REG = 0xFB + TMP_XLSB_REG = 0xFC + + PRESSURE_MSB_REG = 0xF7 + PRESSURE_LSB_REG = 0xF8 + PRESSURE_XLSB_REG = 0xF9 + + HUMIDITY_MSB_REG = 0xFD + HUMIDITY_LSB_REG = 0xFE + + CTRL_MEAS_REG = 0xF4 + CONFIG_REG = 0xF5 + CTRL_HUMIDITY_REG = 0xF2 + RESET_REG = 0xE0 + + //RunMode can be: + // 0, Sleep mode + // 1 or 2, Forced mode + // 3, Normal mode + RunMode = uint8(3) + + //Standby can be: + // 0, 0.5ms + // 1, 62.5ms + // 2, 125ms + // 3, 250ms + // 4, 500ms + // 5, 1000ms + // 6, 10ms + // 7, 20ms + Standby = uint8(0) + + //Filter can be off or number of FIR coefficients to use: + // 0, filter off + // 1, coefficients = 2 + // 2, coefficients = 4 + // 3, coefficients = 8 + // 4, coefficients = 16 + Filter = uint8(0) + + //TempOverSample can be: + // 0, skipped + // 1 through 5, oversampling *1, *2, *4, *8, *16 respectivel + TempOverSample = uint8(1) + + //PressOverSample can be: + // 0, skipped + // 1 through 5, oversampling *1, *2, *4, *8, *16 respectively + PressOverSample = uint8(1) + + //HumidOverSample can be: + // 0, skipped + // 1 through 5, oversampling *1, *2, *4, *8, *16 respectively + HumidOverSample = uint8(1) +) + +type Calibration struct { + T1 uint16 + T2, T3 int16 + + P1, P2, P3, P4, P5, P6, P7, P8, P9 int64 + H1, H2, H3, H4, H5, H6 float64 +} + +type BME280 struct { + Bus embd.I2CBus + Addr byte + + Cal Calibration +} + +func readUInt16(lsb byte, msb byte, bus embd.I2CBus, addr byte) (uint16, error) { + lsbv, err := bus.ReadByteFromReg(addr, lsb) + if err != nil { + return 0, err + } + msbv, err := bus.ReadByteFromReg(addr, msb) + if err != nil { + return 0, err + } + + return (uint16(msbv) << 8) | uint16(lsbv), nil +} + +func readInt16(lsb byte, msb byte, bus embd.I2CBus, addr byte) (int16, error) { + lsbv, err := bus.ReadByteFromReg(addr, lsb) + if err != nil { + return 0, err + } + msbv, err := bus.ReadByteFromReg(addr, msb) + if err != nil { + return 0, err + } + + return (int16(msbv) << 8) | int16(lsbv), nil +} + +func readInt24(xlsb byte, lsb byte, msb byte, bus embd.I2CBus, addr byte) (int32, error) { + msbv, err := bus.ReadByteFromReg(addr, msb) + if err != nil { + return 0, err + } + + lsbv, err := bus.ReadByteFromReg(addr, lsb) + if err != nil { + return 0, err + } + + xlsbv, err := bus.ReadByteFromReg(addr, xlsb) + if err != nil { + return 0, err + } + + return int32((uint32(msbv) << 12) | (uint32(lsbv) << 4)) | ((int32(xlsbv) >> 4) & 0x0F), nil +} + +// New creates and calibrates a connection to a BME280 sensor on the supplied i2c bus +// at the nominated i2c address. +func New(bus embd.I2CBus, addr byte) (*BME280, error) { + s := &BME280{ + Bus: bus, + Addr: addr, + } + + var err error + var msb, lsb byte + + // Get calibrate information. + s.Cal.T1, err = readUInt16(CAL_T1_LSB_REG, CAL_T1_MSB_REG, bus, addr) + if err != nil { + return s, err + } + + s.Cal.T2, err = readInt16(CAL_T2_LSB_REG, CAL_T2_MSB_REG, bus, addr) + if err != nil { + return s, err + } + + s.Cal.T3, err = readInt16(CAL_T3_LSB_REG, CAL_T3_MSB_REG, bus, addr) + if err != nil { + return s, err + } + + pu, err := readUInt16(CAL_P1_LSB_REG, CAL_P1_MSB_REG, bus, addr) + if err != nil { + return s, err + } + s.Cal.P1 = int64(pu) + + p, err := readInt16(CAL_P2_LSB_REG, CAL_P2_MSB_REG, bus, addr) + if err != nil { + return s, err + } + s.Cal.P2 = int64(p) + + p, err = readInt16(CAL_P3_LSB_REG, CAL_P3_MSB_REG, bus, addr) + if err != nil { + return s, err + } + s.Cal.P3 = int64(p) + + p, err = readInt16(CAL_P4_LSB_REG, CAL_P4_MSB_REG, bus, addr) + if err != nil { + return s, err + } + s.Cal.P4 = int64(p) + + p, err = readInt16(CAL_P5_LSB_REG, CAL_P5_MSB_REG, bus, addr) + if err != nil { + return s, err + } + s.Cal.P5 = int64(p) + + p, err = readInt16(CAL_P6_LSB_REG, CAL_P6_MSB_REG, bus, addr) + if err != nil { + return s, err + } + s.Cal.P6 = int64(p) + + p, err = readInt16(CAL_P7_LSB_REG, CAL_P7_MSB_REG, bus, addr) + if err != nil { + return s, err + } + s.Cal.P7 = int64(p) + + p, err = readInt16(CAL_P8_LSB_REG, CAL_P8_MSB_REG, bus, addr) + if err != nil { + return s, err + } + s.Cal.P8 = int64(p) + + p, err = readInt16(CAL_P9_LSB_REG, CAL_P9_MSB_REG, bus, addr) + if err != nil { + return s, err + } + s.Cal.P9 = int64(p) + + msb, err = bus.ReadByteFromReg(addr, CAL_H1_REG) + if err != nil { + return s, err + } + s.Cal.H1 = float64(msb) + + h2, err := readInt16(CAL_H2_LSB_REG, CAL_H2_MSB_REG, bus, addr) + if err != nil { + return s, err + } + s.Cal.H2 = float64(h2) + + msb, err = bus.ReadByteFromReg(addr, CAL_H3_REG) + if err != nil { + return s, err + } + s.Cal.H3 = float64(msb) + + // H4 and H5 share three registers. + msb, err = bus.ReadByteFromReg(addr, CAL_H4_MSB_REG) + if err != nil { + return s, err + } + lsb, err = bus.ReadByteFromReg(addr, CAL_H4_LSB_REG) + if err != nil { + return s, err + } + s.Cal.H4 = float64((int16(msb) << 4) | int16(lsb) & 0x0F) + + msb, err = bus.ReadByteFromReg(addr, CAL_H5_MSB_REG) + if err != nil { + return s, err + } + lsb, err = bus.ReadByteFromReg(addr, CAL_H4_LSB_REG) + if err != nil { + return s, err + } + s.Cal.H5 = float64((int16(msb) << 4) | (int16(lsb) >> 4) & 0x0F) + + msb, err = bus.ReadByteFromReg(addr, CAL_H6_REG) + if err != nil { + return s, err + } + s.Cal.H6 = float64(msb) + + fmt.Printf("H1: %f, H2: %f, H3: %f, H4: %f, H5: %f, H6: %f\n", s.Cal.H1, s.Cal.H2, s.Cal.H3, s.Cal.H4, s.Cal.H5, s.Cal.H6) + + // Put the sensor in sleep mode and configure. + err = bus.WriteByteToReg(addr, CTRL_MEAS_REG, 0x00); + if err != nil { + return s, err + } + + // Set the config word. + dataToWrite := (Standby << 0x5) & 0xE0 + dataToWrite = dataToWrite | ((Filter << 0x02) & 0x1C) + err = bus.WriteByteToReg(addr, CONFIG_REG, dataToWrite) + if err != nil { + return s, err + } + + dataToWrite = HumidOverSample & 0x07 + err = bus.WriteByteToReg(addr, CTRL_HUMIDITY_REG, dataToWrite) + if err != nil { + return s, err + } + + dataToWrite = (TempOverSample << 0x5) & 0xE0 + dataToWrite = dataToWrite | ((PressOverSample << 0x02) & 0x1C) + dataToWrite = dataToWrite | (RunMode & 0x03) + err = bus.WriteByteToReg(addr, CTRL_MEAS_REG, dataToWrite) + if err != nil { + return s, err + } + + _, err = bus.ReadByteFromReg(s.Addr, 0xD0) + return s, err +} + +func (s *BME280) fineT() (int32, error) { + adcT, err := readInt24(TMP_XLSB_REG, TMP_LSB_REG, TMP_MSB_REG, s.Bus, s.Addr) + if err != nil { + return 0, err + } + var1 := ((((adcT>>3) - (int32(s.Cal.T1) <<1))) * (int32(s.Cal.T2))) >> 11; + var2 := (((((adcT>>4) - (int32(s.Cal.T1))) * ((adcT>>4) - (int32(s.Cal.T1)))) >> 12) * (int32(s.Cal.T3))) >> 14; + + return (var1 + var2), nil +} + +// Humdity returns the relative humidity. Output value of "46.332" represents 46.332 %rH. +func (s *BME280) Humidity() (float64, error) { + fineT, err := s.fineT() + if err != nil { + return 0, err + } + adcH, err := readUInt16(HUMIDITY_LSB_REG, HUMIDITY_MSB_REG, s.Bus, s.Addr) + if err != nil { + return 0, err + } + + varH := float64(fineT) - 76800.0 + varH = (float64(adcH) - (s.Cal.H4 * 64.0 + s.Cal.H5 / 16384.0 * varH)) * + (s.Cal.H2 / 65536.0 * (1.0 + s.Cal.H6 / 67108864.0 * varH * (1.0 + s.Cal.H3 / 67108864 * varH))) + varH = varH * (1.0 - s.Cal.H1 * varH / 524288.0) + if varH > 100.0 { + varH = 100.0 + } else if varH < 0.0 { + varH = 0.0 + } + + return varH, nil +} + +// Returns the pressure in Pascals. A value of "96386.2" equals 963.862 hPa. +func (s *BME280) Pressure() (float64, error) { + fineT, err := s.fineT() + if err != nil { + return 0, err + } + + adcP, err := readInt24(PRESSURE_XLSB_REG, PRESSURE_LSB_REG, PRESSURE_MSB_REG, s.Bus, s.Addr) + if err != nil { + return 0, err + } + + var1 := int64(fineT) - 128000 + var2 := var1 * var1 * s.Cal.P6 + var2 = var2 + (var1 * s.Cal.P5<<17) + var2 = var2 + (s.Cal.P4<<35) + var1 = (var1 * var1 * s.Cal.P3>>8) + (var1 * s.Cal.P2<<12) + var1 = (((int64(1)<<47)+var1))*s.Cal.P1>>33 + if var1 == 0 { + return 0, nil // avoid exception caused by division by zero + } + p_acc := 1048576 - int64(adcP) + p_acc = (((p_acc<<31) - var2)*3125)/var1 + var1 = (s.Cal.P9 * (p_acc>>13) * (p_acc>>13)) >> 25 + var2 = (s.Cal.P8 * p_acc) >> 19 + p_acc = ((p_acc + var1 + var2) >> 8) + (s.Cal.P7<<4) + + p_acc = p_acc >> 8 // /256 + return float64(p_acc), nil +} + +// Temperature returns the temperature in Degrees Celcius. Output value of "30.33" equals 30.33°C. +func (s *BME280) Temperature() (float64, error) { + fineT, err := s.fineT() + return (float64(fineT) / 5120.0), err +} \ No newline at end of file From f4c803b036efa74e581bbe48b55f476316696789 Mon Sep 17 00:00:00 2001 From: clinton Date: Thu, 29 Sep 2016 13:01:27 +1000 Subject: [PATCH 02/15] Go fmt. --- sensor/bme280/bme280.go | 68 ++++++++++++++++++++--------------------- 1 file changed, 34 insertions(+), 34 deletions(-) diff --git a/sensor/bme280/bme280.go b/sensor/bme280/bme280.go index 1a1d88e..4a9ed3a 100644 --- a/sensor/bme280/bme280.go +++ b/sensor/bme280/bme280.go @@ -34,30 +34,30 @@ const ( CAL_P9_LSB_REG = 0x9E CAL_P9_MSB_REG = 0x9F - CAL_H1_REG = 0xA1 + CAL_H1_REG = 0xA1 CAL_H2_LSB_REG = 0xE1 CAL_H2_MSB_REG = 0xE2 - CAL_H3_REG = 0xE3 + CAL_H3_REG = 0xE3 CAL_H4_MSB_REG = 0xE4 CAL_H4_LSB_REG = 0xE5 CAL_H5_MSB_REG = 0xE6 - CAL_H6_REG = 0xE7 + CAL_H6_REG = 0xE7 - TMP_MSB_REG = 0xFA - TMP_LSB_REG = 0xFB + TMP_MSB_REG = 0xFA + TMP_LSB_REG = 0xFB TMP_XLSB_REG = 0xFC - PRESSURE_MSB_REG = 0xF7 - PRESSURE_LSB_REG = 0xF8 + PRESSURE_MSB_REG = 0xF7 + PRESSURE_LSB_REG = 0xF8 PRESSURE_XLSB_REG = 0xF9 HUMIDITY_MSB_REG = 0xFD HUMIDITY_LSB_REG = 0xFE - CTRL_MEAS_REG = 0xF4 - CONFIG_REG = 0xF5 + CTRL_MEAS_REG = 0xF4 + CONFIG_REG = 0xF5 CTRL_HUMIDITY_REG = 0xF2 - RESET_REG = 0xE0 + RESET_REG = 0xE0 //RunMode can be: // 0, Sleep mode @@ -101,11 +101,11 @@ const ( ) type Calibration struct { - T1 uint16 + T1 uint16 T2, T3 int16 P1, P2, P3, P4, P5, P6, P7, P8, P9 int64 - H1, H2, H3, H4, H5, H6 float64 + H1, H2, H3, H4, H5, H6 float64 } type BME280 struct { @@ -157,7 +157,7 @@ func readInt24(xlsb byte, lsb byte, msb byte, bus embd.I2CBus, addr byte) (int32 return 0, err } - return int32((uint32(msbv) << 12) | (uint32(lsbv) << 4)) | ((int32(xlsbv) >> 4) & 0x0F), nil + return int32((uint32(msbv)<<12)|(uint32(lsbv)<<4)) | ((int32(xlsbv) >> 4) & 0x0F), nil } // New creates and calibrates a connection to a BME280 sensor on the supplied i2c bus @@ -268,7 +268,7 @@ func New(bus embd.I2CBus, addr byte) (*BME280, error) { if err != nil { return s, err } - s.Cal.H4 = float64((int16(msb) << 4) | int16(lsb) & 0x0F) + s.Cal.H4 = float64((int16(msb) << 4) | int16(lsb)&0x0F) msb, err = bus.ReadByteFromReg(addr, CAL_H5_MSB_REG) if err != nil { @@ -278,7 +278,7 @@ func New(bus embd.I2CBus, addr byte) (*BME280, error) { if err != nil { return s, err } - s.Cal.H5 = float64((int16(msb) << 4) | (int16(lsb) >> 4) & 0x0F) + s.Cal.H5 = float64((int16(msb) << 4) | (int16(lsb)>>4)&0x0F) msb, err = bus.ReadByteFromReg(addr, CAL_H6_REG) if err != nil { @@ -289,7 +289,7 @@ func New(bus embd.I2CBus, addr byte) (*BME280, error) { fmt.Printf("H1: %f, H2: %f, H3: %f, H4: %f, H5: %f, H6: %f\n", s.Cal.H1, s.Cal.H2, s.Cal.H3, s.Cal.H4, s.Cal.H5, s.Cal.H6) // Put the sensor in sleep mode and configure. - err = bus.WriteByteToReg(addr, CTRL_MEAS_REG, 0x00); + err = bus.WriteByteToReg(addr, CTRL_MEAS_REG, 0x00) if err != nil { return s, err } @@ -325,8 +325,8 @@ func (s *BME280) fineT() (int32, error) { if err != nil { return 0, err } - var1 := ((((adcT>>3) - (int32(s.Cal.T1) <<1))) * (int32(s.Cal.T2))) >> 11; - var2 := (((((adcT>>4) - (int32(s.Cal.T1))) * ((adcT>>4) - (int32(s.Cal.T1)))) >> 12) * (int32(s.Cal.T3))) >> 14; + var1 := (((adcT >> 3) - (int32(s.Cal.T1) << 1)) * (int32(s.Cal.T2))) >> 11 + var2 := (((((adcT >> 4) - (int32(s.Cal.T1))) * ((adcT >> 4) - (int32(s.Cal.T1)))) >> 12) * (int32(s.Cal.T3))) >> 14 return (var1 + var2), nil } @@ -343,14 +343,14 @@ func (s *BME280) Humidity() (float64, error) { } varH := float64(fineT) - 76800.0 - varH = (float64(adcH) - (s.Cal.H4 * 64.0 + s.Cal.H5 / 16384.0 * varH)) * - (s.Cal.H2 / 65536.0 * (1.0 + s.Cal.H6 / 67108864.0 * varH * (1.0 + s.Cal.H3 / 67108864 * varH))) - varH = varH * (1.0 - s.Cal.H1 * varH / 524288.0) - if varH > 100.0 { - varH = 100.0 - } else if varH < 0.0 { - varH = 0.0 - } + varH = (float64(adcH) - (s.Cal.H4*64.0 + s.Cal.H5/16384.0*varH)) * + (s.Cal.H2 / 65536.0 * (1.0 + s.Cal.H6/67108864.0*varH*(1.0+s.Cal.H3/67108864*varH))) + varH = varH * (1.0 - s.Cal.H1*varH/524288.0) + if varH > 100.0 { + varH = 100.0 + } else if varH < 0.0 { + varH = 0.0 + } return varH, nil } @@ -369,18 +369,18 @@ func (s *BME280) Pressure() (float64, error) { var1 := int64(fineT) - 128000 var2 := var1 * var1 * s.Cal.P6 - var2 = var2 + (var1 * s.Cal.P5<<17) - var2 = var2 + (s.Cal.P4<<35) - var1 = (var1 * var1 * s.Cal.P3>>8) + (var1 * s.Cal.P2<<12) - var1 = (((int64(1)<<47)+var1))*s.Cal.P1>>33 + var2 = var2 + (var1 * s.Cal.P5 << 17) + var2 = var2 + (s.Cal.P4 << 35) + var1 = (var1 * var1 * s.Cal.P3 >> 8) + (var1 * s.Cal.P2 << 12) + var1 = ((int64(1) << 47) + var1) * s.Cal.P1 >> 33 if var1 == 0 { return 0, nil // avoid exception caused by division by zero } p_acc := 1048576 - int64(adcP) - p_acc = (((p_acc<<31) - var2)*3125)/var1 - var1 = (s.Cal.P9 * (p_acc>>13) * (p_acc>>13)) >> 25 + p_acc = (((p_acc << 31) - var2) * 3125) / var1 + var1 = (s.Cal.P9 * (p_acc >> 13) * (p_acc >> 13)) >> 25 var2 = (s.Cal.P8 * p_acc) >> 19 - p_acc = ((p_acc + var1 + var2) >> 8) + (s.Cal.P7<<4) + p_acc = ((p_acc + var1 + var2) >> 8) + (s.Cal.P7 << 4) p_acc = p_acc >> 8 // /256 return float64(p_acc), nil @@ -390,4 +390,4 @@ func (s *BME280) Pressure() (float64, error) { func (s *BME280) Temperature() (float64, error) { fineT, err := s.fineT() return (float64(fineT) / 5120.0), err -} \ No newline at end of file +} From a30c674d712ccbc1f504a0b07ea964f06cd9311b Mon Sep 17 00:00:00 2001 From: clinton Date: Thu, 29 Sep 2016 13:52:29 +1000 Subject: [PATCH 03/15] addded support for the Intel Edison --- detect.go | 5 ++++ host/all/all.go | 1 + host/edison/edison.go.txt | 51 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 57 insertions(+) create mode 100644 host/edison/edison.go.txt diff --git a/detect.go b/detect.go index 93f4500..04f4a57 100644 --- a/detect.go +++ b/detect.go @@ -26,6 +26,9 @@ const ( // HostGalileo represents the Intel Galileo board. HostGalileo = "Intel Galileo" + // HostEdison represents teh Intel Edison board. + HostEdison = "Intel Edison" + // HostCubieTruck represents the Cubie Truck. HostCubieTruck = "CubieTruck" @@ -126,6 +129,8 @@ func DetectHost() (host Host, rev int, err error) { return HostBBB, rev, nil case strings.Contains(hardware, "BCM2708") || strings.Contains(hardware, "BCM2709"): return HostRPi, rev, nil + case strings.Contains(model, "Genuine Intel(R) CPU 4000 @ 500MHz"): + return HostEdison, rev, nil case hardware == "Allwinner sun4i/sun5i Families": if major < 4 || (major == 4 && minor < 4) { return HostNull, 0, fmt.Errorf( diff --git a/host/all/all.go b/host/all/all.go index 5bfd7a9..6111be2 100644 --- a/host/all/all.go +++ b/host/all/all.go @@ -3,5 +3,6 @@ package all import ( _ "github.com/kidoman/embd/host/bbb" + _ "github.com/kidoman/embd/host/edison" _ "github.com/kidoman/embd/host/rpi" ) diff --git a/host/edison/edison.go.txt b/host/edison/edison.go.txt new file mode 100644 index 0000000..7dd9f34 --- /dev/null +++ b/host/edison/edison.go.txt @@ -0,0 +1,51 @@ +/* + Package edison provides Intel Edison support. +*/ +package edison + +import ( + "github.com/kidoman/embd" + "github.com/kidoman/embd/host/generic" +) + +var pins = embd.PinMap{ + &embd.PinDesc{ID: "P1_12", Aliases: []string{"12", "GPIO_12"}, Caps: embd.CapDigital, DigitalLogical: 12}, // PWM? + &embd.PinDesc{ID: "P1_13", Aliases: []string{"13", "GPIO_13"}, Caps: embd.CapDigital, DigitalLogical: 13}, // PWM? + &embd.PinDesc{ID: "P1_14", Aliases: []string{"14", "GPIO_14"}, Caps: embd.CapDigital, DigitalLogical: 14}, + &embd.PinDesc{ID: "P1_15", Aliases: []string{"15", "GPIO_15"}, Caps: embd.CapDigital, DigitalLogical: 15}, + &embd.PinDesc{ID: "P1_44", Aliases: []string{"44", "GPIO_44"}, Caps: embd.CapDigital, DigitalLogical: 44}, + &embd.PinDesc{ID: "P1_45", Aliases: []string{"45", "GPIO_45"}, Caps: embd.CapDigital, DigitalLogical: 45}, + &embd.PinDesc{ID: "P1_46", Aliases: []string{"46", "GPIO_46"}, Caps: embd.CapDigital, DigitalLogical: 46}, + &embd.PinDesc{ID: "P1_47", Aliases: []string{"47", "GPIO_47"}, Caps: embd.CapDigital, DigitalLogical: 47}, + &embd.PinDesc{ID: "P1_48", Aliases: []string{"48", "GPIO_48"}, Caps: embd.CapDigital, DigitalLogical: 48}, + &embd.PinDesc{ID: "P1_49", Aliases: []string{"49", "GPIO_49"}, Caps: embd.CapDigital, DigitalLogical: 49}, + &embd.PinDesc{ID: "P1_128", Aliases: []string{"128", "GPIO_128"}, Caps: embd.CapDigital, DigitalLogical: 128}, //CTS? + &embd.PinDesc{ID: "P1_129", Aliases: []string{"129", "GPIO_129"}, Caps: embd.CapDigital, DigitalLogical: 129}, //RTS? + &embd.PinDesc{ID: "P1_130", Aliases: []string{"130", "GPIO_130", "RXD", "UART0_RXD"}, Caps: embd.CapDigital | embd.CapUART, DigitalLogical: 130}, + &embd.PinDesc{ID: "P1_131", Aliases: []string{"131", "GPIO_131", "TXD", "UART0_TXD"}, Caps: embd.CapDigital | embd.CapUART, DigitalLogical: 131}, + &embd.PinDesc{ID: "P1_182", Aliases: []string{"182", "GPIO_182"}, Caps: embd.CapDigital, DigitalLogical: 182}, // PWM? + &embd.PinDesc{ID: "P1_183", Aliases: []string{"183", "GPIO_183"}, Caps: embd.CapDigital, DigitalLogical: 183}, // PWM? +} + +var ledMap = embd.LEDMap{} + +var spiDeviceMinor = 0 // Check?? + +func init() { + embd.Register(embd.HostEdison, func(rev int) *embd.Descriptor { + return &embd.Descriptor{ + GPIODriver: func() embd.GPIODriver { + return embd.NewGPIODriver(pins, generic.NewDigitalPin, nil, nil) + }, + I2CDriver: func() embd.I2CDriver { + return embd.NewI2CDriver(generic.NewI2CBus) + }, + LEDDriver: func() embd.LEDDriver { + return embd.NewLEDDriver(ledMap, generic.NewLED) + }, + SPIDriver: func() embd.SPIDriver { + return embd.NewSPIDriver(spiDeviceMinor, generic.NewSPIBus, nil) + }, + } + }) +} From ab4a047159e857fad1758110163f986cdfb7f964 Mon Sep 17 00:00:00 2001 From: clinton Date: Thu, 29 Sep 2016 13:56:47 +1000 Subject: [PATCH 04/15] demangled git. --- host/edison/{edison.go.txt => edison.go} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename host/edison/{edison.go.txt => edison.go} (100%) diff --git a/host/edison/edison.go.txt b/host/edison/edison.go similarity index 100% rename from host/edison/edison.go.txt rename to host/edison/edison.go From 2d4affa09b8c1bf82841a8f1491aa680eb6b2800 Mon Sep 17 00:00:00 2001 From: clinton Date: Thu, 29 Sep 2016 15:25:11 +1000 Subject: [PATCH 05/15] burst read for measurements --- sensor/bme280/bme280.go | 79 ++++++++++++++++++++--------------------- 1 file changed, 38 insertions(+), 41 deletions(-) diff --git a/sensor/bme280/bme280.go b/sensor/bme280/bme280.go index 4a9ed3a..a1fc5ff 100644 --- a/sensor/bme280/bme280.go +++ b/sensor/bme280/bme280.go @@ -43,16 +43,17 @@ const ( CAL_H5_MSB_REG = 0xE6 CAL_H6_REG = 0xE7 - TMP_MSB_REG = 0xFA - TMP_LSB_REG = 0xFB - TMP_XLSB_REG = 0xFC + MEASUREMENT_START_REG = 0xF7 + PRESSURE_MSB_IDX = 0 + PRESSURE_LSB_IDX = 1 + PRESSURE_XLSB_IDX = 2 - PRESSURE_MSB_REG = 0xF7 - PRESSURE_LSB_REG = 0xF8 - PRESSURE_XLSB_REG = 0xF9 + TMP_MSB_IDX = 3 + TMP_LSB_IDX = 4 + TMP_XLSB_IDX = 5 - HUMIDITY_MSB_REG = 0xFD - HUMIDITY_LSB_REG = 0xFE + HUMIDITY_MSB_IDX = 6 + HUMIDITY_LSB_IDX = 7 CTRL_MEAS_REG = 0xF4 CONFIG_REG = 0xF5 @@ -320,27 +321,27 @@ func New(bus embd.I2CBus, addr byte) (*BME280, error) { return s, err } -func (s *BME280) fineT() (int32, error) { - adcT, err := readInt24(TMP_XLSB_REG, TMP_LSB_REG, TMP_MSB_REG, s.Bus, s.Addr) - if err != nil { - return 0, err - } +func (s *BME280) fineT(d []byte) int32 { + adcT := int32((uint32(d[TMP_MSB_IDX])<<12)|(uint32(d[TMP_LSB_IDX])<<4)) | ((int32(d[TMP_XLSB_IDX]) >> 4) & 0x0F) + var1 := (((adcT >> 3) - (int32(s.Cal.T1) << 1)) * (int32(s.Cal.T2))) >> 11 var2 := (((((adcT >> 4) - (int32(s.Cal.T1))) * ((adcT >> 4) - (int32(s.Cal.T1)))) >> 12) * (int32(s.Cal.T3))) >> 14 - return (var1 + var2), nil + return (var1 + var2) } -// Humdity returns the relative humidity. Output value of "46.332" represents 46.332 %rH. -func (s *BME280) Humidity() (float64, error) { - fineT, err := s.fineT() - if err != nil { - return 0, err - } - adcH, err := readUInt16(HUMIDITY_LSB_REG, HUMIDITY_MSB_REG, s.Bus, s.Addr) - if err != nil { - return 0, err - } +// Reads all measurements from the sensor. Call Humidity, Pressure or Temperature to retrieve calibrated readings. +func (s *BME280) Measurements() ([]byte, error) { + buf := make([]byte, 8) + err := s.Bus.ReadFromReg(s.Addr, MEASUREMENT_START_REG, buf) + + return buf, err +} + +// Humdity returns the relative humidity from the supplied measurements. Output value of "46.332" represents 46.332 %rH. +func (s *BME280) Humidity(d []byte) float64 { + fineT := s.fineT(d) + adcH := (uint16(d[HUMIDITY_MSB_IDX]) << 8) | uint16(d[HUMIDITY_LSB_IDX]) varH := float64(fineT) - 76800.0 varH = (float64(adcH) - (s.Cal.H4*64.0 + s.Cal.H5/16384.0*varH)) * @@ -352,20 +353,16 @@ func (s *BME280) Humidity() (float64, error) { varH = 0.0 } - return varH, nil + return varH } -// Returns the pressure in Pascals. A value of "96386.2" equals 963.862 hPa. -func (s *BME280) Pressure() (float64, error) { - fineT, err := s.fineT() - if err != nil { - return 0, err - } +// Returns the pressure in Pascals from the supplied measurements. A value of "96386.2" equals 963.862 hPa. +func (s *BME280) Pressure(d []byte) float64 { + fineT := s.fineT(d) - adcP, err := readInt24(PRESSURE_XLSB_REG, PRESSURE_LSB_REG, PRESSURE_MSB_REG, s.Bus, s.Addr) - if err != nil { - return 0, err - } + adcP := int32((uint32(d[PRESSURE_MSB_IDX])<<12)| + (uint32(d[PRESSURE_LSB_IDX])<<4)) | + ((int32(d[PRESSURE_XLSB_IDX]) >> 4) & 0x0F) var1 := int64(fineT) - 128000 var2 := var1 * var1 * s.Cal.P6 @@ -374,7 +371,7 @@ func (s *BME280) Pressure() (float64, error) { var1 = (var1 * var1 * s.Cal.P3 >> 8) + (var1 * s.Cal.P2 << 12) var1 = ((int64(1) << 47) + var1) * s.Cal.P1 >> 33 if var1 == 0 { - return 0, nil // avoid exception caused by division by zero + return 0 // avoid exception caused by division by zero } p_acc := 1048576 - int64(adcP) p_acc = (((p_acc << 31) - var2) * 3125) / var1 @@ -383,11 +380,11 @@ func (s *BME280) Pressure() (float64, error) { p_acc = ((p_acc + var1 + var2) >> 8) + (s.Cal.P7 << 4) p_acc = p_acc >> 8 // /256 - return float64(p_acc), nil + return float64(p_acc) } -// Temperature returns the temperature in Degrees Celcius. Output value of "30.33" equals 30.33°C. -func (s *BME280) Temperature() (float64, error) { - fineT, err := s.fineT() - return (float64(fineT) / 5120.0), err +// Temperature returns the temperature in Degrees Celcius from the supplied measurements. Output value of "30.33" equals 30.33°C. +func (s *BME280) Temperature(d []byte) float64 { + fineT := s.fineT(d) + return (float64(fineT) / 5120.0) } From 207a52644da9129a96f602e97e7006a963187cf9 Mon Sep 17 00:00:00 2001 From: clinton Date: Thu, 29 Sep 2016 20:23:04 +1000 Subject: [PATCH 06/15] removed readInt24 --- sensor/bme280/bme280.go | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/sensor/bme280/bme280.go b/sensor/bme280/bme280.go index a1fc5ff..fa78727 100644 --- a/sensor/bme280/bme280.go +++ b/sensor/bme280/bme280.go @@ -142,25 +142,6 @@ func readInt16(lsb byte, msb byte, bus embd.I2CBus, addr byte) (int16, error) { return (int16(msbv) << 8) | int16(lsbv), nil } -func readInt24(xlsb byte, lsb byte, msb byte, bus embd.I2CBus, addr byte) (int32, error) { - msbv, err := bus.ReadByteFromReg(addr, msb) - if err != nil { - return 0, err - } - - lsbv, err := bus.ReadByteFromReg(addr, lsb) - if err != nil { - return 0, err - } - - xlsbv, err := bus.ReadByteFromReg(addr, xlsb) - if err != nil { - return 0, err - } - - return int32((uint32(msbv)<<12)|(uint32(lsbv)<<4)) | ((int32(xlsbv) >> 4) & 0x0F), nil -} - // New creates and calibrates a connection to a BME280 sensor on the supplied i2c bus // at the nominated i2c address. func New(bus embd.I2CBus, addr byte) (*BME280, error) { @@ -287,8 +268,6 @@ func New(bus embd.I2CBus, addr byte) (*BME280, error) { } s.Cal.H6 = float64(msb) - fmt.Printf("H1: %f, H2: %f, H3: %f, H4: %f, H5: %f, H6: %f\n", s.Cal.H1, s.Cal.H2, s.Cal.H3, s.Cal.H4, s.Cal.H5, s.Cal.H6) - // Put the sensor in sleep mode and configure. err = bus.WriteByteToReg(addr, CTRL_MEAS_REG, 0x00) if err != nil { From cd02a9fd526375cdeae09c5729fdf3d4ae22e89c Mon Sep 17 00:00:00 2001 From: clinton Date: Thu, 29 Sep 2016 20:32:39 +1000 Subject: [PATCH 07/15] remove fmt --- sensor/bme280/bme280.go | 1 - 1 file changed, 1 deletion(-) diff --git a/sensor/bme280/bme280.go b/sensor/bme280/bme280.go index fa78727..09174ad 100644 --- a/sensor/bme280/bme280.go +++ b/sensor/bme280/bme280.go @@ -3,7 +3,6 @@ package bme280 import ( - "fmt" "github.com/kidoman/embd" ) From 0bc708839d2295cb5638dee97b53452ed05233e5 Mon Sep 17 00:00:00 2001 From: clinton Date: Thu, 29 Sep 2016 21:44:03 +1000 Subject: [PATCH 08/15] added support for the pcal9535 --- controller/pcal9535a/pcal9535a.go | 43 +++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 controller/pcal9535a/pcal9535a.go diff --git a/controller/pcal9535a/pcal9535a.go b/controller/pcal9535a/pcal9535a.go new file mode 100644 index 0000000..7dad5a9 --- /dev/null +++ b/controller/pcal9535a/pcal9535a.go @@ -0,0 +1,43 @@ +// PCAL953A, 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/kidoman/embd" +) + +const ( + REG_MODE = 0x06 +) + +type PCAL9535A struct { + Bus embd.I2CBus + Addr byte + D byte +} + +// New creates and connects to a PCAL9535A GPIO expander. +func New(bus embd.I2CBus, addr byte) (*PCAL9535A, error) { + return &PCAL9535A{ + Bus: bus, + Addr: addr, + D: 0xff, + }, bus.WriteByteToReg(addr, REG_MODE, 0xff) +} + +// Sets the nominated GPIO pin to either high (on = true) or low (on = false) +func (c *PCAL9535A) SetPin(pin uint, on bool) error { + if on { + c.D &= ^(byte(0x1) << pin) + } else { + c.D |= (byte(0x1) << pin) + } + + return c.Bus.WriteByteToReg(c.Addr, REG_MODE, c.D) +} + +func (c *PCAL9535A) GetPin(pin uint) bool { + return (((c.D >> pin) & 1) == 0) +} From 9a25ce11c37dfcf2b6abdc301eb6f03c9cd35e54 Mon Sep 17 00:00:00 2001 From: clinton Date: Sat, 20 May 2017 18:36:48 +1000 Subject: [PATCH 09/15] Standalone fork no longer dependant on the original. --- CONTRIBUTING.md | 4 +- README.md | 88 ++++++++++++------------- controller/hd44780/hd44780.go | 2 +- controller/hd44780/hd44780_test.go | 2 +- controller/mcp4725/mcp4725.go | 2 +- controller/pca9685/pca9685.go | 4 +- controller/pcal9535a/pcal9535a.go | 2 +- convertors/mcp3008/mcp3008.go | 2 +- detect.go | 2 +- doc.go | 20 +++--- embd/detect.go | 2 +- embd/main.go | 2 +- host/all/all.go | 6 +- host/bbb/analogpin.go | 2 +- host/bbb/analogpin_test.go | 2 +- host/bbb/bbb.go | 4 +- host/bbb/pwmpin.go | 4 +- host/bbb/pwmpin_test.go | 2 +- host/chip/README.md | 6 +- host/chip/chip.go | 4 +- host/edison/edison.go | 4 +- host/generic/digitalpin.go | 2 +- host/generic/digitalpin_test.go | 2 +- host/generic/i2cbus.go | 2 +- host/generic/interrupt.go | 2 +- host/generic/led.go | 2 +- host/generic/spibus.go | 2 +- host/rpi/rpi.go | 4 +- interface/keypad/matrix4x3/matrix4x3.go | 2 +- motion/servo/servo.go | 2 +- samples/28bjy-48.go | 4 +- samples/analog.go | 4 +- samples/analogshort.go | 4 +- samples/bh1750fvi.go | 6 +- samples/bmp085.go | 6 +- samples/bmp180.go | 6 +- samples/characterdisplay.go | 8 +-- samples/fullblinker.go | 4 +- samples/gpio.go | 4 +- samples/gpiodetect.go | 4 +- samples/gpiodirect.go | 4 +- samples/gpiointerrupt.go | 4 +- samples/gpioshort.go | 4 +- samples/hd44780.go | 6 +- samples/keypad/matrix4x3.go | 4 +- samples/l3gd20.go | 6 +- samples/led.go | 4 +- samples/ledshort.go | 4 +- samples/lsm303.go | 6 +- samples/mcp3008.go | 6 +- samples/mcp4725.go | 6 +- samples/pca9685.go | 6 +- samples/pwm.go | 6 +- samples/servo.go | 8 +-- samples/servobbb.go | 6 +- samples/servoblaster.go | 6 +- samples/simpleblinker.go | 4 +- samples/spi.go | 4 +- samples/spimcp3008.go | 4 +- samples/tmp006.go | 6 +- samples/universalblinker.go | 4 +- samples/us020.go | 6 +- samples/watersensor.go | 6 +- sensor/bh1750fvi/bh1750fvi.go | 2 +- sensor/bme280/bme280.go | 2 +- sensor/bmp085/bmp085.go | 2 +- sensor/bmp180/bmp180.go | 2 +- sensor/l3gd20/l3gd20.go | 2 +- sensor/lsm303/lsm303.go | 2 +- sensor/tmp006/tmp006.go | 2 +- sensor/us020/us020.go | 2 +- sensor/watersensor/watersensor.go | 2 +- 72 files changed, 187 insertions(+), 187 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 975aca7..d503cd1 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -3,7 +3,7 @@ This actually is really simple. A few simple guidelines and we can break for dinner: * EMBD is designed with a lot of affection, with utmost importance given to the dev experience (read: the API feel and style.) So always think from that angle when creating the pull request -* [Documentation](https://godoc.org/github.com/kidoman/embd) helps drive adoption. No exceptions +* [Documentation](https://godoc.org/github.com/cfreeman/embd) helps drive adoption. No exceptions When it comes to the code: @@ -23,7 +23,7 @@ When it comes to the code: this is inspired by Dave Cheney's gpio library and his work on EPOLL ``` -* Individual lines must be wrapped at the 70-char limit. Yeah, old school +* Individual lines must be wrapped at the 70-char limit. Yeah, old school * No trailing '.' And: diff --git a/README.md b/README.md index 93896f8..920a219 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# embd [![Build Status](https://travis-ci.org/kidoman/embd.svg?branch=master)](https://travis-ci.org/kidoman/embd) [![GoDoc](http://godoc.org/github.com/kidoman/embd?status.png)](http://godoc.org/github.com/kidoman/embd) +# embd [![Build Status](https://travis-ci.org/kidoman/embd.svg?branch=master)](https://travis-ci.org/kidoman/embd) [![GoDoc](http://godoc.org/github.com/cfreeman/embd?status.png)](http://godoc.org/github.com/cfreeman/embd) **embd** is a hardware abstraction layer (HAL) for embedded systems. @@ -21,7 +21,7 @@ that are connected to gpio pins or one of the buses. Development supported and sponsored by [**SoStronk**](https://www.sostronk.com) and [**ThoughtWorks**](http://www.thoughtworks.com/). -Also, you might be interested in: [Why Golang?](https://github.com/kidoman/embd/wiki/Why-Go) +Also, you might be interested in: [Why Golang?](https://github.com/cfreeman/embd/wiki/Why-Go) [Blog post introducing EMBD](http://kidoman.io/framework/embd.html) @@ -37,8 +37,8 @@ package main import ( "time" - "github.com/kidoman/embd" - _ "github.com/kidoman/embd/host/rpi" // This loads the RPi driver + "github.com/cfreeman/embd" + _ "github.com/cfreeman/embd/host/rpi" // This loads the RPi driver ) func main() { @@ -51,7 +51,7 @@ func main() { Then install the EMBD package: - $ go get github.com/kidoman/embd + $ go get github.com/cfreeman/embd Build the binary for linux/ARM: @@ -74,7 +74,7 @@ Then on the rPi run the program with ```sudo```*: * Assuming your RaspberryPi has an IP address of ```192.168.2.2```. Substitute as necessary * `sudo` (root) permission is required as we are controlling the hardware by writing to special files * This sample program is optimized for brevity and does not clean up after itself. Click here to - see the [full version](https://github.com/kidoman/embd/blob/master/samples/fullblinker.go) + see the [full version](https://github.com/cfreeman/embd/blob/master/samples/fullblinker.go) ## Getting Help @@ -89,7 +89,7 @@ Join the [slack channel](https://gophers.slack.com/archives/embd) ## The command line tool - go get github.com/kidoman/embd/embd + go get github.com/cfreeman/embd/embd will install a command line utility ```embd``` which will allow you to quickly get started with prototyping. The binary should be available in your ```$GOPATH/bin```. However, to be able to run this on a ARM based device, you will need to build it with ```GOOS=linux``` and ```GOARCH=arm``` environment variables set. @@ -107,14 +107,14 @@ Package **embd** provides a hardware abstraction layer for doing embedded progra on supported platforms like the Raspberry Pi and BeagleBone Black. Most of the examples below will work without change (i.e. the same binary) on all supported platforms. How cool is that? -Although samples are all present in the [samples](https://github.com/kidoman/embd/tree/master/samples) folder, +Although samples are all present in the [samples](https://github.com/cfreeman/embd/tree/master/samples) folder, we will show a few choice examples here. Use the **LED** driver to toggle LEDs on the BBB: ```go -import "github.com/kidoman/embd" -import _ "github.com/kidoman/embd/host/all" +import "github.com/cfreeman/embd" +import _ "github.com/cfreeman/embd/host/all" ... embd.InitLED() defer embd.CloseLED() @@ -127,8 +127,8 @@ led.Toggle() Even shorter when quickly trying things out: ```go -import "github.com/kidoman/embd" -import _ "github.com/kidoman/embd/host/all" +import "github.com/cfreeman/embd" +import _ "github.com/cfreeman/embd/host/all" ... embd.InitLED() defer embd.CloseLED() @@ -141,8 +141,8 @@ embd.ToggleLED(3) BBB + **PWM**: ```go -import "github.com/kidoman/embd" -import _ "github.com/kidoman/embd/host/all" +import "github.com/cfreeman/embd" +import _ "github.com/cfreeman/embd/host/all" ... embd.InitGPIO() defer embd.CloseGPIO() @@ -156,8 +156,8 @@ pwm.SetDuty(1000) Control **GPIO** pins on the RaspberryPi / BeagleBone Black: ```go -import "github.com/kidoman/embd" -import _ "github.com/kidoman/embd/host/all" +import "github.com/cfreeman/embd" +import _ "github.com/cfreeman/embd/host/all" ... embd.InitGPIO() defer embd.CloseGPIO() @@ -169,8 +169,8 @@ embd.DigitalWrite(10, embd.High) Could also do: ```go -import "github.com/kidoman/embd" -import _ "github.com/kidoman/embd/host/all" +import "github.com/cfreeman/embd" +import _ "github.com/cfreeman/embd/host/all" ... embd.InitGPIO() defer embd.CloseGPIO() @@ -184,9 +184,9 @@ pin.Write(embd.High) Or read data from the **Bosch BMP085** barometric sensor: ```go -import "github.com/kidoman/embd" -import "github.com/kidoman/embd/sensor/bmp085" -import _ "github.com/kidoman/embd/host/all" +import "github.com/cfreeman/embd" +import "github.com/cfreeman/embd/sensor/bmp085" +import _ "github.com/cfreeman/embd/host/all" ... bus := embd.NewI2CBus(1) ... @@ -199,9 +199,9 @@ altitude, err := baro.Altitude() Even find out the heading from the **LSM303** magnetometer: ```go -import "github.com/kidoman/embd" -import "github.com/kidoman/embd/sensor/lsm303" -import _ "github.com/kidoman/embd/host/all" +import "github.com/cfreeman/embd" +import "github.com/cfreeman/embd/sensor/lsm303" +import _ "github.com/cfreeman/embd/host/all" ... bus := embd.NewI2CBus(1) ... @@ -215,22 +215,22 @@ platforms. ## Protocols Supported -* **Digital GPIO** [Documentation](http://godoc.org/github.com/kidoman/embd#DigitalPin) -* **Analog GPIO** [Documentation](http://godoc.org/github.com/kidoman/embd#AnalogPin) -* **PWM** [Documentation](http://godoc.org/github.com/kidoman/embd#PWMPin) -* **I2C** [Documentation](http://godoc.org/github.com/kidoman/embd#I2CBus) -* **LED** [Documentation](http://godoc.org/github.com/kidoman/embd#LED) -* **SPI** [Documentation](http://godoc.org/github.com/kidoman/embd#SPIBus) +* **Digital GPIO** [Documentation](http://godoc.org/github.com/cfreeman/embd#DigitalPin) +* **Analog GPIO** [Documentation](http://godoc.org/github.com/cfreeman/embd#AnalogPin) +* **PWM** [Documentation](http://godoc.org/github.com/cfreeman/embd#PWMPin) +* **I2C** [Documentation](http://godoc.org/github.com/cfreeman/embd#I2CBus) +* **LED** [Documentation](http://godoc.org/github.com/cfreeman/embd#LED) +* **SPI** [Documentation](http://godoc.org/github.com/cfreeman/embd#SPIBus) ## Sensors Supported -* **TMP006** Thermopile sensor [Documentation](http://godoc.org/github.com/kidoman/embd/sensor/tmp006), [Datasheet](http://www.adafruit.com/datasheets/tmp006.pdf), [Userguide](http://www.adafruit.com/datasheets/tmp006ug.pdf) -* **BMP085** Barometric pressure sensor [Documentation](http://godoc.org/github.com/kidoman/embd/sensor/bmp085), [Datasheet](https://www.sparkfun.com/datasheets/Components/General/BST-BMP085-DS000-05.pdf) -* **BMP180** Barometric pressure sensor [Documentation](http://godoc.org/github.com/kidoman/embd/sensor/bmp180), [Datasheet](http://www.adafruit.com/datasheets/BST-BMP180-DS000-09.pdf) -* **LSM303** Accelerometer and magnetometer [Documentation](http://godoc.org/github.com/kidoman/embd/sensor/lsm303), [Datasheet](https://www.sparkfun.com/datasheets/Sensors/Magneto/LSM303%20Datasheet.pdf) -* **L3GD20** Gyroscope [Documentation](http://godoc.org/github.com/kidoman/embd/sensor/l3gd20), [Datasheet](http://www.adafruit.com/datasheets/L3GD20.pdf) -* **US020** Ultrasonic proximity sensor [Documentation](http://godoc.org/github.com/kidoman/embd/sensor/us020), [Product Page](http://www.digibay.in/sensor/object-detection-and-proximity?product_id=239) -* **BH1750FVI** Luminosity sensor [Documentation](http://godoc.org/github.com/kidoman/embd/sensor/bh1750fvi), [Datasheet](http://www.elechouse.com/elechouse/images/product/Digital%20light%20Sensor/bh1750fvi-e.pdf) +* **TMP006** Thermopile sensor [Documentation](http://godoc.org/github.com/cfreeman/embd/sensor/tmp006), [Datasheet](http://www.adafruit.com/datasheets/tmp006.pdf), [Userguide](http://www.adafruit.com/datasheets/tmp006ug.pdf) +* **BMP085** Barometric pressure sensor [Documentation](http://godoc.org/github.com/cfreeman/embd/sensor/bmp085), [Datasheet](https://www.sparkfun.com/datasheets/Components/General/BST-BMP085-DS000-05.pdf) +* **BMP180** Barometric pressure sensor [Documentation](http://godoc.org/github.com/cfreeman/embd/sensor/bmp180), [Datasheet](http://www.adafruit.com/datasheets/BST-BMP180-DS000-09.pdf) +* **LSM303** Accelerometer and magnetometer [Documentation](http://godoc.org/github.com/cfreeman/embd/sensor/lsm303), [Datasheet](https://www.sparkfun.com/datasheets/Sensors/Magneto/LSM303%20Datasheet.pdf) +* **L3GD20** Gyroscope [Documentation](http://godoc.org/github.com/cfreeman/embd/sensor/l3gd20), [Datasheet](http://www.adafruit.com/datasheets/L3GD20.pdf) +* **US020** Ultrasonic proximity sensor [Documentation](http://godoc.org/github.com/cfreeman/embd/sensor/us020), [Product Page](http://www.digibay.in/sensor/object-detection-and-proximity?product_id=239) +* **BH1750FVI** Luminosity sensor [Documentation](http://godoc.org/github.com/cfreeman/embd/sensor/bh1750fvi), [Datasheet](http://www.elechouse.com/elechouse/images/product/Digital%20light%20Sensor/bh1750fvi-e.pdf) ## Interfaces @@ -238,9 +238,9 @@ platforms. ## Controllers -* **PCA9685** 16-channel, 12-bit PWM Controller with I2C protocol [Documentation](http://godoc.org/github.com/kidoman/embd/controller/pca9685), [Datasheet](http://www.adafruit.com/datasheets/PCA9685.pdf), [Product Page](http://www.adafruit.com/products/815) -* **MCP4725** 12-bit DAC [Documentation](http://godoc.org/github.com/kidoman/embd/controller/mcp4725), [Datasheet](http://www.adafruit.com/datasheets/mcp4725.pdf), [Product Page](http://www.adafruit.com/products/935) -* **ServoBlaster** RPi PWM/PCM based PWM controller [Documentation](http://godoc.org/github.com/kidoman/embd/controller/servoblaster), [Product Page](https://github.com/richardghirst/PiBits/tree/master/ServoBlaster) +* **PCA9685** 16-channel, 12-bit PWM Controller with I2C protocol [Documentation](http://godoc.org/github.com/cfreeman/embd/controller/pca9685), [Datasheet](http://www.adafruit.com/datasheets/PCA9685.pdf), [Product Page](http://www.adafruit.com/products/815) +* **MCP4725** 12-bit DAC [Documentation](http://godoc.org/github.com/cfreeman/embd/controller/mcp4725), [Datasheet](http://www.adafruit.com/datasheets/mcp4725.pdf), [Product Page](http://www.adafruit.com/products/935) +* **ServoBlaster** RPi PWM/PCM based PWM controller [Documentation](http://godoc.org/github.com/cfreeman/embd/controller/servoblaster), [Product Page](https://github.com/richardghirst/PiBits/tree/master/ServoBlaster) ## Convertors @@ -248,12 +248,12 @@ platforms. ## Contributing -[Pull requests](https://github.com/kidoman/embd/pulls) that follow the -[guidelines](https://github.com/kidoman/embd/blob/master/CONTRIBUTING.md) are very appreciated. +[Pull requests](https://github.com/cfreeman/embd/pulls) that follow the +[guidelines](https://github.com/cfreeman/embd/blob/master/CONTRIBUTING.md) are very appreciated. If you find a problem but are not up to coding a fix please file an -[issue](https://github.com/kidoman/embd/issues). +[issue](https://github.com/cfreeman/embd/issues). Thank you! ## About -EMBD is affectionately designed/developed by Karan Misra ([kidoman](https://github.com/kidoman)), Kunal Powar ([kunalpowar](https://github.com/kunalpowar)) and [FRIENDS](https://github.com/kidoman/embd/blob/master/AUTHORS). We also have a list of [CONTRIBUTORS](https://github.com/kidoman/embd/blob/master/CONTRIBUTORS). +EMBD is affectionately designed/developed by Karan Misra ([kidoman](https://github.com/kidoman)), Kunal Powar ([kunalpowar](https://github.com/kunalpowar)) and [FRIENDS](https://github.com/cfreeman/embd/blob/master/AUTHORS). We also have a list of [CONTRIBUTORS](https://github.com/cfreeman/embd/blob/master/CONTRIBUTORS). diff --git a/controller/hd44780/hd44780.go b/controller/hd44780/hd44780.go index 88032d5..45eae34 100644 --- a/controller/hd44780/hd44780.go +++ b/controller/hd44780/hd44780.go @@ -16,7 +16,7 @@ import ( "time" "github.com/golang/glog" - "github.com/kidoman/embd" + "github.com/cfreeman/embd" ) type entryMode byte diff --git a/controller/hd44780/hd44780_test.go b/controller/hd44780/hd44780_test.go index eee375d..500d1bf 100644 --- a/controller/hd44780/hd44780_test.go +++ b/controller/hd44780/hd44780_test.go @@ -6,7 +6,7 @@ import ( "testing" "time" - "github.com/kidoman/embd" + "github.com/cfreeman/embd" ) const ( diff --git a/controller/mcp4725/mcp4725.go b/controller/mcp4725/mcp4725.go index 1dcaa91..169d13b 100644 --- a/controller/mcp4725/mcp4725.go +++ b/controller/mcp4725/mcp4725.go @@ -5,7 +5,7 @@ import ( "sync" "github.com/golang/glog" - "github.com/kidoman/embd" + "github.com/cfreeman/embd" ) const ( diff --git a/controller/pca9685/pca9685.go b/controller/pca9685/pca9685.go index 9a9407d..a9e9545 100644 --- a/controller/pca9685/pca9685.go +++ b/controller/pca9685/pca9685.go @@ -7,8 +7,8 @@ import ( "time" "github.com/golang/glog" - "github.com/kidoman/embd" - "github.com/kidoman/embd/util" + "github.com/cfreeman/embd" + "github.com/cfreeman/embd/util" ) const ( diff --git a/controller/pcal9535a/pcal9535a.go b/controller/pcal9535a/pcal9535a.go index 7dad5a9..8322a5e 100644 --- a/controller/pcal9535a/pcal9535a.go +++ b/controller/pcal9535a/pcal9535a.go @@ -5,7 +5,7 @@ package pcal9535a import ( - "github.com/kidoman/embd" + "github.com/cfreeman/embd" ) const ( diff --git a/convertors/mcp3008/mcp3008.go b/convertors/mcp3008/mcp3008.go index e5ecb99..1b21752 100644 --- a/convertors/mcp3008/mcp3008.go +++ b/convertors/mcp3008/mcp3008.go @@ -3,7 +3,7 @@ package mcp3008 import ( "github.com/golang/glog" - "github.com/kidoman/embd" + "github.com/cfreeman/embd" ) // MCP3008 represents a mcp3008 8bit DAC. diff --git a/detect.go b/detect.go index 9f6c6b4..91a3f7e 100644 --- a/detect.go +++ b/detect.go @@ -139,6 +139,6 @@ func DetectHost() (host Host, rev int, err error) { } return HostCHIP, rev, nil default: - return HostNull, 0, fmt.Errorf(`embd: your host "%v:%v" is not supported at this moment. request support at https://github.com/kidoman/embd/issues`, host, model) + return HostNull, 0, fmt.Errorf(`embd: your host "%v:%v" is not supported at this moment. request support at https://github.com/cfreeman/embd/issues`, host, model) } } diff --git a/doc.go b/doc.go index a31cab1..e752408 100644 --- a/doc.go +++ b/doc.go @@ -22,7 +22,7 @@ called as 1-liners instead of first instantiating a DigitalPin and then writing To get started a host driver needs to be registered with the top-level embd package. This is most easily accomplished by doing an "underscore import" on of the sub-packages of embd/host, -e.g., `import _ "github.com/kidoman/embd/host/chip"`. An `Init()` function in the host driver +e.g., `import _ "github.com/cfreeman/embd/host/chip"`. An `Init()` function in the host driver registers all the individual drivers with embd. After getting the host driver the next step might be to instantiate a GPIO pin using @@ -38,7 +38,7 @@ This section shows a few choice samples, more are available in the samples folde Use the LED driver to toggle LEDs on the BBB: - import "github.com/kidoman/embd" + import "github.com/cfreeman/embd" ... embd.InitLED() defer embd.CloseLED() @@ -49,7 +49,7 @@ Use the LED driver to toggle LEDs on the BBB: Even shorter while prototyping: - import "github.com/kidoman/embd" + import "github.com/cfreeman/embd" ... embd.InitLED() defer embd.CloseLED() @@ -58,7 +58,7 @@ Even shorter while prototyping: BBB + PWM: - import "github.com/kidoman/embd" + import "github.com/cfreeman/embd" ... embd.InitGPIO() defer embd.CloseGPIO() @@ -70,7 +70,7 @@ BBB + PWM: Control GPIO pins on the RaspberryPi / BeagleBone Black: - import "github.com/kidoman/embd" + import "github.com/cfreeman/embd" ... embd.InitGPIO() defer embd.CloseGPIO() @@ -80,7 +80,7 @@ Control GPIO pins on the RaspberryPi / BeagleBone Black: Could also do: - import "github.com/kidoman/embd" + import "github.com/cfreeman/embd" ... embd.InitGPIO() defer embd.CloseGPIO() @@ -92,8 +92,8 @@ Could also do: Or read data from the Bosch BMP085 barometric sensor: - import "github.com/kidoman/embd" - import "github.com/kidoman/embd/sensor/bmp085" + import "github.com/cfreeman/embd" + import "github.com/cfreeman/embd/sensor/bmp085" ... bus := embd.NewI2CBus(1) ... @@ -104,8 +104,8 @@ Or read data from the Bosch BMP085 barometric sensor: Even find out the heading from the LSM303 magnetometer: - import "github.com/kidoman/embd" - import "github.com/kidoman/embd/sensor/lsm303" + import "github.com/cfreeman/embd" + import "github.com/cfreeman/embd/sensor/lsm303" ... bus := embd.NewI2CBus(1) ... diff --git a/embd/detect.go b/embd/detect.go index 6659980..183ce08 100644 --- a/embd/detect.go +++ b/embd/detect.go @@ -5,7 +5,7 @@ import ( "os" "github.com/codegangsta/cli" - "github.com/kidoman/embd" + "github.com/cfreeman/embd" ) func detect(c *cli.Context) { diff --git a/embd/main.go b/embd/main.go index 7ea7424..7e50047 100644 --- a/embd/main.go +++ b/embd/main.go @@ -4,7 +4,7 @@ import ( "os" "github.com/codegangsta/cli" - _ "github.com/kidoman/embd/host/all" + _ "github.com/cfreeman/embd/host/all" ) var version = "0.1.0" diff --git a/host/all/all.go b/host/all/all.go index 6111be2..73fd03f 100644 --- a/host/all/all.go +++ b/host/all/all.go @@ -2,7 +2,7 @@ package all import ( - _ "github.com/kidoman/embd/host/bbb" - _ "github.com/kidoman/embd/host/edison" - _ "github.com/kidoman/embd/host/rpi" + _ "github.com/cfreeman/embd/host/bbb" + _ "github.com/cfreeman/embd/host/edison" + _ "github.com/cfreeman/embd/host/rpi" ) diff --git a/host/bbb/analogpin.go b/host/bbb/analogpin.go index e12b9dd..1f98f43 100644 --- a/host/bbb/analogpin.go +++ b/host/bbb/analogpin.go @@ -9,7 +9,7 @@ import ( "strconv" "strings" - "github.com/kidoman/embd" + "github.com/cfreeman/embd" ) type analogPin struct { diff --git a/host/bbb/analogpin_test.go b/host/bbb/analogpin_test.go index 49f22cb..b43742b 100644 --- a/host/bbb/analogpin_test.go +++ b/host/bbb/analogpin_test.go @@ -3,7 +3,7 @@ package bbb import ( "testing" - "github.com/kidoman/embd" + "github.com/cfreeman/embd" ) func TestAnalogPinClose(t *testing.T) { diff --git a/host/bbb/bbb.go b/host/bbb/bbb.go index 1f42d7d..c5e4bbc 100644 --- a/host/bbb/bbb.go +++ b/host/bbb/bbb.go @@ -16,8 +16,8 @@ import ( "strings" "github.com/golang/glog" - "github.com/kidoman/embd" - "github.com/kidoman/embd/host/generic" + "github.com/cfreeman/embd" + "github.com/cfreeman/embd/host/generic" ) var pins = embd.PinMap{ diff --git a/host/bbb/pwmpin.go b/host/bbb/pwmpin.go index 1bd6c95..eb2234e 100644 --- a/host/bbb/pwmpin.go +++ b/host/bbb/pwmpin.go @@ -11,8 +11,8 @@ import ( "time" "github.com/golang/glog" - "github.com/kidoman/embd" - "github.com/kidoman/embd/util" + "github.com/cfreeman/embd" + "github.com/cfreeman/embd/util" ) const ( diff --git a/host/bbb/pwmpin_test.go b/host/bbb/pwmpin_test.go index 1c07ff3..17aef96 100644 --- a/host/bbb/pwmpin_test.go +++ b/host/bbb/pwmpin_test.go @@ -3,7 +3,7 @@ package bbb import ( "testing" - "github.com/kidoman/embd" + "github.com/cfreeman/embd" ) func TestPWMPinClose(t *testing.T) { diff --git a/host/chip/README.md b/host/chip/README.md index 51fd49e..dc08314 100644 --- a/host/chip/README.md +++ b/host/chip/README.md @@ -1,7 +1,7 @@ # Using embd on CHIP The CHIP drivers support gpio, I2C, SPI, and pin interrupts. Not supported are PWM or LED. -The names of the pins on chip have multiple aliases. The official CHIP pin names are supported, +The names of the pins on chip have multiple aliases. The official CHIP pin names are supported, for example XIO-P1 or LCD-D2 and the pin number are also supported, such as U14-14 (same as XIO-P1) or U13-17. Some of the alternate function names are also supported, like "SPI2_MOSI", and the linux 4.4 kernel gpio pin numbers as well, e.g., 1017 for XIO-P1. Finally, the official GPIO pins @@ -13,8 +13,8 @@ A simple demo to blink an LED connected with a small resistor between XIO-P6 and package main import ( "time" - "github.com/kidoman/embd" - _ "github.com/kidoman/embd/host/chip" + "github.com/cfreeman/embd" + _ "github.com/cfreeman/embd/host/chip" ) func main() { diff --git a/host/chip/chip.go b/host/chip/chip.go index d849df4..cdd6855 100644 --- a/host/chip/chip.go +++ b/host/chip/chip.go @@ -14,8 +14,8 @@ package chip import ( - "github.com/kidoman/embd" - "github.com/kidoman/embd/host/generic" + "github.com/cfreeman/embd" + "github.com/cfreeman/embd/host/generic" ) var spiDeviceMinor = 32766 diff --git a/host/edison/edison.go b/host/edison/edison.go index 7dd9f34..e675684 100644 --- a/host/edison/edison.go +++ b/host/edison/edison.go @@ -4,8 +4,8 @@ package edison import ( - "github.com/kidoman/embd" - "github.com/kidoman/embd/host/generic" + "github.com/cfreeman/embd" + "github.com/cfreeman/embd/host/generic" ) var pins = embd.PinMap{ diff --git a/host/generic/digitalpin.go b/host/generic/digitalpin.go index 525eeb4..1e50a27 100644 --- a/host/generic/digitalpin.go +++ b/host/generic/digitalpin.go @@ -13,7 +13,7 @@ import ( "syscall" "time" - "github.com/kidoman/embd" + "github.com/cfreeman/embd" ) type digitalPin struct { diff --git a/host/generic/digitalpin_test.go b/host/generic/digitalpin_test.go index 18e900e..198d05a 100644 --- a/host/generic/digitalpin_test.go +++ b/host/generic/digitalpin_test.go @@ -3,7 +3,7 @@ package generic import ( "testing" - "github.com/kidoman/embd" + "github.com/cfreeman/embd" ) func TestDigitalPinClose(t *testing.T) { diff --git a/host/generic/i2cbus.go b/host/generic/i2cbus.go index fbe6f55..0f38510 100644 --- a/host/generic/i2cbus.go +++ b/host/generic/i2cbus.go @@ -12,7 +12,7 @@ import ( "unsafe" "github.com/golang/glog" - "github.com/kidoman/embd" + "github.com/cfreeman/embd" ) const ( diff --git a/host/generic/interrupt.go b/host/generic/interrupt.go index 7f9b766..d12695f 100644 --- a/host/generic/interrupt.go +++ b/host/generic/interrupt.go @@ -8,7 +8,7 @@ import ( "sync" "syscall" - "github.com/kidoman/embd" + "github.com/cfreeman/embd" ) const ( diff --git a/host/generic/led.go b/host/generic/led.go index 67f56c9..b3ca546 100644 --- a/host/generic/led.go +++ b/host/generic/led.go @@ -8,7 +8,7 @@ import ( "os" "strings" - "github.com/kidoman/embd" + "github.com/cfreeman/embd" ) type led struct { diff --git a/host/generic/spibus.go b/host/generic/spibus.go index a33576f..439cd46 100644 --- a/host/generic/spibus.go +++ b/host/generic/spibus.go @@ -8,7 +8,7 @@ import ( "unsafe" "github.com/golang/glog" - "github.com/kidoman/embd" + "github.com/cfreeman/embd" ) const ( diff --git a/host/rpi/rpi.go b/host/rpi/rpi.go index 9279ca8..5137942 100644 --- a/host/rpi/rpi.go +++ b/host/rpi/rpi.go @@ -9,8 +9,8 @@ package rpi import ( - "github.com/kidoman/embd" - "github.com/kidoman/embd/host/generic" + "github.com/cfreeman/embd" + "github.com/cfreeman/embd/host/generic" ) var spiDeviceMinor = 0 diff --git a/interface/keypad/matrix4x3/matrix4x3.go b/interface/keypad/matrix4x3/matrix4x3.go index 6ef984f..fcfe60f 100644 --- a/interface/keypad/matrix4x3/matrix4x3.go +++ b/interface/keypad/matrix4x3/matrix4x3.go @@ -6,7 +6,7 @@ import ( "sync" "time" - "github.com/kidoman/embd" + "github.com/cfreeman/embd" ) type Key int diff --git a/motion/servo/servo.go b/motion/servo/servo.go index c0876d2..2246077 100644 --- a/motion/servo/servo.go +++ b/motion/servo/servo.go @@ -3,7 +3,7 @@ package servo import ( "github.com/golang/glog" - "github.com/kidoman/embd/util" + "github.com/cfreeman/embd/util" ) const ( diff --git a/samples/28bjy-48.go b/samples/28bjy-48.go index 456b7db..6cd3c92 100644 --- a/samples/28bjy-48.go +++ b/samples/28bjy-48.go @@ -18,8 +18,8 @@ import ( "os/signal" "time" - "github.com/kidoman/embd" - _ "github.com/kidoman/embd/host/rpi" + "github.com/cfreeman/embd" + _ "github.com/cfreeman/embd/host/rpi" ) func main() { diff --git a/samples/analog.go b/samples/analog.go index 687ecd5..b9620b3 100644 --- a/samples/analog.go +++ b/samples/analog.go @@ -9,9 +9,9 @@ import ( "os/signal" "time" - "github.com/kidoman/embd" + "github.com/cfreeman/embd" - _ "github.com/kidoman/embd/host/all" + _ "github.com/cfreeman/embd/host/all" ) func main() { diff --git a/samples/analogshort.go b/samples/analogshort.go index 064be32..6cd8954 100644 --- a/samples/analogshort.go +++ b/samples/analogshort.go @@ -6,9 +6,9 @@ import ( "flag" "fmt" - "github.com/kidoman/embd" + "github.com/cfreeman/embd" - _ "github.com/kidoman/embd/host/all" + _ "github.com/cfreeman/embd/host/all" ) func main() { diff --git a/samples/bh1750fvi.go b/samples/bh1750fvi.go index 83e9a72..597b19b 100644 --- a/samples/bh1750fvi.go +++ b/samples/bh1750fvi.go @@ -7,10 +7,10 @@ import ( "fmt" "time" - "github.com/kidoman/embd" - "github.com/kidoman/embd/sensor/bh1750fvi" + "github.com/cfreeman/embd" + "github.com/cfreeman/embd/sensor/bh1750fvi" - _ "github.com/kidoman/embd/host/all" + _ "github.com/cfreeman/embd/host/all" ) func main() { diff --git a/samples/bmp085.go b/samples/bmp085.go index 0fa56ad..2171b64 100644 --- a/samples/bmp085.go +++ b/samples/bmp085.go @@ -7,10 +7,10 @@ import ( "fmt" "time" - "github.com/kidoman/embd" - "github.com/kidoman/embd/sensor/bmp085" + "github.com/cfreeman/embd" + "github.com/cfreeman/embd/sensor/bmp085" - _ "github.com/kidoman/embd/host/all" + _ "github.com/cfreeman/embd/host/all" ) func main() { diff --git a/samples/bmp180.go b/samples/bmp180.go index 845e771..cf2934e 100644 --- a/samples/bmp180.go +++ b/samples/bmp180.go @@ -7,10 +7,10 @@ import ( "fmt" "time" - "github.com/kidoman/embd" - "github.com/kidoman/embd/sensor/bmp180" + "github.com/cfreeman/embd" + "github.com/cfreeman/embd/sensor/bmp180" - _ "github.com/kidoman/embd/host/all" + _ "github.com/cfreeman/embd/host/all" ) func main() { diff --git a/samples/characterdisplay.go b/samples/characterdisplay.go index 7a054aa..a31fff7 100644 --- a/samples/characterdisplay.go +++ b/samples/characterdisplay.go @@ -6,11 +6,11 @@ import ( "flag" "time" - "github.com/kidoman/embd" - "github.com/kidoman/embd/controller/hd44780" - "github.com/kidoman/embd/interface/display/characterdisplay" + "github.com/cfreeman/embd" + "github.com/cfreeman/embd/controller/hd44780" + "github.com/cfreeman/embd/interface/display/characterdisplay" - _ "github.com/kidoman/embd/host/all" + _ "github.com/cfreeman/embd/host/all" ) func main() { diff --git a/samples/fullblinker.go b/samples/fullblinker.go index 7e43b36..42e17e6 100644 --- a/samples/fullblinker.go +++ b/samples/fullblinker.go @@ -11,8 +11,8 @@ import ( "os/signal" "time" - "github.com/kidoman/embd" - _ "github.com/kidoman/embd/host/rpi" + "github.com/cfreeman/embd" + _ "github.com/cfreeman/embd/host/rpi" ) func main() { diff --git a/samples/gpio.go b/samples/gpio.go index b3769eb..d5dbe66 100644 --- a/samples/gpio.go +++ b/samples/gpio.go @@ -6,9 +6,9 @@ import ( "flag" "time" - "github.com/kidoman/embd" + "github.com/cfreeman/embd" - _ "github.com/kidoman/embd/host/all" + _ "github.com/cfreeman/embd/host/all" ) func main() { diff --git a/samples/gpiodetect.go b/samples/gpiodetect.go index 8bc5f78..d07934a 100644 --- a/samples/gpiodetect.go +++ b/samples/gpiodetect.go @@ -6,9 +6,9 @@ import ( "flag" "time" - "github.com/kidoman/embd" + "github.com/cfreeman/embd" - _ "github.com/kidoman/embd/host/all" + _ "github.com/cfreeman/embd/host/all" ) func main() { diff --git a/samples/gpiodirect.go b/samples/gpiodirect.go index 85bd22c..de1c965 100644 --- a/samples/gpiodirect.go +++ b/samples/gpiodirect.go @@ -6,9 +6,9 @@ import ( "flag" "time" - "github.com/kidoman/embd" + "github.com/cfreeman/embd" - _ "github.com/kidoman/embd/host/all" + _ "github.com/cfreeman/embd/host/all" ) func main() { diff --git a/samples/gpiointerrupt.go b/samples/gpiointerrupt.go index 9b6ccc9..211a5b8 100644 --- a/samples/gpiointerrupt.go +++ b/samples/gpiointerrupt.go @@ -6,9 +6,9 @@ import ( "flag" "fmt" - "github.com/kidoman/embd" + "github.com/cfreeman/embd" - _ "github.com/kidoman/embd/host/all" + _ "github.com/cfreeman/embd/host/all" ) func main() { diff --git a/samples/gpioshort.go b/samples/gpioshort.go index b1c5c2c..5f1a55e 100644 --- a/samples/gpioshort.go +++ b/samples/gpioshort.go @@ -5,9 +5,9 @@ package main import ( "flag" - "github.com/kidoman/embd" + "github.com/cfreeman/embd" - _ "github.com/kidoman/embd/host/all" + _ "github.com/cfreeman/embd/host/all" ) func main() { diff --git a/samples/hd44780.go b/samples/hd44780.go index 418fa7e..21a51d3 100644 --- a/samples/hd44780.go +++ b/samples/hd44780.go @@ -6,10 +6,10 @@ import ( "flag" "time" - "github.com/kidoman/embd" - "github.com/kidoman/embd/controller/hd44780" + "github.com/cfreeman/embd" + "github.com/cfreeman/embd/controller/hd44780" - _ "github.com/kidoman/embd/host/all" + _ "github.com/cfreeman/embd/host/all" ) func main() { diff --git a/samples/keypad/matrix4x3.go b/samples/keypad/matrix4x3.go index 9b4feda..26b630c 100644 --- a/samples/keypad/matrix4x3.go +++ b/samples/keypad/matrix4x3.go @@ -5,8 +5,8 @@ package main import ( "fmt" "time" - "github.com/kidoman/embd" - "github.com/kidoman/embd/interface/keypad/matrix4x3" + "github.com/cfreeman/embd" + "github.com/cfreeman/embd/interface/keypad/matrix4x3" ) func main() { diff --git a/samples/l3gd20.go b/samples/l3gd20.go index f0a94e6..63692a1 100644 --- a/samples/l3gd20.go +++ b/samples/l3gd20.go @@ -9,10 +9,10 @@ import ( "os/signal" "time" - "github.com/kidoman/embd" - "github.com/kidoman/embd/sensor/l3gd20" + "github.com/cfreeman/embd" + "github.com/cfreeman/embd/sensor/l3gd20" - _ "github.com/kidoman/embd/host/all" + _ "github.com/cfreeman/embd/host/all" ) func main() { diff --git a/samples/led.go b/samples/led.go index 82650d0..18fdb40 100644 --- a/samples/led.go +++ b/samples/led.go @@ -11,9 +11,9 @@ import ( "os/signal" "time" - "github.com/kidoman/embd" + "github.com/cfreeman/embd" - _ "github.com/kidoman/embd/host/bbb" + _ "github.com/cfreeman/embd/host/bbb" ) func main() { diff --git a/samples/ledshort.go b/samples/ledshort.go index 64a01ce..d2b834f 100644 --- a/samples/ledshort.go +++ b/samples/ledshort.go @@ -8,9 +8,9 @@ import ( "flag" "time" - "github.com/kidoman/embd" + "github.com/cfreeman/embd" - _ "github.com/kidoman/embd/host/bbb" + _ "github.com/cfreeman/embd/host/bbb" ) func main() { diff --git a/samples/lsm303.go b/samples/lsm303.go index e4461de..7e41dd7 100644 --- a/samples/lsm303.go +++ b/samples/lsm303.go @@ -7,10 +7,10 @@ import ( "fmt" "time" - "github.com/kidoman/embd" - "github.com/kidoman/embd/sensor/lsm303" + "github.com/cfreeman/embd" + "github.com/cfreeman/embd/sensor/lsm303" - _ "github.com/kidoman/embd/host/all" + _ "github.com/cfreeman/embd/host/all" ) func main() { diff --git a/samples/mcp3008.go b/samples/mcp3008.go index 791d56a..34afe86 100644 --- a/samples/mcp3008.go +++ b/samples/mcp3008.go @@ -8,9 +8,9 @@ import ( "fmt" "time" - "github.com/kidoman/embd" - "github.com/kidoman/embd/convertors/mcp3008" - _ "github.com/kidoman/embd/host/all" + "github.com/cfreeman/embd" + "github.com/cfreeman/embd/convertors/mcp3008" + _ "github.com/cfreeman/embd/host/all" ) const ( diff --git a/samples/mcp4725.go b/samples/mcp4725.go index ad80967..01b7fe0 100644 --- a/samples/mcp4725.go +++ b/samples/mcp4725.go @@ -9,10 +9,10 @@ import ( "os" "os/signal" - "github.com/kidoman/embd" - "github.com/kidoman/embd/controller/mcp4725" + "github.com/cfreeman/embd" + "github.com/cfreeman/embd/controller/mcp4725" - _ "github.com/kidoman/embd/host/all" + _ "github.com/cfreeman/embd/host/all" ) func main() { diff --git a/samples/pca9685.go b/samples/pca9685.go index 9976340..cb822f3 100644 --- a/samples/pca9685.go +++ b/samples/pca9685.go @@ -8,10 +8,10 @@ import ( "os/signal" "time" - "github.com/kidoman/embd" - "github.com/kidoman/embd/controller/pca9685" + "github.com/cfreeman/embd" + "github.com/cfreeman/embd/controller/pca9685" - _ "github.com/kidoman/embd/host/all" + _ "github.com/cfreeman/embd/host/all" ) func main() { diff --git a/samples/pwm.go b/samples/pwm.go index cecbc4d..b64b112 100644 --- a/samples/pwm.go +++ b/samples/pwm.go @@ -8,10 +8,10 @@ import ( "flag" "time" - "github.com/kidoman/embd" - "github.com/kidoman/embd/host/bbb" + "github.com/cfreeman/embd" + "github.com/cfreeman/embd/host/bbb" - _ "github.com/kidoman/embd/host/all" + _ "github.com/cfreeman/embd/host/all" ) func main() { diff --git a/samples/servo.go b/samples/servo.go index 2e82dd8..d816e09 100644 --- a/samples/servo.go +++ b/samples/servo.go @@ -8,11 +8,11 @@ import ( "os/signal" "time" - "github.com/kidoman/embd" - "github.com/kidoman/embd/controller/pca9685" - "github.com/kidoman/embd/motion/servo" + "github.com/cfreeman/embd" + "github.com/cfreeman/embd/controller/pca9685" + "github.com/cfreeman/embd/motion/servo" - _ "github.com/kidoman/embd/host/all" + _ "github.com/cfreeman/embd/host/all" ) func main() { diff --git a/samples/servobbb.go b/samples/servobbb.go index fbf0db1..244b036 100644 --- a/samples/servobbb.go +++ b/samples/servobbb.go @@ -8,10 +8,10 @@ import ( "os/signal" "time" - "github.com/kidoman/embd" - "github.com/kidoman/embd/motion/servo" + "github.com/cfreeman/embd" + "github.com/cfreeman/embd/motion/servo" - _ "github.com/kidoman/embd/host/all" + _ "github.com/cfreeman/embd/host/all" ) func main() { diff --git a/samples/servoblaster.go b/samples/servoblaster.go index b2d4cdf..6188d1c 100644 --- a/samples/servoblaster.go +++ b/samples/servoblaster.go @@ -8,10 +8,10 @@ import ( "os/signal" "time" - "github.com/kidoman/embd/controller/servoblaster" - "github.com/kidoman/embd/motion/servo" + "github.com/cfreeman/embd/controller/servoblaster" + "github.com/cfreeman/embd/motion/servo" - _ "github.com/kidoman/embd/host/all" + _ "github.com/cfreeman/embd/host/all" ) func main() { diff --git a/samples/simpleblinker.go b/samples/simpleblinker.go index 9e4f780..f9bea32 100644 --- a/samples/simpleblinker.go +++ b/samples/simpleblinker.go @@ -8,8 +8,8 @@ package main import ( "time" - "github.com/kidoman/embd" - _ "github.com/kidoman/embd/host/rpi" // This loads the RPi driver + "github.com/cfreeman/embd" + _ "github.com/cfreeman/embd/host/rpi" // This loads the RPi driver ) func main() { diff --git a/samples/spi.go b/samples/spi.go index 20d606c..86a7fc8 100644 --- a/samples/spi.go +++ b/samples/spi.go @@ -5,8 +5,8 @@ package main import ( "fmt" - "github.com/kidoman/embd" - _ "github.com/kidoman/embd/host/all" + "github.com/cfreeman/embd" + _ "github.com/cfreeman/embd/host/all" ) func main() { diff --git a/samples/spimcp3008.go b/samples/spimcp3008.go index 394243e..5ac86ed 100644 --- a/samples/spimcp3008.go +++ b/samples/spimcp3008.go @@ -7,8 +7,8 @@ import ( "fmt" "time" - "github.com/kidoman/embd" - _ "github.com/kidoman/embd/host/all" + "github.com/cfreeman/embd" + _ "github.com/cfreeman/embd/host/all" ) const ( diff --git a/samples/tmp006.go b/samples/tmp006.go index 6252b00..354ca3e 100644 --- a/samples/tmp006.go +++ b/samples/tmp006.go @@ -8,10 +8,10 @@ import ( "os" "os/signal" - "github.com/kidoman/embd" - "github.com/kidoman/embd/sensor/tmp006" + "github.com/cfreeman/embd" + "github.com/cfreeman/embd/sensor/tmp006" - _ "github.com/kidoman/embd/host/all" + _ "github.com/cfreeman/embd/host/all" ) func main() { diff --git a/samples/universalblinker.go b/samples/universalblinker.go index 190ae1d..6562245 100644 --- a/samples/universalblinker.go +++ b/samples/universalblinker.go @@ -10,8 +10,8 @@ import ( "os/signal" "time" - "github.com/kidoman/embd" - _ "github.com/kidoman/embd/host/all" + "github.com/cfreeman/embd" + _ "github.com/cfreeman/embd/host/all" ) func main() { diff --git a/samples/us020.go b/samples/us020.go index f0e7537..b9576e4 100644 --- a/samples/us020.go +++ b/samples/us020.go @@ -9,10 +9,10 @@ import ( "os/signal" "time" - "github.com/kidoman/embd" - "github.com/kidoman/embd/sensor/us020" + "github.com/cfreeman/embd" + "github.com/cfreeman/embd/sensor/us020" - _ "github.com/kidoman/embd/host/all" + _ "github.com/cfreeman/embd/host/all" ) func main() { diff --git a/samples/watersensor.go b/samples/watersensor.go index ff4ba8a..3fc0eff 100644 --- a/samples/watersensor.go +++ b/samples/watersensor.go @@ -7,10 +7,10 @@ import ( "time" "github.com/golang/glog" - "github.com/kidoman/embd" - "github.com/kidoman/embd/sensor/watersensor" + "github.com/cfreeman/embd" + "github.com/cfreeman/embd/sensor/watersensor" - _ "github.com/kidoman/embd/host/all" + _ "github.com/cfreeman/embd/host/all" ) func main() { diff --git a/sensor/bh1750fvi/bh1750fvi.go b/sensor/bh1750fvi/bh1750fvi.go index 6903bb8..7f9b027 100644 --- a/sensor/bh1750fvi/bh1750fvi.go +++ b/sensor/bh1750fvi/bh1750fvi.go @@ -5,7 +5,7 @@ import ( "sync" "time" - "github.com/kidoman/embd" + "github.com/cfreeman/embd" ) //accuracy = sensorValue/actualValue] (min = 0.96, typ = 1.2, max = 1.44 diff --git a/sensor/bme280/bme280.go b/sensor/bme280/bme280.go index 09174ad..d9e38b6 100644 --- a/sensor/bme280/bme280.go +++ b/sensor/bme280/bme280.go @@ -3,7 +3,7 @@ package bme280 import ( - "github.com/kidoman/embd" + "github.com/cfreeman/embd" ) const ( diff --git a/sensor/bmp085/bmp085.go b/sensor/bmp085/bmp085.go index b58b37b..eea540e 100644 --- a/sensor/bmp085/bmp085.go +++ b/sensor/bmp085/bmp085.go @@ -8,7 +8,7 @@ import ( "time" "github.com/golang/glog" - "github.com/kidoman/embd" + "github.com/cfreeman/embd" ) const ( diff --git a/sensor/bmp180/bmp180.go b/sensor/bmp180/bmp180.go index fdc46f3..bb18a6a 100644 --- a/sensor/bmp180/bmp180.go +++ b/sensor/bmp180/bmp180.go @@ -8,7 +8,7 @@ import ( "time" "github.com/golang/glog" - "github.com/kidoman/embd" + "github.com/cfreeman/embd" ) const ( diff --git a/sensor/l3gd20/l3gd20.go b/sensor/l3gd20/l3gd20.go index c3ad94a..c3a6c75 100644 --- a/sensor/l3gd20/l3gd20.go +++ b/sensor/l3gd20/l3gd20.go @@ -8,7 +8,7 @@ import ( "time" "github.com/golang/glog" - "github.com/kidoman/embd" + "github.com/cfreeman/embd" ) const ( diff --git a/sensor/lsm303/lsm303.go b/sensor/lsm303/lsm303.go index 583a0a8..40e4d31 100644 --- a/sensor/lsm303/lsm303.go +++ b/sensor/lsm303/lsm303.go @@ -7,7 +7,7 @@ import ( "time" "github.com/golang/glog" - "github.com/kidoman/embd" + "github.com/cfreeman/embd" ) const ( diff --git a/sensor/tmp006/tmp006.go b/sensor/tmp006/tmp006.go index 842204b..42ca679 100644 --- a/sensor/tmp006/tmp006.go +++ b/sensor/tmp006/tmp006.go @@ -9,7 +9,7 @@ import ( "time" "github.com/golang/glog" - "github.com/kidoman/embd" + "github.com/cfreeman/embd" ) const ( diff --git a/sensor/us020/us020.go b/sensor/us020/us020.go index b7d400a..0d021ce 100644 --- a/sensor/us020/us020.go +++ b/sensor/us020/us020.go @@ -6,7 +6,7 @@ import ( "time" "github.com/golang/glog" - "github.com/kidoman/embd" + "github.com/cfreeman/embd" ) const ( diff --git a/sensor/watersensor/watersensor.go b/sensor/watersensor/watersensor.go index c83628e..1fd6d98 100644 --- a/sensor/watersensor/watersensor.go +++ b/sensor/watersensor/watersensor.go @@ -5,7 +5,7 @@ import ( "sync" "github.com/golang/glog" - "github.com/kidoman/embd" + "github.com/cfreeman/embd" ) // WaterSensor represents a water sensor. From ec92ed848cc31a581f067539c2e637b0c75ad965 Mon Sep 17 00:00:00 2001 From: clinton Date: Sun, 21 May 2017 20:47:53 +1000 Subject: [PATCH 10/15] go fmt --- controller/hd44780/hd44780.go | 2 +- controller/mcp4725/mcp4725.go | 2 +- controller/pca9685/pca9685.go | 2 +- controller/pcal9535a/pcal9535a.go | 25 ++++++++++++++++++++++--- convertors/mcp3008/mcp3008.go | 2 +- embd/detect.go | 2 +- embd/main.go | 2 +- host/bbb/bbb.go | 2 +- host/bbb/pwmpin.go | 2 +- host/edison/edison.go | 21 +++++++++++++++++++-- host/generic/i2cbus.go | 2 +- host/generic/spibus.go | 2 +- motion/servo/servo.go | 2 +- samples/watersensor.go | 2 +- sensor/bmp085/bmp085.go | 2 +- sensor/bmp180/bmp180.go | 2 +- sensor/l3gd20/l3gd20.go | 2 +- sensor/lsm303/lsm303.go | 2 +- sensor/tmp006/tmp006.go | 2 +- sensor/us020/us020.go | 2 +- sensor/watersensor/watersensor.go | 2 +- 21 files changed, 60 insertions(+), 24 deletions(-) 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. From 7070035e9cf0adafbdda1ba7d184197a3778dd1c Mon Sep 17 00:00:00 2001 From: clinton Date: Sun, 21 May 2017 20:48:14 +1000 Subject: [PATCH 11/15] Added support for APA102 LED strips. --- controller/apa102/apa102.go | 85 +++++++++++++++++++++++++++++++++++++ samples/apa102.go | 47 ++++++++++++++++++++ 2 files changed, 132 insertions(+) create mode 100644 controller/apa102/apa102.go create mode 100644 samples/apa102.go diff --git a/controller/apa102/apa102.go b/controller/apa102/apa102.go new file mode 100644 index 0000000..1ea27c6 --- /dev/null +++ b/controller/apa102/apa102.go @@ -0,0 +1,85 @@ +/* + * Copyright (c) Clinton Freeman 2017 + * + * 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 apa102 + +import ( + "github.com/cfreeman/embd" +) + +const ( + MAX_BRIGHTNESS = 31 +) + +type APA102 struct { + Bus embd.SPIBus + LED []uint8 + nLED int +} + +func New(bus embd.SPIBus, numLEDs int) *APA102 { + res := &APA102{ + Bus: bus, + LED: make([]uint8, numLEDs*4), + nLED: numLEDs, + } + + // Init the intensity field for each LED which is + // 0b111 + 5 intensity bits. + for i := 0; i < (numLEDs * 4); i = i + 4 { + res.LED[i] = 224 + } + + return res +} + +func (a *APA102) SetLED(index int, r uint8, g uint8, b uint8, i uint8) error { + intensity := i + if i > 31 { + intensity = 31 + } + + ind := index * 4 + + a.LED[ind+0] = 224 + intensity // Brightness is 0b111 + 5 intensity bits + a.LED[ind+1] = b + a.LED[ind+2] = g + a.LED[ind+3] = r + + return a.Show() +} + +func (a *APA102) Show() error { + // Start frame is 32 zero bits. + err := a.Bus.TransferAndReceiveData([]uint8{0, 0, 0, 0}) + + // LED data. + // 111+5bits(intensity) + 1byte(Red) + 1byte(Green) + 1byte(Blue) + err = a.Bus.TransferAndReceiveData(a.LED) + if err != nil { + return err + } + + err = a.Bus.TransferAndReceiveData([]uint8{1, 1, 1, 1}) + if err != nil { + return err + } + + return nil +} diff --git a/samples/apa102.go b/samples/apa102.go new file mode 100644 index 0000000..99def97 --- /dev/null +++ b/samples/apa102.go @@ -0,0 +1,47 @@ +/* + * Copyright (c) Clinton Freeman 2017 + * + * 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. + */ + +// +build ignore + +package main + +import ( + "fmt" + + "github.com/cfreeman/embd" + "github.com/cfreeman/embd/controller/apa102" + _ "github.com/cfreeman/embd/host/all" +) + +func main() { + if err := embd.InitSPI(); err != nil { + panic(err) + } + defer embd.CloseSPI() + + spiBus := embd.NewSPIBus(embd.SPIMode0, 0, 8000000, 8, 0) + defer spiBus.Close() + + strip := apa102.New(spiBus, 5) + err := strip.SetLED(0, 255, 0, 0, 31) + if err != nil { + fmt.Printf("ERROR Unable to set LED.") + fmt.Printf("%s", err) + } +} From 5219ac62044852952a739d832fe3814571cb6790 Mon Sep 17 00:00:00 2001 From: clinton Date: Sun, 21 May 2017 21:18:14 +1000 Subject: [PATCH 12/15] Updated documentation and added little plan. --- README.md | 98 ++++++++++++++++++++++++++++++------------------------- 1 file changed, 53 insertions(+), 45 deletions(-) diff --git a/README.md b/README.md index 920a219..4f5a4ef 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# embd [![Build Status](https://travis-ci.org/kidoman/embd.svg?branch=master)](https://travis-ci.org/kidoman/embd) [![GoDoc](http://godoc.org/github.com/cfreeman/embd?status.png)](http://godoc.org/github.com/cfreeman/embd) +# embd [![GoDoc](http://godoc.org/github.com/cfreeman/embd?status.png)](http://godoc.org/github.com/cfreeman/embd) **embd** is a hardware abstraction layer (HAL) for embedded systems. @@ -18,11 +18,6 @@ What embd then adds is first a Golang library interface on top of the various Li devices and then another layer of user-level drivers for specific sensors and controllers that are connected to gpio pins or one of the buses. -Development supported and sponsored by [**SoStronk**](https://www.sostronk.com) and -[**ThoughtWorks**](http://www.thoughtworks.com/). - -Also, you might be interested in: [Why Golang?](https://github.com/cfreeman/embd/wiki/Why-Go) - [Blog post introducing EMBD](http://kidoman.io/framework/embd.html) ## Getting Started @@ -76,16 +71,50 @@ Then on the rPi run the program with ```sudo```*: * This sample program is optimized for brevity and does not clean up after itself. Click here to see the [full version](https://github.com/cfreeman/embd/blob/master/samples/fullblinker.go) -## Getting Help +## Supported Platforms -Join the [slack channel](https://gophers.slack.com/archives/embd) - -## Platforms Supported - -* [RaspberryPi](http://www.raspberrypi.org/) (including [A+](http://www.raspberrypi.org/products/model-a-plus/) and [B+](http://www.raspberrypi.org/products/model-b-plus/)) -* [RaspberryPi 2](http://www.raspberrypi.org/) -* [NextThing C.H.I.P](https://www.nextthing.co/pages/chip) * [BeagleBone Black](http://beagleboard.org/Products/BeagleBone%20Black) +* [Intel Edison](https://software.intel.com/en-us/iot/hardware/edison) +* [NextThing C.H.I.P](https://www.nextthing.co/pages/chip) +* [RaspberryPi 1 A+](http://www.raspberrypi.org/products/model-a-plus/) +* [RaspberryPi 1 B+](https://www.raspberrypi.org/products/model-b-plus/) +* [RaspberryPi 2](https://www.raspberrypi.org/products/raspberry-pi-2-model-b/) +* [RaspberryPi 3](https://www.raspberrypi.org/products/raspberry-pi-3-model-b/) + +## Supported Protocols + +* **Digital GPIO** [Documentation](http://godoc.org/github.com/cfreeman/embd#DigitalPin) +* **Analog GPIO** [Documentation](http://godoc.org/github.com/cfreeman/embd#AnalogPin) +* **PWM** [Documentation](http://godoc.org/github.com/cfreeman/embd#PWMPin) +* **I2C** [Documentation](http://godoc.org/github.com/cfreeman/embd#I2CBus) +* **LED** [Documentation](http://godoc.org/github.com/cfreeman/embd#LED) +* **SPI** [Documentation](http://godoc.org/github.com/cfreeman/embd#SPIBus) + +## Supported Sensors + +* **BH1750FVI** Luminosity sensor [Documentation](http://godoc.org/github.com/cfreeman/embd/sensor/bh1750fvi), [Datasheet](http://www.elechouse.com/elechouse/images/product/Digital%20light%20Sensor/bh1750fvi-e.pdf) +* **BME280** Pressure, Temperature and Humidity Sensor [Documentation](https://godoc.org/github.com/cfreeman/embd/sensor/bme280), [Datasheet](https://cdn-shop.adafruit.com/datasheets/BST-BME280_DS001-10.pdf) +* **BMP085** Barometric pressure sensor [Documentation](http://godoc.org/github.com/cfreeman/embd/sensor/bmp085), [Datasheet](https://www.sparkfun.com/datasheets/Components/General/BST-BMP085-DS000-05.pdf) +* **BMP180** Barometric pressure sensor [Documentation](http://godoc.org/github.com/cfreeman/embd/sensor/bmp180), [Datasheet](http://www.adafruit.com/datasheets/BST-BMP180-DS000-09.pdf) +* **L3GD20** Gyroscope [Documentation](http://godoc.org/github.com/cfreeman/embd/sensor/l3gd20), [Datasheet](http://www.adafruit.com/datasheets/L3GD20.pdf) +* **LSM303** Accelerometer and magnetometer [Documentation](http://godoc.org/github.com/cfreeman/embd/sensor/lsm303), [Datasheet](https://www.sparkfun.com/datasheets/Sensors/Magneto/LSM303%20Datasheet.pdf) +* **TMP006** Thermopile sensor [Documentation](http://godoc.org/github.com/cfreeman/embd/sensor/tmp006), [Datasheet](http://www.adafruit.com/datasheets/tmp006.pdf), [Userguide](http://www.adafruit.com/datasheets/tmp006ug.pdf) +* **US020** Ultrasonic proximity sensor [Documentation](http://godoc.org/github.com/cfreeman/embd/sensor/us020), [Product Page](http://www.digibay.in/sensor/object-detection-and-proximity?product_id=239) + +## Interfaces + +* **Keypad(4x3)** [Product Page](http://www.adafruit.com/products/419#Learn) + +## Controllers + +* **PCA9685** 16-channel, 12-bit PWM Controller with I2C protocol [Documentation](http://godoc.org/github.com/cfreeman/embd/controller/pca9685), [Datasheet](http://www.adafruit.com/datasheets/PCA9685.pdf), [Product Page](http://www.adafruit.com/products/815) +* **MCP4725** 12-bit DAC [Documentation](http://godoc.org/github.com/cfreeman/embd/controller/mcp4725), [Datasheet](http://www.adafruit.com/datasheets/mcp4725.pdf), [Product Page](http://www.adafruit.com/products/935) +* **ServoBlaster** RPi PWM/PCM based PWM controller [Documentation](http://godoc.org/github.com/cfreeman/embd/controller/servoblaster), [Product Page](https://github.com/richardghirst/PiBits/tree/master/ServoBlaster) + +## Convertors + +* **MCP3008** 8-channel, 10-bit ADC with SPI protocol, [Datasheet](https://www.adafruit.com/datasheets/MCP3008.pdf) + ## The command line tool @@ -213,38 +242,7 @@ heading, err := mag.Heading() The above two examples depend on **I2C** and therefore will work without change on almost all platforms. -## Protocols Supported -* **Digital GPIO** [Documentation](http://godoc.org/github.com/cfreeman/embd#DigitalPin) -* **Analog GPIO** [Documentation](http://godoc.org/github.com/cfreeman/embd#AnalogPin) -* **PWM** [Documentation](http://godoc.org/github.com/cfreeman/embd#PWMPin) -* **I2C** [Documentation](http://godoc.org/github.com/cfreeman/embd#I2CBus) -* **LED** [Documentation](http://godoc.org/github.com/cfreeman/embd#LED) -* **SPI** [Documentation](http://godoc.org/github.com/cfreeman/embd#SPIBus) - -## Sensors Supported - -* **TMP006** Thermopile sensor [Documentation](http://godoc.org/github.com/cfreeman/embd/sensor/tmp006), [Datasheet](http://www.adafruit.com/datasheets/tmp006.pdf), [Userguide](http://www.adafruit.com/datasheets/tmp006ug.pdf) -* **BMP085** Barometric pressure sensor [Documentation](http://godoc.org/github.com/cfreeman/embd/sensor/bmp085), [Datasheet](https://www.sparkfun.com/datasheets/Components/General/BST-BMP085-DS000-05.pdf) -* **BMP180** Barometric pressure sensor [Documentation](http://godoc.org/github.com/cfreeman/embd/sensor/bmp180), [Datasheet](http://www.adafruit.com/datasheets/BST-BMP180-DS000-09.pdf) -* **LSM303** Accelerometer and magnetometer [Documentation](http://godoc.org/github.com/cfreeman/embd/sensor/lsm303), [Datasheet](https://www.sparkfun.com/datasheets/Sensors/Magneto/LSM303%20Datasheet.pdf) -* **L3GD20** Gyroscope [Documentation](http://godoc.org/github.com/cfreeman/embd/sensor/l3gd20), [Datasheet](http://www.adafruit.com/datasheets/L3GD20.pdf) -* **US020** Ultrasonic proximity sensor [Documentation](http://godoc.org/github.com/cfreeman/embd/sensor/us020), [Product Page](http://www.digibay.in/sensor/object-detection-and-proximity?product_id=239) -* **BH1750FVI** Luminosity sensor [Documentation](http://godoc.org/github.com/cfreeman/embd/sensor/bh1750fvi), [Datasheet](http://www.elechouse.com/elechouse/images/product/Digital%20light%20Sensor/bh1750fvi-e.pdf) - -## Interfaces - -* **Keypad(4x3)** [Product Page](http://www.adafruit.com/products/419#Learn) - -## Controllers - -* **PCA9685** 16-channel, 12-bit PWM Controller with I2C protocol [Documentation](http://godoc.org/github.com/cfreeman/embd/controller/pca9685), [Datasheet](http://www.adafruit.com/datasheets/PCA9685.pdf), [Product Page](http://www.adafruit.com/products/815) -* **MCP4725** 12-bit DAC [Documentation](http://godoc.org/github.com/cfreeman/embd/controller/mcp4725), [Datasheet](http://www.adafruit.com/datasheets/mcp4725.pdf), [Product Page](http://www.adafruit.com/products/935) -* **ServoBlaster** RPi PWM/PCM based PWM controller [Documentation](http://godoc.org/github.com/cfreeman/embd/controller/servoblaster), [Product Page](https://github.com/richardghirst/PiBits/tree/master/ServoBlaster) - -## Convertors - -* **MCP3008** 8-channel, 10-bit ADC with SPI protocol, [Datasheet](https://www.adafruit.com/datasheets/MCP3008.pdf) ## Contributing @@ -257,3 +255,13 @@ Thank you! ## About EMBD is affectionately designed/developed by Karan Misra ([kidoman](https://github.com/kidoman)), Kunal Powar ([kunalpowar](https://github.com/kunalpowar)) and [FRIENDS](https://github.com/cfreeman/embd/blob/master/AUTHORS). We also have a list of [CONTRIBUTORS](https://github.com/cfreeman/embd/blob/master/CONTRIBUTORS). + +## TODO +* Continue to tidy up the readme and other documenting files. +* Find more details/datasheet on the implemented watersensor. +* Dig through logs and add license/copyright headers throughout. +* Remove AUTHORS & CONTRIBUTORS -- That stuff is better maintained within git history (don't forget update_contributors script). +* Make sure there are samples for all the supported hardware. +* Organise samples into different folders. +* Rummage through the old, largely abandoned parent repo and pull in as many of the requests as possible. + From 29f2c69f574227511f502754c081b0a65fb2ea59 Mon Sep 17 00:00:00 2001 From: clinton Date: Mon, 22 May 2017 14:25:30 +1000 Subject: [PATCH 13/15] Let there be licenses. --- README.md | 8 ++++---- controller/hd44780/hd44780.go | 19 +++++++++++++++++++ controller/hd44780/hd44780_test.go | 19 +++++++++++++++++++ controller/mcp4725/mcp4725.go | 19 +++++++++++++++++++ controller/pca9685/pca9685.go | 19 +++++++++++++++++++ controller/servoblaster/servoblaster.go | 19 +++++++++++++++++++ convertors/mcp3008/mcp3008.go | 19 +++++++++++++++++++ descriptor.go | 19 +++++++++++++++++++ detect.go | 19 +++++++++++++++++++ detect_test.go | 19 +++++++++++++++++++ embd/detect.go | 19 +++++++++++++++++++ embd/main.go | 19 +++++++++++++++++++ gpio.go | 19 +++++++++++++++++++ gpiodriver.go | 19 +++++++++++++++++++ gpiodriver_test.go | 19 +++++++++++++++++++ host/all/all.go | 19 +++++++++++++++++++ host/bbb/analogpin.go | 19 +++++++++++++++++++ host/bbb/analogpin_test.go | 19 +++++++++++++++++++ host/bbb/bbb.go | 19 +++++++++++++++++++ host/bbb/pwmpin.go | 19 +++++++++++++++++++ host/bbb/pwmpin_test.go | 19 +++++++++++++++++++ host/chip/chip.go | 19 ++++++++++++++++++- host/generic/digitalpin.go | 19 +++++++++++++++++++ host/generic/digitalpin_test.go | 19 +++++++++++++++++++ host/generic/i2cbus.go | 19 +++++++++++++++++++ host/generic/interrupt.go | 19 +++++++++++++++++++ host/generic/led.go | 19 +++++++++++++++++++ host/generic/spibus.go | 19 +++++++++++++++++++ host/rpi/rpi.go | 19 +++++++++++++++++++ i2c.go | 19 +++++++++++++++++++ i2cdriver.go | 19 +++++++++++++++++++ .../characterdisplay/characterdisplay.go | 19 +++++++++++++++++++ .../characterdisplay/characterdisplay_test.go | 19 +++++++++++++++++++ interface/keypad/matrix4x3/matrix4x3.go | 19 +++++++++++++++++++ led.go | 19 +++++++++++++++++++ leddriver.go | 19 +++++++++++++++++++ motion/servo/servo.go | 19 +++++++++++++++++++ pin.go | 19 +++++++++++++++++++ pin_test.go | 19 +++++++++++++++++++ samples/apa102.go | 2 -- samples/spi.go | 19 +++++++++++++++++++ sensor/bh1750fvi/bh1750fvi.go | 19 +++++++++++++++++++ sensor/bme280/bme280.go | 19 +++++++++++++++++++ sensor/bmp085/bmp085.go | 19 +++++++++++++++++++ sensor/bmp180/bmp180.go | 19 +++++++++++++++++++ sensor/l3gd20/l3gd20.go | 19 +++++++++++++++++++ sensor/lsm303/lsm303.go | 19 +++++++++++++++++++ sensor/tmp006/tmp006.go | 19 +++++++++++++++++++ sensor/us020/us020.go | 19 +++++++++++++++++++ sensor/watersensor/watersensor.go | 19 +++++++++++++++++++ spi.go | 19 +++++++++++++++++++ spidriver.go | 19 +++++++++++++++++++ util/map_test.go | 19 +++++++++++++++++++ utils.go | 18 ++++++++++++++++++ 54 files changed, 990 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 4f5a4ef..2a4b1e8 100644 --- a/README.md +++ b/README.md @@ -98,8 +98,9 @@ Then on the rPi run the program with ```sudo```*: * **BMP180** Barometric pressure sensor [Documentation](http://godoc.org/github.com/cfreeman/embd/sensor/bmp180), [Datasheet](http://www.adafruit.com/datasheets/BST-BMP180-DS000-09.pdf) * **L3GD20** Gyroscope [Documentation](http://godoc.org/github.com/cfreeman/embd/sensor/l3gd20), [Datasheet](http://www.adafruit.com/datasheets/L3GD20.pdf) * **LSM303** Accelerometer and magnetometer [Documentation](http://godoc.org/github.com/cfreeman/embd/sensor/lsm303), [Datasheet](https://www.sparkfun.com/datasheets/Sensors/Magneto/LSM303%20Datasheet.pdf) -* **TMP006** Thermopile sensor [Documentation](http://godoc.org/github.com/cfreeman/embd/sensor/tmp006), [Datasheet](http://www.adafruit.com/datasheets/tmp006.pdf), [Userguide](http://www.adafruit.com/datasheets/tmp006ug.pdf) +* **TMP006** Thermopile sensor [Documentation](http://godoc.org/github.com/cfreeman/embd/sensor/tmp006), [Datasheet](http://www.adafruit.com/datasheets/tmp006.pdf) * **US020** Ultrasonic proximity sensor [Documentation](http://godoc.org/github.com/cfreeman/embd/sensor/us020), [Product Page](http://www.digibay.in/sensor/object-detection-and-proximity?product_id=239) +* **Watersensor** Based on LM393 (currently only provides digital support) [Documentation](http://godoc.org/github.com/cfreeman/embd/sensor/watersensor)[Datasheet](http://www.ti.com/lit/ds/symlink/lm393-n.pdf) ## Interfaces @@ -258,10 +259,9 @@ EMBD is affectionately designed/developed by Karan Misra ([kidoman](https://gith ## TODO * Continue to tidy up the readme and other documenting files. -* Find more details/datasheet on the implemented watersensor. -* Dig through logs and add license/copyright headers throughout. * Remove AUTHORS & CONTRIBUTORS -- That stuff is better maintained within git history (don't forget update_contributors script). +* move utils.go into util package * Make sure there are samples for all the supported hardware. -* Organise samples into different folders. +* Better organise samples -> into godoc? * Rummage through the old, largely abandoned parent repo and pull in as many of the requests as possible. diff --git a/controller/hd44780/hd44780.go b/controller/hd44780/hd44780.go index 7e5c692..860d8b6 100644 --- a/controller/hd44780/hd44780.go +++ b/controller/hd44780/hd44780.go @@ -1,3 +1,22 @@ +/* + * Copyright (c) Matthew Dale 2014 + * + * 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 hd44780 allows controlling an HD44780-compatible character LCD controller. Currently the library is write-only and does not support diff --git a/controller/hd44780/hd44780_test.go b/controller/hd44780/hd44780_test.go index 500d1bf..0c561ff 100644 --- a/controller/hd44780/hd44780_test.go +++ b/controller/hd44780/hd44780_test.go @@ -1,3 +1,22 @@ +/* + * Copyright (c) Matthew Dale 2014 + * + * 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 hd44780 import ( diff --git a/controller/mcp4725/mcp4725.go b/controller/mcp4725/mcp4725.go index 969dd48..06e5d30 100644 --- a/controller/mcp4725/mcp4725.go +++ b/controller/mcp4725/mcp4725.go @@ -1,3 +1,22 @@ +/* + * Copyright (c) Karan Misra 2014 + * + * 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 mcp4725 allows interfacing with the MCP4725 DAC. package mcp4725 diff --git a/controller/pca9685/pca9685.go b/controller/pca9685/pca9685.go index 98acf0f..8af71f4 100644 --- a/controller/pca9685/pca9685.go +++ b/controller/pca9685/pca9685.go @@ -1,3 +1,22 @@ +/* + * Copyright (c) Kunal Powar 2014 + * + * 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 pca9685 allows interfacing with the pca9685 16-channel, 12-bit PWM Controller through I2C protocol. package pca9685 diff --git a/controller/servoblaster/servoblaster.go b/controller/servoblaster/servoblaster.go index c9c3460..1619e38 100644 --- a/controller/servoblaster/servoblaster.go +++ b/controller/servoblaster/servoblaster.go @@ -1,3 +1,22 @@ +/* + * Copyright (c) Karan Misra 2014 + * + * 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 servoblaster allows interfacing with the software servoblaster driver. // // More details on ServoBlaster at: https://github.com/richardghirst/PiBits/tree/master/ServoBlaster diff --git a/convertors/mcp3008/mcp3008.go b/convertors/mcp3008/mcp3008.go index 30d6373..4fda6e8 100644 --- a/convertors/mcp3008/mcp3008.go +++ b/convertors/mcp3008/mcp3008.go @@ -1,3 +1,22 @@ +/* + * Copyright (c) Kunal Powar 2014 + * + * 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 mcp3008 allows interfacing with the mcp3008 8-channel, 10-bit ADC through SPI protocol. package mcp3008 diff --git a/descriptor.go b/descriptor.go index b891008..6527c04 100644 --- a/descriptor.go +++ b/descriptor.go @@ -1,3 +1,22 @@ +/* + * Copyright (c) Karan Misra 2014 + * + * 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. + */ + // Host descriptor data structures. package embd diff --git a/detect.go b/detect.go index 91a3f7e..66d0eeb 100644 --- a/detect.go +++ b/detect.go @@ -1,3 +1,22 @@ +/* + * Copyright (c) Karan Misra 2014 + * + * 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. + */ + // Host detection. package embd diff --git a/detect_test.go b/detect_test.go index 48c539e..f218b98 100644 --- a/detect_test.go +++ b/detect_test.go @@ -1,3 +1,22 @@ +/* + * Copyright (c) Karan Misra 2014 + * + * 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 embd import "testing" diff --git a/embd/detect.go b/embd/detect.go index 2a62010..b0d4251 100644 --- a/embd/detect.go +++ b/embd/detect.go @@ -1,3 +1,22 @@ +/* + * Copyright (c) Karan Misra 2014 + * + * 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 main import ( diff --git a/embd/main.go b/embd/main.go index 57ef4de..a344879 100644 --- a/embd/main.go +++ b/embd/main.go @@ -1,3 +1,22 @@ +/* + * Copyright (c) Karan Misra 2014 + * + * 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 main import ( diff --git a/gpio.go b/gpio.go index 3d7baf7..c804dfd 100644 --- a/gpio.go +++ b/gpio.go @@ -1,3 +1,22 @@ +/* + * Copyright (c) Karan Misra 2014 + * + * 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. + */ + // GPIO support. package embd diff --git a/gpiodriver.go b/gpiodriver.go index be2f8d8..7bb7f39 100644 --- a/gpiodriver.go +++ b/gpiodriver.go @@ -1,3 +1,22 @@ +/* + * Copyright (c) Karan Misra 2014 + * + * 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. + */ + // Generic GPIO driver. package embd diff --git a/gpiodriver_test.go b/gpiodriver_test.go index fffedf4..54d08c4 100644 --- a/gpiodriver_test.go +++ b/gpiodriver_test.go @@ -1,3 +1,22 @@ +/* + * Copyright (c) Karan Misra 2014 + * + * 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 embd import ( diff --git a/host/all/all.go b/host/all/all.go index 73fd03f..fc16bc0 100644 --- a/host/all/all.go +++ b/host/all/all.go @@ -1,3 +1,22 @@ +/* + * Copyright (c) Karan Misra 2014 + * + * 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 all conviniently loads all the inbuilt/supported host drivers. package all diff --git a/host/bbb/analogpin.go b/host/bbb/analogpin.go index 1f98f43..bbcf1d0 100644 --- a/host/bbb/analogpin.go +++ b/host/bbb/analogpin.go @@ -1,3 +1,22 @@ +/* + * Copyright (c) Karan Misra 2014 + * + * 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. + */ + // Analog I/O support on the BBB. package bbb diff --git a/host/bbb/analogpin_test.go b/host/bbb/analogpin_test.go index b43742b..8aa5519 100644 --- a/host/bbb/analogpin_test.go +++ b/host/bbb/analogpin_test.go @@ -1,3 +1,22 @@ +/* + * Copyright (c) Karan Misra 2014 + * + * 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 bbb import ( diff --git a/host/bbb/bbb.go b/host/bbb/bbb.go index cc203c2..445c340 100644 --- a/host/bbb/bbb.go +++ b/host/bbb/bbb.go @@ -1,3 +1,22 @@ +/* + * Copyright (c) Karan Misra 2014 + * + * 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 bbb provides BeagleBone Black support. The following features are supported on Linux kernel 3.8+ diff --git a/host/bbb/pwmpin.go b/host/bbb/pwmpin.go index da0f978..aff8ed8 100644 --- a/host/bbb/pwmpin.go +++ b/host/bbb/pwmpin.go @@ -1,3 +1,22 @@ +/* + * Copyright (c) Karan Misra 2014 + * + * 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. + */ + // PWM support on the BBB. package bbb diff --git a/host/bbb/pwmpin_test.go b/host/bbb/pwmpin_test.go index 17aef96..083bb56 100644 --- a/host/bbb/pwmpin_test.go +++ b/host/bbb/pwmpin_test.go @@ -1,3 +1,22 @@ +/* + * Copyright (c) Karan Misra 2014 + * + * 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 bbb import ( diff --git a/host/chip/chip.go b/host/chip/chip.go index cdd6855..afd94d1 100644 --- a/host/chip/chip.go +++ b/host/chip/chip.go @@ -1,4 +1,21 @@ -// Copyright 2016 by Thorsten von Eicken, see LICENSE file +/* + * Copyright (c) Thorsten von Eicken 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 chip provides NextThing C.H.I.P. support. // References: diff --git a/host/generic/digitalpin.go b/host/generic/digitalpin.go index 1e50a27..d4400f1 100644 --- a/host/generic/digitalpin.go +++ b/host/generic/digitalpin.go @@ -1,3 +1,22 @@ +/* + * Copyright (c) Karan Misra 2014 + * + * 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. + */ + // Digital IO support. // This driver requires kernel version 3.8+ and should work uniformly // across all supported devices. diff --git a/host/generic/digitalpin_test.go b/host/generic/digitalpin_test.go index 198d05a..f80ab2d 100644 --- a/host/generic/digitalpin_test.go +++ b/host/generic/digitalpin_test.go @@ -1,3 +1,22 @@ +/* + * Copyright (c) Karan Misra 2014 + * + * 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 generic import ( diff --git a/host/generic/i2cbus.go b/host/generic/i2cbus.go index 0f32d62..91cde71 100644 --- a/host/generic/i2cbus.go +++ b/host/generic/i2cbus.go @@ -1,3 +1,22 @@ +/* + * Copyright (c) Karan Misra 2014 + * + * 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. + */ + // I²C support. package generic diff --git a/host/generic/interrupt.go b/host/generic/interrupt.go index d12695f..5642550 100644 --- a/host/generic/interrupt.go +++ b/host/generic/interrupt.go @@ -1,3 +1,22 @@ +/* + * Copyright (c) Karan Misra 2014 + * + * 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. + */ + // Generic Interrupt Pins. package generic diff --git a/host/generic/led.go b/host/generic/led.go index b3ca546..58e01f3 100644 --- a/host/generic/led.go +++ b/host/generic/led.go @@ -1,3 +1,22 @@ +/* + * Copyright (c) Karan Misra 2014 + * + * 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. + */ + // LED control support. package generic diff --git a/host/generic/spibus.go b/host/generic/spibus.go index 402e1c4..b9fd1a2 100644 --- a/host/generic/spibus.go +++ b/host/generic/spibus.go @@ -1,3 +1,22 @@ +/* + * Copyright (c) Karan Misra 2014 + * + * 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 generic import ( diff --git a/host/rpi/rpi.go b/host/rpi/rpi.go index 5137942..cfad850 100644 --- a/host/rpi/rpi.go +++ b/host/rpi/rpi.go @@ -1,3 +1,22 @@ +/* + * Copyright (c) Karan Misra 2014 + * + * 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 rpi provides Raspberry Pi (including A+/B+) support. The following features are supported on Linux kernel 3.8+ diff --git a/i2c.go b/i2c.go index 6a5d1ec..a7e83a7 100644 --- a/i2c.go +++ b/i2c.go @@ -1,3 +1,22 @@ +/* + * Copyright (c) Karan Misra 2014 + * + * 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. + */ + // I2C support. package embd diff --git a/i2cdriver.go b/i2cdriver.go index e3aac3e..c9d7941 100644 --- a/i2cdriver.go +++ b/i2cdriver.go @@ -1,3 +1,22 @@ +/* + * Copyright (c) Karan Misra 2014 + * + * 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. + */ + // Generic I²C driver. package embd diff --git a/interface/display/characterdisplay/characterdisplay.go b/interface/display/characterdisplay/characterdisplay.go index ca866d9..fe4f7b0 100644 --- a/interface/display/characterdisplay/characterdisplay.go +++ b/interface/display/characterdisplay/characterdisplay.go @@ -1,3 +1,22 @@ +/* + * Copyright (c) Matthew Dale 2015 + * + * 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 characterdisplay provides an ease-of-use layer on top of a character display controller. diff --git a/interface/display/characterdisplay/characterdisplay_test.go b/interface/display/characterdisplay/characterdisplay_test.go index 4bd6c39..402d567 100644 --- a/interface/display/characterdisplay/characterdisplay_test.go +++ b/interface/display/characterdisplay/characterdisplay_test.go @@ -1,3 +1,22 @@ +/* + * Copyright (c) Matthew Dale 2015 + * + * 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 characterdisplay import ( diff --git a/interface/keypad/matrix4x3/matrix4x3.go b/interface/keypad/matrix4x3/matrix4x3.go index fcfe60f..f10799f 100644 --- a/interface/keypad/matrix4x3/matrix4x3.go +++ b/interface/keypad/matrix4x3/matrix4x3.go @@ -1,3 +1,22 @@ +/* + * Copyright (c) Kunal Powar 2014 + * + * 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 matrix4x3 allows interfacing 4x3 keypad with Raspberry pi. package matrix4x3 diff --git a/led.go b/led.go index d9c309f..cb39867 100644 --- a/led.go +++ b/led.go @@ -1,3 +1,22 @@ +/* + * Copyright (c) Karan Misra 2014 + * + * 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. + */ + // LED support. package embd diff --git a/leddriver.go b/leddriver.go index 943e9e8..334c7fc 100644 --- a/leddriver.go +++ b/leddriver.go @@ -1,3 +1,22 @@ +/* + * Copyright (c) Karan Misra 2014 + * + * 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. + */ + // Generic LED driver. package embd diff --git a/motion/servo/servo.go b/motion/servo/servo.go index 1a54a70..8e8bd91 100644 --- a/motion/servo/servo.go +++ b/motion/servo/servo.go @@ -1,3 +1,22 @@ +/* + * Copyright (c) Kunal Powar 2014 + * + * 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 servo allows control of servos using a PWM controller. package servo diff --git a/pin.go b/pin.go index 4d33252..6ca9c75 100644 --- a/pin.go +++ b/pin.go @@ -1,3 +1,22 @@ +/* + * Copyright (c) Karan Misra 2014 + * + * 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. + */ + // Pin mapping support. package embd diff --git a/pin_test.go b/pin_test.go index ea1acf5..5da3f31 100644 --- a/pin_test.go +++ b/pin_test.go @@ -1,3 +1,22 @@ +/* + * Copyright (c) Karan Misra 2014 + * + * 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 embd import "testing" diff --git a/samples/apa102.go b/samples/apa102.go index 99def97..babebeb 100644 --- a/samples/apa102.go +++ b/samples/apa102.go @@ -1,6 +1,4 @@ /* - * Copyright (c) Clinton Freeman 2017 - * * 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, diff --git a/samples/spi.go b/samples/spi.go index 86a7fc8..d3801c1 100644 --- a/samples/spi.go +++ b/samples/spi.go @@ -1,3 +1,22 @@ +/* + * Copyright (c) Karan Misra 2014 + * + * 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. + */ + // +build ignore package main diff --git a/sensor/bh1750fvi/bh1750fvi.go b/sensor/bh1750fvi/bh1750fvi.go index 7f9b027..1bd37ac 100644 --- a/sensor/bh1750fvi/bh1750fvi.go +++ b/sensor/bh1750fvi/bh1750fvi.go @@ -1,3 +1,22 @@ +/* + * Copyright (c) Karan Misra 2013 + * + * 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 BH1750FVI allows interfacing with the BH1750FVI ambient light sensor through I2C. package bh1750fvi diff --git a/sensor/bme280/bme280.go b/sensor/bme280/bme280.go index d9e38b6..e2ea379 100644 --- a/sensor/bme280/bme280.go +++ b/sensor/bme280/bme280.go @@ -1,3 +1,22 @@ +/* + * 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 bme280 allows interfacing with Bosch BME280 digital humidity, pressure // and temperature sensor. package bme280 diff --git a/sensor/bmp085/bmp085.go b/sensor/bmp085/bmp085.go index c18250f..4b84e12 100644 --- a/sensor/bmp085/bmp085.go +++ b/sensor/bmp085/bmp085.go @@ -1,3 +1,22 @@ +/* + * Copyright (c) Karan Misra 2013 + * + * 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 bmp085 allows interfacing with Bosch BMP085 barometric pressure sensor. This sensor // has the ability to provided compensated temperature and pressure readings. package bmp085 diff --git a/sensor/bmp180/bmp180.go b/sensor/bmp180/bmp180.go index 02ba8f6..ef4f694 100644 --- a/sensor/bmp180/bmp180.go +++ b/sensor/bmp180/bmp180.go @@ -1,3 +1,22 @@ +/* + * Copyright (c) Karan Misra 2014 + * + * 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 bmp180 allows interfacing with Bosch BMP180 barometric pressure sensor. This sensor // has the ability to provided compensated temperature and pressure readings. package bmp180 diff --git a/sensor/l3gd20/l3gd20.go b/sensor/l3gd20/l3gd20.go index 6ce20d1..d0bf892 100644 --- a/sensor/l3gd20/l3gd20.go +++ b/sensor/l3gd20/l3gd20.go @@ -1,3 +1,22 @@ +/* + * Copyright (c) Karan Misra 2014 + * + * 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 l3gd20 allows interacting with L3GD20 gyroscoping sensor. package l3gd20 diff --git a/sensor/lsm303/lsm303.go b/sensor/lsm303/lsm303.go index 5af95e0..6637b2a 100644 --- a/sensor/lsm303/lsm303.go +++ b/sensor/lsm303/lsm303.go @@ -1,3 +1,22 @@ +/* + * Copyright (c) Karan Misra 2013 + * + * 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 lsm303 allows interfacing with the LSM303 magnetometer. package lsm303 diff --git a/sensor/tmp006/tmp006.go b/sensor/tmp006/tmp006.go index 7788996..cce81f4 100644 --- a/sensor/tmp006/tmp006.go +++ b/sensor/tmp006/tmp006.go @@ -1,3 +1,22 @@ +/* + * Copyright (c) Karan Misra 2014 + * + * 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 tmp006 allows interfacing with the TMP006 thermopile. package tmp006 diff --git a/sensor/us020/us020.go b/sensor/us020/us020.go index 694acff..78609de 100644 --- a/sensor/us020/us020.go +++ b/sensor/us020/us020.go @@ -1,3 +1,22 @@ +/* + * Copyright (c) Nikesh Vora 2013 + * + * 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 us020 allows interfacing with the US020 ultrasonic range finder. package us020 diff --git a/sensor/watersensor/watersensor.go b/sensor/watersensor/watersensor.go index 8bc3e8b..890c7ac 100644 --- a/sensor/watersensor/watersensor.go +++ b/sensor/watersensor/watersensor.go @@ -1,3 +1,22 @@ +/* + * Copyright (c) Kashyap Kopparam 2013 + * + * 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 watersensor allows interfacing with the water sensor. package watersensor diff --git a/spi.go b/spi.go index db5b029..4372d2b 100644 --- a/spi.go +++ b/spi.go @@ -1,3 +1,22 @@ +/* + * Copyright (c) Kunal Powar 2014 + * + * 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. + */ + // SPI support. package embd diff --git a/spidriver.go b/spidriver.go index a145155..3e6915b 100644 --- a/spidriver.go +++ b/spidriver.go @@ -1,3 +1,22 @@ +/* + * Copyright (c) Kunal Powar 2014 + * + * 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 embd import "sync" diff --git a/util/map_test.go b/util/map_test.go index 949364b..dbcd402 100644 --- a/util/map_test.go +++ b/util/map_test.go @@ -1,3 +1,22 @@ +/* + * Copyright (c) Karan Misra 2014 + * + * 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 util import "testing" diff --git a/utils.go b/utils.go index a2e0c32..797a105 100644 --- a/utils.go +++ b/utils.go @@ -1,3 +1,21 @@ +/* + * Copyright (c) Karan Misra 2014 + * + * 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 embd import "path/filepath" From 8b45556a0d8ecf72c6726ef6c5de8e0116665dee Mon Sep 17 00:00:00 2001 From: clinton Date: Mon, 22 May 2017 14:39:30 +1000 Subject: [PATCH 14/15] Removed authors and contributors list, git history is a better place for this. --- AUTHORS | 4 ---- CONTRIBUTORS | 17 ----------------- README.md | 3 --- update_contributors.sh | 5 ----- 4 files changed, 29 deletions(-) delete mode 100644 AUTHORS delete mode 100644 CONTRIBUTORS delete mode 100755 update_contributors.sh diff --git a/AUTHORS b/AUTHORS deleted file mode 100644 index 5586e60..0000000 --- a/AUTHORS +++ /dev/null @@ -1,4 +0,0 @@ -Karan Misra -Kunal Powar -Nikesh Vora -Akhil Sahdev diff --git a/CONTRIBUTORS b/CONTRIBUTORS deleted file mode 100644 index e3ca3e1..0000000 --- a/CONTRIBUTORS +++ /dev/null @@ -1,17 +0,0 @@ -adeschamps -alsm -Al S-M -Ben Delarre -Ben Schwartz -Gavin Cabbage -gotang -Kashyap Kopparam -Kunal Powar -Marco P. Monteiro -Matthew Dale -Nikesh Vora -SjB -Steve Beaulac -Thorsten von Eicken -wiless -Wu Jiang diff --git a/README.md b/README.md index 2a4b1e8..a0381fc 100644 --- a/README.md +++ b/README.md @@ -253,9 +253,6 @@ If you find a problem but are not up to coding a fix please file an [issue](https://github.com/cfreeman/embd/issues). Thank you! -## About - -EMBD is affectionately designed/developed by Karan Misra ([kidoman](https://github.com/kidoman)), Kunal Powar ([kunalpowar](https://github.com/kunalpowar)) and [FRIENDS](https://github.com/cfreeman/embd/blob/master/AUTHORS). We also have a list of [CONTRIBUTORS](https://github.com/cfreeman/embd/blob/master/CONTRIBUTORS). ## TODO * Continue to tidy up the readme and other documenting files. diff --git a/update_contributors.sh b/update_contributors.sh deleted file mode 100755 index 1446108..0000000 --- a/update_contributors.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env bash - -git log --all --format='%cN <%cE>' | sort -u | grep -v karan.misra@gmail.com |\ - grep -v noreply@ | cat CONTRIBUTORS - | sort | uniq > CONTRIBUTORS.new -mv CONTRIBUTORS.new CONTRIBUTORS From 88ef514ebdcf1299225ef2772248192683c605a1 Mon Sep 17 00:00:00 2001 From: clinton Date: Mon, 22 May 2017 14:47:09 +1000 Subject: [PATCH 15/15] Moved roadmap into the readme. --- README.md | 16 ++++++++-------- ROADMAP.md | 14 -------------- 2 files changed, 8 insertions(+), 22 deletions(-) delete mode 100644 ROADMAP.md diff --git a/README.md b/README.md index a0381fc..3f8115f 100644 --- a/README.md +++ b/README.md @@ -243,22 +243,22 @@ heading, err := mag.Heading() The above two examples depend on **I2C** and therefore will work without change on almost all platforms. - - ## Contributing [Pull requests](https://github.com/cfreeman/embd/pulls) that follow the [guidelines](https://github.com/cfreeman/embd/blob/master/CONTRIBUTING.md) are very appreciated. + If you find a problem but are not up to coding a fix please file an [issue](https://github.com/cfreeman/embd/issues). Thank you! +## ROADMAP -## TODO -* Continue to tidy up the readme and other documenting files. -* Remove AUTHORS & CONTRIBUTORS -- That stuff is better maintained within git history (don't forget update_contributors script). +* Continue to tidy up the README and other documentation. * move utils.go into util package -* Make sure there are samples for all the supported hardware. -* Better organise samples -> into godoc? +* Make sure there are samples for all supported hardware. Better organise samples move into godoc? * Rummage through the old, largely abandoned parent repo and pull in as many of the requests as possible. - +* A fully featured cli tool (**embd**) +* Continue to add support for additional sensors/controllers/convertors. +* Continue to add support for additional hosts (Cubietruck, Radxa, etc). +* Supporting something other than Linux diff --git a/ROADMAP.md b/ROADMAP.md deleted file mode 100644 index 257c8e0..0000000 --- a/ROADMAP.md +++ /dev/null @@ -1,14 +0,0 @@ -# embd roadmap - -The following features are planned (in no particular order): - -* A fully featured cli tool (**embd**) -* Support for UART, SPI -* Support for a whole range of sensors/controllers -* Support for Intel Galileo (will require a few changes to Golang, but not unsurmountable) -* Support for a lot of other ARM prototyping boards (Cubietruck, Radxa, etc.) -* Awesome documentation -* A embd UI (similar to the Arduino IDE) -* Supporting something other than Linux -* Support for vision processing (OpenCV ?) -* Allow remote instrumentation of the host via network/web sockets/etc.