Documentation ¶
Index ¶
- Constants
- type FTDI232H
- func (f *FTDI232H) Close() error
- func (f *FTDI232H) ConfigPin(pin gpio.Pin, mode gpio.IODirection)
- func (f *FTDI232H) ConfigPinNoWrite(pin gpio.Pin, mode gpio.IODirection)
- func (f *FTDI232H) ConfigPins(pins []gpio.PinConfiguration, write bool)
- func (f *FTDI232H) Configure(sleepingPoll bool) error
- func (f *FTDI232H) EnableMPSSE()
- func (f *FTDI232H) GetLevels() uint16
- func (f *FTDI232H) Initialize(disableDrivers bool) error
- func (f *FTDI232H) Open(channel ftdi.Channel) error
- func (f *FTDI232H) OpenFirst() error
- func (f *FTDI232H) Output(pin gpio.Pin, value gpio.PinState) error
- func (f *FTDI232H) OutputHigh(pin gpio.Pin) error
- func (f *FTDI232H) OutputLow(pin gpio.Pin) error
- func (f *FTDI232H) PinsRead() (byte, error)
- func (f *FTDI232H) PollRead(expected int, timeout int64) ([]byte, error)
- func (f *FTDI232H) ReadInput(pin gpio.Pin) gpio.PinState
- func (f *FTDI232H) ReadInputs() (pins gpio.Pins)
- func (f *FTDI232H) SetBaudrate(baudRate int) error
- func (f *FTDI232H) SetBitmode(iomask byte, mode ftdi.Mode) error
- func (f *FTDI232H) SetClock(clock int, adaptive, threePhase bool)
- func (f *FTDI232H) SetConfigPin(pin gpio.Pin, mode gpio.IODirection)
- func (f *FTDI232H) SetHigh(pin gpio.Pin)
- func (f *FTDI232H) SetLow(pin gpio.Pin)
- func (f *FTDI232H) SetPin(pin gpio.Pin, value gpio.PinState)
- func (f *FTDI232H) SetPortCPins(pins byte)
- func (f *FTDI232H) SetPortDPins(pins byte)
- func (f *FTDI232H) SetTarget(vender, product int)
- func (f *FTDI232H) SoftConfigure(sleepingPoll bool) error
- func (f FTDI232H) String() string
- func (f *FTDI232H) SubmitRead(expected int) (*ftdi.Transfer, error)
- func (f *FTDI232H) ToStringFullBinary() string
- func (f *FTDI232H) Write(data []byte) (int, error)
- func (f *FTDI232H) WriteByte(data byte) (cnt int, err error)
- func (f *FTDI232H) WriteGPIO() error
- func (f *FTDI232H) WriteLen(data []byte, length int) (int, error)
Constants ¶
const ( D0 gpio.Pin = iota D1 D2 D3 D4 D5 D6 D7 C0 C1 C2 C3 C4 C5 C6 C7 // Rarely used pins. Requires EEPROM modifications. C8 C9 )
----------------------------------------------------------------------------- Pins -----------------------------------------------------------------------------
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FTDI232H ¶
type FTDI232H struct { Vender int Product int // If SleepingPoll = true then a 1 microsecond sleep occurs between each buffer // read while polling. Default is `False` SleepingPoll bool // contains filtered or unexported fields }
FTDI232H represents the Adafruit USB to GPIO breakout board. Adafruit part number is: P2264
The board exposes all 16 io pins: D0->D7 and C0->C7
func NewFTDI232H ¶
NewFTDI232H creates and configures FTDI. if disableDrivers = true then you need to run as root. [vendor] is typically 0x0403 There are several products, for example: 0x6014 = FT232H
func (*FTDI232H) ConfigPin ¶
func (f *FTDI232H) ConfigPin(pin gpio.Pin, mode gpio.IODirection)
ConfigPin sets the input or output mode for a specified pin. Mode should be either OUT or IN.
func (*FTDI232H) ConfigPinNoWrite ¶
func (f *FTDI232H) ConfigPinNoWrite(pin gpio.Pin, mode gpio.IODirection)
ConfigPinNoWrite sets the input or output mode for a specified pin and does not write to pins
func (*FTDI232H) ConfigPins ¶
func (f *FTDI232H) ConfigPins(pins []gpio.PinConfiguration, write bool)
ConfigPins and write out pins
func (*FTDI232H) Initialize ¶
Initialize optionally disables any conflicting drivers.
func (*FTDI232H) Output ¶
Output sets AND writes the specified pin to the provided high/low value. Value should be either HIGH/LOW or a boolean (true = high).
func (*FTDI232H) OutputHigh ¶
OutputHigh sets the pin High AND writes it to the device.
func (*FTDI232H) PollRead ¶
PollRead reads an expected number of bytes by polling for them. This is a "bit-bang" type of read. [timeout] is specified in seconds. If [timeout] == -1 then timeout = 10 seconds
func (*FTDI232H) ReadInput ¶
ReadInput reads the specified pin and returns OutputHigh/true if the pin is pulled high, or OutputLow/false if pulled low.
func (*FTDI232H) ReadInputs ¶
ReadInputs returns all pin data as a 16bit value
func (*FTDI232H) SetBaudrate ¶
SetBaudrate sets the transfer speed
func (*FTDI232H) SetBitmode ¶
SetBitmode sets bit mode of device
func (*FTDI232H) SetClock ¶
SetClock sets the clock speed. [adaptive] has a typical default of `false`, [threePhase] is typically `false` [clock] is specified in Hertzs (Hz) Set the clock speed of the MPSSE engine. Can be any value from 450hz to 30mhz and will pick that speed or the closest speed below it.
func (*FTDI232H) SetConfigPin ¶
func (f *FTDI232H) SetConfigPin(pin gpio.Pin, mode gpio.IODirection)
SetConfigPin sets the input or output mode for a specified pin. Mode should be either OUT or IN. Note: This does NOT write to the device.
func (*FTDI232H) SetPin ¶
SetPin only sets the buffer pin value. It does NOT write the pin to the device.
func (*FTDI232H) SetPortCPins ¶
SetPortCPins sets C0-C7 pins.
func (*FTDI232H) SetPortDPins ¶
SetPortDPins sets D0-D7 pins.
func (*FTDI232H) SoftConfigure ¶
SoftConfigure sets default values for BitBang.
func (*FTDI232H) SubmitRead ¶
SubmitRead sumbits an int using Transfer
func (*FTDI232H) ToStringFullBinary ¶
ToStringFullBinary returns a full report of the component