Golang Package for mini-box dcdc-usb power supply
Find a file
dependabot[bot] 3e09115ec7
Some checks are pending
Build / test (1.15.x, ubuntu-latest) (push) Waiting to run
Build / test (1.16.x, ubuntu-latest) (push) Waiting to run
Build / test (1.17.x, ubuntu-latest) (push) Waiting to run
Build / Analyze (push) Waiting to run
Build / codecov (push) Blocked by required conditions
Build / Lint project using GolangCI Lint (push) Blocked by required conditions
Build / goreadme (push) Blocked by required conditions
Build / release (push) Blocked by required conditions
Bump github.com/go-logr/logr from 1.2.3 to 1.2.4 (#7)
Bumps [github.com/go-logr/logr](https://github.com/go-logr/logr) from 1.2.3 to 1.2.4.
- [Release notes](https://github.com/go-logr/logr/releases)
- [Changelog](https://github.com/go-logr/logr/blob/master/CHANGELOG.md)
- [Commits](https://github.com/go-logr/logr/compare/v1.2.3...v1.2.4)

---
updated-dependencies:
- dependency-name: github.com/go-logr/logr
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-02-16 01:43:49 +08:00
.github Bump Go Versions 2022-02-19 15:13:18 +08:00
.vscode Initial Commit 2021-09-21 22:23:16 +08:00
captures Add Default File for Capture Replay 2022-01-14 14:14:34 +08:00
cmd replace logger with go-logr 2022-02-19 15:10:18 +08:00
internal replace logger with go-logr 2022-02-19 15:10:18 +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 replace logger with go-logr 2022-02-19 15:10:18 +08:00
dcdcusb_test.go replace logger with go-logr 2022-02-19 15:10:18 +08:00
dcdcusbexample_test.go replace logger with go-logr 2022-02-19 15:10:18 +08:00
definitions.go Capture and Simulation Support 2021-10-02 00:59:57 +08:00
doc.go Capture and Simulation Support 2021-10-02 00:59:57 +08:00
go.mod Bump github.com/go-logr/logr from 1.2.3 to 1.2.4 (#7) 2025-02-16 01:43:49 +08:00
go.sum Bump github.com/go-logr/logr from 1.2.3 to 1.2.4 (#7) 2025-02-16 01:43:49 +08:00
LICENSE Create LICENSE 2021-09-23 01:12:16 +08:00
README.md Update readme according to godoc 2022-02-19 07:15:25 +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

Building

Compile with the tag nogousb to disable compiling with USB Support. Then the only option available is a Simulator Mode that replays a previously captured session.

Sub Packages

Examples


dc := dcdcusb.DcDcUSB{}
logsink := log.New(os.Stdout, "", 0)
log := stdr.New(logsink)

dc.Init(log, false)
if ok, err := dc.Scan(); !ok {
    log.Error(err, "Scan Failed")
    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