Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/walkure/go-sc16is7x0
Go interface for I2C/SPI UART chip SC16IS740/750/760.
https://github.com/walkure/go-sc16is7x0
Last synced: about 4 hours ago
JSON representation
Go interface for I2C/SPI UART chip SC16IS740/750/760.
- Host: GitHub
- URL: https://github.com/walkure/go-sc16is7x0
- Owner: walkure
- Created: 2021-04-27T14:37:32.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2021-04-27T17:54:53.000Z (over 3 years ago)
- Last Synced: 2024-06-19T19:33:47.939Z (5 months ago)
- Language: Go
- Homepage:
- Size: 3.91 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# SC16IS7x0 Go Driver
Go interface for I2C/SPI UART chip [SC16IS740/750/760](https://www.nxp.com/products/peripherals-and-logic/signal-chain/bridges/single-uart-with-ic-bus-spi-interface-64-bs-of-transmit-and-receive-fifos-irda-sir-built-in-support:SC16IS740_750_760).
Tested only SC16IS750 (CJMCU-750).
# dependency
- [d2r2/go-i2c](https://github.com/d2r2/go-i2c)
# implements
- [io.ReadWriteCloser](https://golang.org/pkg/io/#ReadWriteCloser)
- [io.ByteReader](https://golang.org/pkg/io/#ByteReader)
- [io.ByteWriter](https://golang.org/pkg/io/#ByteWriter)# sample code
use with [eternal-flame-AD/mh-z19](https://github.com/eternal-flame-AD/mh-z19)
``` go
conf := &sc16is7x0.Config{Address: 0x48, XtalFreq: 14745600, Baud: 9600}dev, err := sc16is7x0.Open(conf)
if err != nil {
log.Fatal(err)
}concentration, err := z19.TakeReading(dev)
if err != nil {
log.Fatal(err)
}fmt.Printf("co2=%d ppm\n", concentration)
```# refer.
Inspired by [SC16IS750 Python Driver](https://github.com/walkure/SC16IS750) (Original version is [Harri-Renney/SC16IS750](https://github.com/Harri-Renney/SC16IS750)).