Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/SpaceLeap/go-embedded
/ functions
Functions
97 in github.com/SpaceLeap/go-embedded
⨍
Functions
97
◇
Types & classes
16
↓ 27 callers
Function
wrapErr
(method string, err error)
i2c/i2c.go:28
↓ 11 callers
Method
smbusAccess
(readWrite, register uint8, size int, data unsafe.Pointer)
i2c/i2c.go:82
↓ 6 callers
Method
Close
()
pwm/pwm.go:111
↓ 4 callers
Function
SwapBytes
(word uint16)
i2c/i2c.go:15
↓ 4 callers
Method
setModeFlag
(flag bool, mask uint8)
spi/spi.go:290
↓ 3 callers
Method
Close
Close unexports the GPIO pin.
gpio/gpio.go:85
↓ 3 callers
Method
ensureValueFileIsOpen
func (gpio *GPIO) SetPullUpDown(pull PullUpDown) error { file, err := os.OpenFile("/sys/kernel/debug/omap_mux/", os.O_WRONLY, 0660) if err != nil {
gpio/gpio.go:119
↓ 2 callers
Function
IsDeviceTreeLoaded
(name string)
common.go:39
↓ 2 callers
Function
IsExported
(nr int)
gpio/gpio.go:54
↓ 2 callers
Method
ReadUint16Reg
ReadUint16Reg is very like ReadUint8Reg; again, data is read from a device, from a designated register. But this time, the data is a complete word (16
i2c/i2c.go:163
↓ 2 callers
Method
SetDuty
(duty time.Duration)
pwm/pwm.go:140
↓ 2 callers
Method
WriteUint16Reg
WriteUint16Reg is the opposite of the ReadUint16Reg operation. 16 bits of data is written to a device, to the designated register.
i2c/i2c.go:173
↓ 2 callers
Function
servoPositionToDuty
(position float32)
pwm/servo.go:10
↓ 2 callers
Method
setEdge
(edge Edge)
gpio/gpio.go:152
↓ 2 callers
Method
setModeInt
(mode uint8)
spi/spi.go:304
↓ 1 callers
Function
BuildPath
(partialPath, prefix string)
common.go:26
↓ 1 callers
Method
Close
()
adc/adc.go:65
↓ 1 callers
Method
Close
()
i2c/i2c.go:63
↓ 1 callers
Method
DisableEdgeDetection
()
gpio/gpio.go:213
↓ 1 callers
Function
NewPWM
(key string, period, duty time.Duration, polarity Polarity)
pwm/pwm.go:47
↓ 1 callers
Method
ProcessCall
ProcessCall selects a device register (through the register byte), sends 16 bits of data to it, and reads 16 bits of data in return.
i2c/i2c.go:223
↓ 1 callers
Method
ReadRaw
()
adc/adc.go:73
↓ 1 callers
Method
ReadUint16RegSwapped
ReadUint16RegSwapped is very like ReadUint8Reg; again, data is read from a device, from a designated register. But this time, the data is a complete w
i2c/i2c.go:181
↓ 1 callers
Method
ReadUint8
ReadUint8 reads a single byte from a device, without specifying a device register. Some devices are so simple that this interface is enough; for other
i2c/i2c.go:106
↓ 1 callers
Method
ReadUint8Reg
ReadUint8Reg reads a single byte from a device, from a designated register.
i2c/i2c.go:135
↓ 1 callers
Method
SetAddress
(address int)
i2c/i2c.go:71
↓ 1 callers
Method
SetDirection
(direction Direction)
gpio/gpio.go:104
↓ 1 callers
Method
SetPeriod
(period time.Duration)
pwm/pwm.go:127
↓ 1 callers
Method
SetPolarity
(polarity Polarity)
pwm/pwm.go:153
↓ 1 callers
Method
StartEdgeDetectCallbacks
StartEdgeDetectCallbacks starts a thread that calls callback for every detected edge. An error or DisableEdgeDetection stops the thread.
gpio/gpio.go:224
↓ 1 callers
Method
Value
()
gpio/gpio.go:131
↓ 1 callers
Method
WaitForEdge
(edge Edge)
gpio/gpio.go:166
↓ 1 callers
Method
Write
Write data to SPI device.
spi/spi.go:117
↓ 1 callers
Method
WriteUint16RegSwapped
WriteUint16RegSwapped is the opposite of the ReadUint16RegSwapped operation. 16 bits of data is written to a device, to the designated register. The b
i2c/i2c.go:189
↓ 1 callers
Method
WriteUint8
WriteUint8 sends a single byte to a device.
i2c/i2c.go:115
↓ 1 callers
Method
WriteUint8Reg
WriteUint8Reg writes a single byte to a device, to a designated register.
i2c/i2c.go:144
Method
AIn
()
adc/adc.go:69
Method
Address
()
i2c/i2c.go:67
Method
BitsPerWord
()
spi/spi.go:238
Method
CSHigh
CS active high
spi/spi.go:203
Function
Cleanup
()
adc/adc.go:46
Function
Cleanup
()
pwm/pwm.go:43
Method
Close
Disconnects the object from the interface.
spi/spi.go:107
Method
Close
Closes the current servo instance
pwm/servo.go:53
Method
Direction
()
gpio/gpio.go:98
Method
Duty
()
pwm/pwm.go:136
Method
Error
()
i2c/i2c.go:24
Function
Init
(devicesDir string)
common.go:17
Function
Init
(deviceTreePrefix string)
adc/adc.go:27
Function
Init
(deviceTree string)
spi/spi.go:49
Function
Init
(deviceTreePrefix, pwmDevicePrefix string)
pwm/pwm.go:33
Method
IsEdgeDetectionEnabled
()
gpio/gpio.go:209
Method
Key
()
pwm/pwm.go:119
Method
LSBFirst
()
spi/spi.go:212
Function
LoadDeviceTree
(name string)
common.go:47
Method
Loop
Loop returns the loopback configuration.
spi/spi.go:229
Method
MaxSpeedHz
()
spi/spi.go:266
Method
Mode
()
spi/spi.go:189
Function
NewADC
(ain Name)
adc/adc.go:55
Function
NewGPIO
NewGPIO exports the GPIO pin nr.
gpio/gpio.go:66
Function
NewI2C
Connects the object to the specified SMBus.
i2c/i2c.go:46
Function
NewSPI
NewSPI returns a new SPI object that is connected to the specified SPI device interface. NewSPI(X,Y) will open /dev/spidev-X.Y SPI is an object type
spi/spi.go:74
Function
NewServo
(key string, position float32)
pwm/servo.go:19
Method
Period
()
pwm/pwm.go:123
Method
Polarity
()
pwm/pwm.go:149
Method
Position
Position returns the servo position in the range from 0.0 to 1.0
pwm/servo.go:32
Method
ProcessCallBlock
ProcessCallBlock reads a block of up to 32 bytes from a device, from a designated register.
i2c/i2c.go:241
Method
ProcessCallSwapped
ProcessCallSwapped selects a device register (through the register byte), sends 16 bits of data to it, and reads 16 bits of data in return. The bytes
i2c/i2c.go:234
Method
Read
Read len(data) bytes from SPI device.
spi/spi.go:112
Method
Read
TODO: Perform I2C Block Read transaction. With if len == 32 then arg = C.I2C_SMBUS_I2C_BLOCK_BROKEN instead of I2C_SMBUS_I2C_BLOCK_DATA ???
i2c/i2c.go:283
Method
ReadBlock
ReadBlock writes up to 32 bytes to a device, to a designated register.
i2c/i2c.go:257
Method
ReadInt16Reg
ReadInt16Reg is very like ReadInt8Reg; again, data is read from a device, from a designated register. But this time, the data is a complete word (16 b
i2c/i2c.go:195
Method
ReadInt16RegSwapped
ReadInt16RegSwapped is very like ReadInt8RegSwapped; again, data is read from a device, from a designated register. But this time, the data is a compl
i2c/i2c.go:209
Method
ReadInt8
ReadInt8 reads a single byte from a device, without specifying a device register. Some devices are so simple that this interface is enough; for others
i2c/i2c.go:124
Method
ReadInt8Reg
ReadInt8Reg reads a single byte from a device, from a designated register.
i2c/i2c.go:150
Method
ReadValue
()
adc/adc.go:79
Method
SetBitsPerWord
(bits uint8)
spi/spi.go:242
Method
SetCSHigh
CS active high
spi/spi.go:208
Method
SetLSBFirst
(lsbFirst bool)
spi/spi.go:216
Method
SetLoop
SetLoop sets the loopback configuration.
spi/spi.go:234
Method
SetMaxSpeedHz
(maxSpeedHz uint32)
spi/spi.go:270
Method
SetMode
(mode Mode)
spi/spi.go:193
Method
SetPosition
SetPosition sets the servo position in the range from 0.0 to 1.0. position will be clamped if outside 0.0 to 1.0
pwm/servo.go:38
Method
SetThreeWire
(threeWire bool)
spi/spi.go:224
Method
SetValue
(value Value)
gpio/gpio.go:143
Method
StartEdgeDetectEvents
StartEdgeDetectEvents starts a thread that sends EdgeEvent instances into the events channel for every edge. EdgeEvent contains the time of the event,
gpio/gpio.go:241
Method
ThreeWire
()
spi/spi.go:220
Function
UnloadDeviceTree
(name string)
common.go:59
Method
Write
(p []byte)
i2c/i2c.go:288
Method
WriteBlock
WriteBlock selects a device register, sends 1 to 31 bytes of data to it, and reads 1 to 31 bytes of data in return.
i2c/i2c.go:268
Method
WriteInt16Reg
WriteInt16Reg is the opposite of the ReadInt16Reg operation. 16 bits of data is written to a device, to the designated register.
i2c/i2c.go:202
Method
WriteInt16RegSwapped
WriteInt16RegSwapped is the opposite of the ReadInt16RegSwapped operation. 16 bits of data is written to a device, to the designated register. The byt
i2c/i2c.go:217
Method
WriteInt8
WriteInt8 sends a single byte to a device.
i2c/i2c.go:130
Method
WriteInt8Reg
WriteInt8Reg writes a single byte to a device, to a designated register.
i2c/i2c.go:156
Method
WriteQuick
WriteQuick sends a single bit to the device, at the place of the Rd/Wr bit.
i2c/i2c.go:97
Method
Xfer
Xfer performs a SPI transaction. CS will be released and reactivated between blocks. delay specifies delay in usec between blocks.
spi/spi.go:135
Method
Xfer2
Xfer2 performs a SPI transaction. CS will be held active between blocks.
spi/spi.go:164