Documentation
¶
Overview ¶
Package wire implements the Dallas Semiconductor Corp.'s 1-wire bus system.
Wikipedia: https://en.wikipedia.org/wiki/1-Wire
Index ¶
- Constants
- type Config
- type Device
- func (d *Device) Configure(config Config)
- func (d Device) Read() (data uint8)
- func (d Device) ReadAddress() ([]uint8, error)
- func (d Device) ReadBit() (data uint8)
- func (d Device) Reset() error
- func (d Device) Search(cmd uint8) ([][]uint8, error)
- func (d Device) Select(romid []uint8) error
- func (d Device) Write(data uint8)
- func (d Device) WriteBit(data uint8)
- func (d Device) Сrc8(buffer []uint8, size int) (crc uint8)
Constants ¶
View Source
const ( READ_ROM uint8 = 0x33 MATCH_ROM uint8 = 0x55 SKIP_ROM uint8 = 0xCC SEARCH_ROM uint8 = 0xF0 )
OneWire ROM commands
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Device ¶
type Device struct {
// contains filtered or unexported fields
}
Device wraps a connection to an 1-Wire devices.
func New ¶
New creates a new GPIO 1-Wire connection. The pin must be pulled up to the VCC via a resistor greater than 500 ohms (default 4.7k).
func (Device) ReadAddress ¶
ReadAddress receives a 64-bit unique ROM ID from Device. (LSB first) Note: use this if there is only one slave device on the bus.
func (Device) Search ¶
Search searches for all devices on the bus. Note: max 32 slave devices per bus
Click to show internal directories.
Click to hide internal directories.