Changed orange-fork
This commit is contained in:
1 parent
10e2150ec2
commit
0d2a167639
2 files changed
+107
-36
No files matched your search
+36
-36
@@ -3,12 +3,12 @@ package orangefork
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"periph.io/x/conn/v3/pin/pinreg"
|
||||
"strings"
|
||||
|
||||
"periph.io/x/conn/v3/driver/driverreg"
|
||||
"periph.io/x/conn/v3/gpio"
|
||||
"periph.io/x/conn/v3/pin"
|
||||
"periph.io/x/conn/v3/pin/pinreg"
|
||||
"periph.io/x/host/v3/allwinner"
|
||||
"periph.io/x/host/v3/distro"
|
||||
)
|
||||
@@ -71,7 +71,7 @@ var (
|
||||
FUN1_13 pin.Pin = allwinner.PL11 // IR-RX
|
||||
|
||||
PC1_5 gpio.PinIO = allwinner.PC5
|
||||
PC1_6 gpio.PinIO = allwinner.PC5
|
||||
PC1_6 gpio.PinIO = allwinner.PC6
|
||||
PC1_15 gpio.PinIO = allwinner.PC15
|
||||
PC1_16 gpio.PinIO = allwinner.PC16
|
||||
)
|
||||
@@ -91,23 +91,23 @@ func registerHeaders(model string) error {
|
||||
if isOrangePiZeroModel(model) {
|
||||
fmt.Println("It is an orange pi zero!")
|
||||
// 26pin expansion port
|
||||
if err := pinreg.Register("PA", [][]pin.Pin{
|
||||
{PA1_1, PA1_2},
|
||||
{PA1_3, PA1_4},
|
||||
{PA1_5, PA1_6},
|
||||
{PA1_7, PA1_8},
|
||||
{PA1_9, PA1_10},
|
||||
{PA1_11, PA1_12},
|
||||
{PA1_13, PA1_14},
|
||||
{PA1_15, PA1_16},
|
||||
{PA1_17, PA1_18},
|
||||
{PA1_19, PA1_20},
|
||||
{PA1_21, PA1_22},
|
||||
{PA1_23, PA1_24},
|
||||
{PA1_25, PA1_26},
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
//if err := pinreg.Register("PA", [][]pin.Pin{
|
||||
// {PA1_1, PA1_2},
|
||||
// {PA1_3, PA1_4},
|
||||
// {PA1_5, PA1_6},
|
||||
// {PA1_7, PA1_8},
|
||||
// {PA1_9, PA1_10},
|
||||
// {PA1_11, PA1_12},
|
||||
// {PA1_13, PA1_14},
|
||||
// {PA1_15, PA1_16},
|
||||
// {PA1_17, PA1_18},
|
||||
// {PA1_19, PA1_20},
|
||||
// {PA1_21, PA1_22},
|
||||
// {PA1_23, PA1_24},
|
||||
// {PA1_25, PA1_26},
|
||||
//}); err != nil {
|
||||
// return err
|
||||
//}
|
||||
|
||||
if err := pinreg.Register("PC", [][]pin.Pin{
|
||||
{PC1_5, PC1_6},
|
||||
@@ -119,23 +119,23 @@ func registerHeaders(model string) error {
|
||||
}
|
||||
|
||||
// 13pin function interface
|
||||
if err := pinreg.Register("FUN", [][]pin.Pin{
|
||||
{FUN1_1},
|
||||
{FUN1_2},
|
||||
{FUN1_3},
|
||||
{FUN1_4},
|
||||
{FUN1_5},
|
||||
{FUN1_6},
|
||||
{FUN1_7},
|
||||
{FUN1_8},
|
||||
{FUN1_9},
|
||||
{FUN1_10},
|
||||
{FUN1_11},
|
||||
{FUN1_12},
|
||||
{FUN1_13},
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
//if err := pinreg.Register("FUN", [][]pin.Pin{
|
||||
// {FUN1_1},
|
||||
// {FUN1_2},
|
||||
// {FUN1_3},
|
||||
// {FUN1_4},
|
||||
// {FUN1_5},
|
||||
// {FUN1_6},
|
||||
// {FUN1_7},
|
||||
// {FUN1_8},
|
||||
// {FUN1_9},
|
||||
// {FUN1_10},
|
||||
// {FUN1_11},
|
||||
// {FUN1_12},
|
||||
// {FUN1_13},
|
||||
//}); err != nil {
|
||||
// return err
|
||||
//}
|
||||
} else {
|
||||
fmt.Println("Sad panda")
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user