mirror of
https://github.com/kidoman/embd
synced 2025-07-03 03:47:33 +02:00
simplify package structure
This commit is contained in:
parent
3cae4064dc
commit
36f2c0486d
41 changed files with 736 additions and 885 deletions
|
@ -4,8 +4,7 @@ package mcp4725
|
|||
import (
|
||||
"log"
|
||||
"sync"
|
||||
|
||||
"github.com/kidoman/embd/i2c"
|
||||
"github.com/kidoman/embd"
|
||||
)
|
||||
|
||||
const (
|
||||
|
@ -20,7 +19,7 @@ const (
|
|||
// MCP4725 represents a MCP4725 DAC.
|
||||
type MCP4725 struct {
|
||||
// Bus to communicate over.
|
||||
Bus i2c.Bus
|
||||
Bus embd.I2CBus
|
||||
// Addr of the sensor.
|
||||
Addr byte
|
||||
|
||||
|
@ -32,7 +31,7 @@ type MCP4725 struct {
|
|||
}
|
||||
|
||||
// New creates a new MCP4725 sensor.
|
||||
func New(bus i2c.Bus, addr byte) *MCP4725 {
|
||||
func New(bus embd.I2CBus, addr byte) *MCP4725 {
|
||||
return &MCP4725{
|
||||
Bus: bus,
|
||||
Addr: addr,
|
||||
|
|
|
@ -6,8 +6,7 @@ import (
|
|||
"math"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/kidoman/embd/i2c"
|
||||
"github.com/kidoman/embd"
|
||||
"github.com/kidoman/embd/util"
|
||||
)
|
||||
|
||||
|
@ -28,7 +27,7 @@ const (
|
|||
|
||||
// PCA9685 represents a PCA9685 PWM generator.
|
||||
type PCA9685 struct {
|
||||
Bus i2c.Bus
|
||||
Bus embd.I2CBus
|
||||
Addr byte
|
||||
Freq int
|
||||
|
||||
|
@ -39,7 +38,7 @@ type PCA9685 struct {
|
|||
}
|
||||
|
||||
// New creates a new PCA9685 interface.
|
||||
func New(bus i2c.Bus, addr byte) *PCA9685 {
|
||||
func New(bus embd.I2CBus, addr byte) *PCA9685 {
|
||||
return &PCA9685{
|
||||
Bus: bus,
|
||||
Addr: addr,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue