package
Version:
v0.7.4
Opens a new window with list of versions in this module.
Published: Feb 2, 2022
License: MIT
Opens a new window with license information.
Imports: 5
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
¶
Package mcp3w0c provides bit bashed device drivers for MCP3004/3008/3204/3208
SPI ADCs.
- Variables
-
type MCP3w0c
-
func New(c *gpiod.Chip, clk, csz, di, do int, width uint, options ...Option) (*MCP3w0c, error)
-
func NewMCP3008(c *gpiod.Chip, clk, csz, di, do int, options ...Option) (*MCP3w0c, error)
-
func NewMCP3208(c *gpiod.Chip, clk, csz, di, do int, options ...Option) (*MCP3w0c, error)
-
type Option
ErrClosed indicates the ADC is closed.
MCP3w0c reads ADC values from a connected Microchip MCP3xxx family device.
Supported variants are MCP3004/3008/3204/3208.
The w indicates the width of the device (0 => 10, 2 => 12)
and the c the number of channels.
NewMCP3008 creates a MCP3008.
NewMCP3208 creates a MCP3208.
Close releases all resources allocated to the ADC.
Read returns the value of a single channel read from the ADC.
ReadDifferential returns the value of a differential pair read from the ADC.
Option specifies a construction option for the ADC.
WithTclk sets the clock period for the ADC.
Note that this is the half-cycle period.
WithTset sets the settling period for the ADC.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.