Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for nanopi boards supported by periph.io #2157

Merged
merged 3 commits into from
Apr 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions components/board/nanopi/board.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// Package nanopi implements a nanopi based board.
biotinker marked this conversation as resolved.
Show resolved Hide resolved
// This is an experimental package.
// Supported functionality: GPIO pins, I2C, SPI, Software PWM
// Unsupported functionality: Digital Interrupts, Hardware PWM
package nanopi

import (
"github.com/edaniels/golog"
"periph.io/x/host/v3"

"go.viam.com/rdk/components/board/genericlinux"
)

const modelName = "nanopi"

func init() {
if _, err := host.Init(); err != nil {
golog.Global().Debugw("error initializing host", "error", err)
}
genericlinux.RegisterBoard(modelName, nil, true)
}
1 change: 1 addition & 0 deletions components/board/register/register.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
_ "go.viam.com/rdk/components/board/fake"
_ "go.viam.com/rdk/components/board/hat/pca9685"
_ "go.viam.com/rdk/components/board/jetson"
_ "go.viam.com/rdk/components/board/nanopi"
_ "go.viam.com/rdk/components/board/numato"
_ "go.viam.com/rdk/components/board/pi"
_ "go.viam.com/rdk/components/board/ti"
Expand Down