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:
parent
fdd1d6b5c3
commit
12db8443b0
7 changed files with 399 additions and 0 deletions
|
@ -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)
|
||||
},
|
||||
}
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue