mirror of
https://github.com/kidoman/embd
synced 2025-02-24 03:18:18 +01:00
rpi: add support for rpi a+/b+
This commit is contained in:
parent
f54c110445
commit
de0ad53f3f
@ -66,9 +66,9 @@ Join the [mailing list](https://groups.google.com/forum/#!forum/go-embd)
|
||||
|
||||
## Platforms Supported
|
||||
|
||||
* [RaspberryPi](http://www.raspberrypi.org/)
|
||||
* [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/))
|
||||
* [BeagleBone Black](http://beagleboard.org/Products/BeagleBone%20Black)
|
||||
* [Intel Galileo](http://www.intel.com/content/www/us/en/do-it-yourself/galileo-maker-quark-board.html) **coming soon**
|
||||
* [Intel Edison](http://www.intel.com/content/www/us/en/do-it-yourself/galileo-maker-quark-board.html) **coming soon**
|
||||
* [Radxa](http://radxa.com/) **coming soon**
|
||||
* [Cubietruck](http://www.cubietruck.com/) **coming soon**
|
||||
* Bring Your Own **coming soon**
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
Package rpi provides Raspberry Pi support.
|
||||
Package rpi provides Raspberry Pi (including A+/B+) support.
|
||||
The following features are supported on Linux kernel 3.8+
|
||||
|
||||
GPIO (digital (rw))
|
||||
@ -55,13 +55,29 @@ var rev2Pins = embd.PinMap{
|
||||
&embd.PinDesc{ID: "P1_26", Aliases: []string{"7", "GPIO_7", "CE1", "SPI0_CE1_N"}, Caps: embd.CapDigital | embd.CapSPI, DigitalLogical: 7},
|
||||
}
|
||||
|
||||
// This is the same as the Rev 2 for the first 26 pins.
|
||||
var rev3Pins = append(append(embd.PinMap(nil), rev2Pins...), embd.PinMap{
|
||||
&embd.PinDesc{ID: "P1_29", Aliases: []string{"5", "GPIO_5"}, Caps: embd.CapDigital, DigitalLogical: 5},
|
||||
&embd.PinDesc{ID: "P1_31", Aliases: []string{"6", "GPIO_6"}, Caps: embd.CapDigital, DigitalLogical: 6},
|
||||
&embd.PinDesc{ID: "P1_32", Aliases: []string{"12", "GPIO_12"}, Caps: embd.CapDigital, DigitalLogical: 12},
|
||||
&embd.PinDesc{ID: "P1_33", Aliases: []string{"13", "GPIO_13"}, Caps: embd.CapDigital, DigitalLogical: 13},
|
||||
&embd.PinDesc{ID: "P1_35", Aliases: []string{"19", "GPIO_19"}, Caps: embd.CapDigital, DigitalLogical: 19},
|
||||
&embd.PinDesc{ID: "P1_36", Aliases: []string{"16", "GPIO_16"}, Caps: embd.CapDigital, DigitalLogical: 16},
|
||||
&embd.PinDesc{ID: "P1_37", Aliases: []string{"26", "GPIO_26"}, Caps: embd.CapDigital, DigitalLogical: 26},
|
||||
&embd.PinDesc{ID: "P1_38", Aliases: []string{"20", "GPIO_20"}, Caps: embd.CapDigital, DigitalLogical: 20},
|
||||
&embd.PinDesc{ID: "P1_40", Aliases: []string{"21", "GPIO_21"}, Caps: embd.CapDigital, DigitalLogical: 21},
|
||||
}...)
|
||||
|
||||
var ledMap = embd.LEDMap{
|
||||
"led0": []string{"0", "led0", "LED0"},
|
||||
}
|
||||
|
||||
func init() {
|
||||
embd.Register(embd.HostRPi, func(rev int) *embd.Descriptor {
|
||||
var pins = rev2Pins
|
||||
pins := rev3Pins
|
||||
if rev < 16 {
|
||||
pins = rev2Pins
|
||||
}
|
||||
if rev < 4 {
|
||||
pins = rev1Pins
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user