summaryrefslogtreecommitdiffstats
path: root/dependencies/pkg/mod/golang.org/x/exp@v0.0.0-20220613132600-b0d781184e0d/io/spi/devfs_nonlinux.go
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-28 12:36:04 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-28 12:36:04 +0000
commitb09c6d56832eb1718c07d74abf3bc6ae3fe4e030 (patch)
treed2caec2610d4ea887803ec9e9c3cd77136c448ba /dependencies/pkg/mod/golang.org/x/exp@v0.0.0-20220613132600-b0d781184e0d/io/spi/devfs_nonlinux.go
parentInitial commit. (diff)
downloadicingadb-b09c6d56832eb1718c07d74abf3bc6ae3fe4e030.tar.xz
icingadb-b09c6d56832eb1718c07d74abf3bc6ae3fe4e030.zip
Adding upstream version 1.1.0.upstream/1.1.0upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--dependencies/pkg/mod/golang.org/x/exp@v0.0.0-20220613132600-b0d781184e0d/io/spi/devfs_nonlinux.go40
1 files changed, 40 insertions, 0 deletions
diff --git a/dependencies/pkg/mod/golang.org/x/exp@v0.0.0-20220613132600-b0d781184e0d/io/spi/devfs_nonlinux.go b/dependencies/pkg/mod/golang.org/x/exp@v0.0.0-20220613132600-b0d781184e0d/io/spi/devfs_nonlinux.go
new file mode 100644
index 0000000..499d69d
--- /dev/null
+++ b/dependencies/pkg/mod/golang.org/x/exp@v0.0.0-20220613132600-b0d781184e0d/io/spi/devfs_nonlinux.go
@@ -0,0 +1,40 @@
+// Copyright 2016 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+//go:build !linux
+// +build !linux
+
+package spi
+
+import (
+ "errors"
+
+ "golang.org/x/exp/io/spi/driver"
+)
+
+// Devfs is a no-implementation of an SPI driver that works against the devfs.
+// You need to have loaded the Linux "spidev" module to use this driver.
+type Devfs struct {
+ // Dev is the device to be opened.
+ // Device name is usually in the /dev/spidev<bus>.<chip> format.
+ // Required.
+ Dev string
+
+ // Mode is the SPI mode. SPI mode is a combination of polarity and phases.
+ // CPOL is the high order bit, CPHA is the low order. Pre-computed mode
+ // values are Mode0, Mode1, Mode2 and Mode3. The value of the mode argument
+ // can be overridden by the device's driver.
+ // Required.
+ Mode Mode
+
+ // MaxSpeed is the max clock speed (Hz) and can be overridden by the device's driver.
+ // Required.
+ MaxSpeed int64
+}
+
+// Open opens the provided device with the speicifed options
+// and returns a connection.
+func (d *Devfs) Open() (driver.Conn, error) {
+ return nil, errors.New("not implemented on this platform")
+}