embd: github.com/kidoman/embd/controller/mcp4725 Index | Files

package mcp4725

import "github.com/kidoman/embd/controller/mcp4725"

Package mcp4725 allows interfacing with the MCP4725 DAC.


Package Files


type MCP4725 Uses

type MCP4725 struct {
    // Bus to communicate over.
    Bus embd.I2CBus
    // Addr of the sensor.
    Addr byte
    // contains filtered or unexported fields

MCP4725 represents a MCP4725 DAC.

func New Uses

func New(bus embd.I2CBus, addr byte) *MCP4725

New creates a new MCP4725 sensor.

func (*MCP4725) Close Uses

func (d *MCP4725) Close() error

Close puts the DAC into power down mode.

func (*MCP4725) SetPersistedVoltage Uses

func (d *MCP4725) SetPersistedVoltage(voltage int) error

SetPersistedVoltage sets the voltage and programs the EEPROM so that the voltage is restored on reboot.

func (*MCP4725) SetVoltage Uses

func (d *MCP4725) SetVoltage(voltage int) error

SetVoltage sets the output voltage.

Package mcp4725 imports 3 packages (graph). Updated 2016-07-16. Refresh now. Tools for package owners.