Skip to content
/ smbus Public
forked from go-daq/smbus

smbus provides access to the System Management bus over I2C

License

Notifications You must be signed in to change notification settings

aterlo/smbus

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

smbus

GoDoc

smbus provides access to the System Management bus, over I2C.

Example

func TestOpen(t *testing.T) {
	usr, err := user.Current()
	if err != nil {
		t.Fatalf("os/user: %v\n", err)
	}

	if usr.Name != "root" {
		t.Skip("need root access")
	}

	c, err := smbus.Open(0, 0x69)
	if err != nil {
		t.Fatalf("open error: %v\n", err)
	}
	defer c.Close()

	v, err := c.ReadReg(0x69, 0x1)
	if err != nil {
		t.Fatalf("read-reg error: %v\n", err)
	}
	t.Logf("v=%v\n", v)
}

About

smbus provides access to the System Management bus over I2C

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 100.0%