Instrument control package: Difference between revisions
Jump to navigation
Jump to search
Line 498: | Line 498: | ||
* Setting minor, sad, send_eoi and eos_mode is not implemented yet. | * Setting minor, sad, send_eoi and eos_mode is not implemented yet. | ||
* Every read or write command opens and closes a new gpib session, since the linux-gpib session pointer is only valid for single command. | * Every read or write command opens and closes a new gpib session, since the linux-gpib session pointer is only valid for single command. | ||
== SPI == | |||
=== Configuring interface === | |||
SPI currently only works in linux. | |||
instrhwinfo will display the avilable devices in the system | |||
{{Code|GPIB example|<syntaxhighlight lang="octave" style="font-size:13px"> | |||
instrhwinfo("spi") | |||
}} | |||
You will need read/write permissions to the device used. | |||
=== Example: basic use === | |||
Example opening an performing IO on a device /dev/spidev0.0. | |||
{{Code|GPIB example|<syntaxhighlight lang="octave" style="font-size:13px"> | |||
# open device | |||
spidev = spi("/dev/spidev0.0", 'clockpolarity', 'idlehigh', 'clockphase', 'firstedge') | |||
# I/O to device | |||
data = writeAndRead (spidev, uint8([0x01 0x00])) | |||
# close the device | |||
clear spidev | |||
}} | |||
[[Category:Octave Forge]] | [[Category:Octave Forge]] |