-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bcm283x: Issue 62 Change bcm283x to use ioctl for GPIO pins, not sysf…
…s. (#63)
- Loading branch information
Showing
12 changed files
with
247 additions
and
110 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
// Copyright 2024 The Periph Authors. All rights reserved. | ||
// Use of this source code is governed under the Apache License, Version 2.0 | ||
// that can be found in the LICENSE file. | ||
// | ||
// Create a dummy chip for testing an non-Linux os. | ||
|
||
package gpioioctl | ||
|
||
import ( | ||
"log" | ||
|
||
"periph.io/x/conn/v3/gpio" | ||
"periph.io/x/conn/v3/gpio/gpioreg" | ||
) | ||
|
||
func makeDummyChip() { | ||
/* | ||
During pipeline builds, GPIOChips may not be available, or | ||
it may build on another OS. In that case, mock in enough | ||
for a test to pass. | ||
*/ | ||
|
||
line := GPIOLine{ | ||
number: 0, | ||
name: "DummyGPIOLine", | ||
consumer: "", | ||
edge: gpio.NoEdge, | ||
pull: gpio.PullNoChange, | ||
direction: LineDirNotSet, | ||
} | ||
|
||
chip := GPIOChip{name: "DummyGPIOChip", | ||
path: "/dev/gpiochipdummy", | ||
label: "Dummy GPIOChip for Testing Purposes", | ||
lineCount: 1, | ||
lines: []*GPIOLine{&line}, | ||
} | ||
Chips = append(Chips, &chip) | ||
Chips = append(Chips, &chip) | ||
if err := gpioreg.Register(&line); err != nil { | ||
nameStr := chip.Name() | ||
lineStr := line.String() | ||
log.Println("chip", nameStr, " gpioreg.Register(line) ", lineStr, " returned ", err) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
//go:build linux | ||
|
||
package gpioioctl_test | ||
|
||
// Copyright 2024 The Periph Authors. All rights reserved. | ||
|
Oops, something went wrong.