1
0
Fork 0
mirror of https://github.com/kidoman/embd synced 2025-07-03 11:57:38 +02:00

spi: added spi feature for all bbb and rpi

This commit is contained in:
Kunal Powar 2014-04-28 01:18:14 +05:30
parent fdd1d6b5c3
commit 12db8443b0
7 changed files with 399 additions and 0 deletions

View file

@ -94,6 +94,8 @@ var ledMap = embd.LEDMap{
"beaglebone:green:usr3": []string{"3", "USR3", "usr3"},
}
var spiDeviceMinor = byte(1)
func ensureFeatureEnabled(id string) error {
pattern := "/sys/devices/bone_capemgr.*/slots"
file, err := embd.FindFirstMatchingFile(pattern)
@ -165,6 +167,9 @@ func init() {
LEDDriver: func() embd.LEDDriver {
return embd.NewLEDDriver(ledMap, generic.NewLED)
},
SPIDriver: func() embd.SPIDriver {
return embd.NewSPIDriver(spiDeviceMinor, generic.NewSPIBus)
},
}
})
}