golang.org/x/exp@v0.0.0-20240506185415-9bf2ced13842/io/i2c/devfs_nonlinux.go (about)

     1  // Copyright 2016 The Go Authors. All rights reserved.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  //go:build !linux
     6  
     7  package i2c
     8  
     9  import (
    10  	"errors"
    11  
    12  	"golang.org/x/exp/io/i2c/driver"
    13  )
    14  
    15  // Devfs is no-implementation so developers using cross compilation
    16  // can rely on local tools even though the real implementation isn't
    17  // available on their platform.
    18  type Devfs struct {
    19  	Dev string
    20  }
    21  
    22  func (d *Devfs) Open(addr int, tenbit bool) (driver.Conn, error) {
    23  	return nil, errors.New("not implemented on this platform")
    24  }