unicornpaint

A web-based painting app for raspberry PI and pimoroni Unicorn Hat HD
Log | Files | Refs | README

SpiRenderDevice.go (300B)


      1 package unicorn
      2 
      3 import (
      4 	"github.com/ecc1/spi"
      5 )
      6 
      7 type SpiRenderDevice struct {
      8 	device *spi.Device
      9 }
     10 
     11 func NewSpiRenderDevice() (*SpiRenderDevice, error) {
     12 	dev, err := spi.Open("/dev/spidev0.0", 9000000, 0)
     13 	if err != nil {
     14 		return nil, err
     15 	}
     16 	return &SpiRenderDevice{
     17 		device: dev,
     18 	}, nil
     19 }