Documentation ¶
Index ¶
- Constants
- type ChipVersion
- type Dev
- func (dev *Dev) ChipVersion() (*ChipVersion, error)
- func (dev *Dev) Close() error
- func (dev *Dev) GetSystemStatus() (*SystemStatus, error)
- func (dev *Dev) I2CInputReport() ([]byte, error)
- func (dev *Dev) I2CReadRequest(slaveAddr uint8, flag I2CCondition, dataLength uint16) error
- func (dev *Dev) I2CReset() error
- func (dev *Dev) I2CWriteRequest(slaveAddr uint8, data []byte, flag I2CCondition) (int, error)
- func (dev *Dev) SetI2CClockSpeed(speedInKhz uint16) error
- func (dev *Dev) SetI2CMode(enable bool) error
- type I2CCondition
- type SystemClockSpeed
- type SystemStatus
- type UARTMode
Constants ¶
View Source
const ( VendorID = 0x0403 // VendorID is the USB vendor ID. ProductID = 0x6030 // ProductID is the USB product ID. )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChipVersion ¶
ChipVersion contains the results of a Chip Version operation.
type Dev ¶
type Dev struct {
// contains filtered or unexported fields
}
Dev is the device handle.
func (*Dev) ChipVersion ¶
func (dev *Dev) ChipVersion() (*ChipVersion, error)
ChipVersion performs a Chip Version operation.
func (*Dev) GetSystemStatus ¶
func (dev *Dev) GetSystemStatus() (*SystemStatus, error)
GetSystemStatus performs a Get System Status operation.
func (*Dev) I2CInputReport ¶
I2CInputReport performs an I²C Input Report operation.
func (*Dev) I2CReadRequest ¶
func (dev *Dev) I2CReadRequest(slaveAddr uint8, flag I2CCondition, dataLength uint16) error
I2CReadRequest performs an I²C Read Request operation.
func (*Dev) I2CWriteRequest ¶
I2CWriteRequest performs an I²C Write Request operation.
func (*Dev) SetI2CClockSpeed ¶
SetI2CClockSpeed performs a Set I²C Clock Speed operation.
func (*Dev) SetI2CMode ¶
SetI2CMode performs a Set I2C Mode operation.
type I2CCondition ¶
type I2CCondition uint8
const ( I2CConditionNone I2CCondition = 0 I2CConditionStart I2CCondition = 0x02 I2CConditionRepeatedStart I2CCondition = 0x03 I2CConditionStop I2CCondition = 0x04 I2CConditionStartAndStop I2CCondition = 0x06 )
type SystemClockSpeed ¶
type SystemClockSpeed uint8
const ( SystemClockSpeed12MHz SystemClockSpeed = 0 SystemClockSpeed24MHz SystemClockSpeed = 1 SystemClockSpeed48MHz SystemClockSpeed = 2 )
type SystemStatus ¶
type SystemStatus struct { ChipMode uint8 ClkCtl SystemClockSpeed SuspendStatus bool PowerEnableStatus bool I2CEnable bool UARTMode UARTMode HIDOverI2CEnable bool GPIO2Function uint8 GPIOAFunction uint8 GPIOGFunction uint8 SuspendOutPol uint8 EnableWakeupInt bool IntrCond uint8 EnablePowerSaving bool Reserved []byte }
SystemStatus contains the results of a Get System Status operation.
Click to show internal directories.
Click to hide internal directories.