|
|
|
@ -113,6 +113,8 @@ func New(p spi.Port, i i2c.Bus, cs gpio.PinOut) (*Dev, error) {
|
|
|
|
Dev: c,
|
|
|
|
Dev: c,
|
|
|
|
s: s,
|
|
|
|
s: s,
|
|
|
|
cs: cs,
|
|
|
|
cs: cs,
|
|
|
|
|
|
|
|
w: w,
|
|
|
|
|
|
|
|
h: h,
|
|
|
|
prevImg: image.NewGray16(image.Rect(0, 0, w, h)),
|
|
|
|
prevImg: image.NewGray16(image.Rect(0, 0, w, h)),
|
|
|
|
frameWidth: frameWidth,
|
|
|
|
frameWidth: frameWidth,
|
|
|
|
frameLines: frameLines,
|
|
|
|
frameLines: frameLines,
|
|
|
|
@ -142,6 +144,8 @@ type Dev struct {
|
|
|
|
*cci.Dev
|
|
|
|
*cci.Dev
|
|
|
|
s spi.Conn
|
|
|
|
s spi.Conn
|
|
|
|
cs gpio.PinOut
|
|
|
|
cs gpio.PinOut
|
|
|
|
|
|
|
|
w int
|
|
|
|
|
|
|
|
h int
|
|
|
|
prevImg *image.Gray16
|
|
|
|
prevImg *image.Gray16
|
|
|
|
frameA, frameB []byte
|
|
|
|
frameA, frameB []byte
|
|
|
|
frameWidth int // in bytes
|
|
|
|
frameWidth int // in bytes
|
|
|
|
@ -154,6 +158,11 @@ func (d *Dev) String() string {
|
|
|
|
return fmt.Sprintf("Lepton(%s/%s/%s)", d.Dev, d.s, d.cs)
|
|
|
|
return fmt.Sprintf("Lepton(%s/%s/%s)", d.Dev, d.s, d.cs)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Bounds returns the device frame size.
|
|
|
|
|
|
|
|
func (d *Dev) Bounds() image.Rectangle {
|
|
|
|
|
|
|
|
return image.Rect(0, 0, d.w, d.h)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// ReadImg reads an image.
|
|
|
|
// ReadImg reads an image.
|
|
|
|
//
|
|
|
|
//
|
|
|
|
// It is ok to call other functions concurrently to send commands to the
|
|
|
|
// It is ok to call other functions concurrently to send commands to the
|
|
|
|
|