rpi: add support for rpi a+/b+

This commit is contained in:
Karan Misra 2015-01-15 06:55:55 +05:30
parent f54c110445
commit de0ad53f3f
2 changed files with 20 additions and 4 deletions

View File

@ -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**

View File

@ -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
}