Golang Package for mini-box dcdc-usb power supply
Find a file
2021-09-23 19:04:52 +08:00
.github Create dependabot.yml 2021-09-23 19:04:52 +08:00
.vscode Initial Commit 2021-09-21 22:23:16 +08:00
cmd Reorg, Update Tests and Github Actions (#2) 2021-09-23 00:59:07 +08:00
.gitignore Add Github Workflows etc 2021-09-21 22:27:51 +08:00
codecov.yml Reorg, Update Tests and Github Actions (#2) 2021-09-23 00:59:07 +08:00
dcdcmodet_string.go Reorg, Update Tests and Github Actions (#2) 2021-09-23 00:59:07 +08:00
dcdcstatet_string.go Reorg, Update Tests and Github Actions (#2) 2021-09-23 00:59:07 +08:00
dcdcusb.go Reorg, Update Tests and Github Actions (#2) 2021-09-23 00:59:07 +08:00
dcdcusb_test.go Reorg, Update Tests and Github Actions (#2) 2021-09-23 00:59:07 +08:00
dcdcusbexample_test.go Reorg, Update Tests and Github Actions (#2) 2021-09-23 00:59:07 +08:00
definitions.go Reorg, Update Tests and Github Actions (#2) 2021-09-23 00:59:07 +08:00
doc.go Reorg, Update Tests and Github Actions (#2) 2021-09-23 00:59:07 +08:00
go.mod Drop Go Version 2021-09-23 18:53:47 +08:00
go.sum Reorg, Update Tests and Github Actions (#2) 2021-09-23 00:59:07 +08:00
LICENSE Create LICENSE 2021-09-23 01:12:16 +08:00
README.md Update readme accoridng to godoc 2021-09-23 10:56:13 +00:00

Go-LogAdapter

codecov GoDoc

Package go-dcdcusb interfaces with the DCDCUSB power supply from mini-box (https://www.mini-box.com/DCDC-USB) via USB port and allows you to retrive the status of the power supply

it depends upon GoUSB which in turn depends upon the libusb C library, thus CGO is required for this module

Please see the GoUSB pages for hints on compiling for platforms other than linux

Sub Packages

Examples


dc := dcdcusb.DcDcUSB{}
dc.Init()
if ok, err := dc.Scan(); !ok {
    log.Fatalf("Scan Failed: %v", err)
    return
}
defer dc.Close()
for i := 0; i < 100; i++ {
    ctx, cancel := context.WithTimeout(context.Background(), (1 * time.Second))
    dc.GetAllParam(ctx)
    cancel()
    time.Sleep(1 * time.Second)
}
dc.Close()


Readme created from Go doc with goreadme