📄 drivers.lyx
字号:
\layout Section\begin_inset LatexCommand \label{sec:probe_parport}\end_inset probe_parport\layout StandardIn modern PCs, the parallel port may require plug and play (PNP) configuration before it can be used. The \family typewriter probe_parport\family default module performs configuration of any PNP ports present, and should be loaded before \family typewriter hal_parport\family default . On machines without PNP ports, it may be loaded but has no effect.\layout SubsectionInstalling\layout LyX-Codeloadrt probe_parport\newline loadrt hal_parport ...\layout StandardIf the Linux kernel prints a message similar to\layout LyX-Codeparport: PnPBIOS parport detected.\layout Standardwhen the parport_pc module is loaded (\family typewriter sudo modprobe -a parport_pc; sudo rmmod parport_pc) \family default then use of this module is probably required.\layout Section\begin_inset LatexCommand \label{sec:AX5214}\end_inset AX5214H\layout StandardThe Axiom Measurement & Control AX5214H is a 48 channel digital I/O board. It plugs into an ISA bus, and resembles a pair of 8255 chips.\begin_inset Footcollapsed true\layout StandardIn fact it may be a pair of 8255 chips, but I'm not sure. If/when someone starts a driver for an 8255 they should look at the ax5214 code, much of the work is already done.\end_inset \layout SubsectionInstalling\layout LyX-Codeloadrt hal_ax5214h cfg="<config-string>"\layout StandardThe config string consists of a hex port address, followed by an 8 character string of \begin_inset Quotes eld\end_inset I\begin_inset Quotes erd\end_inset and \begin_inset Quotes eld\end_inset O\begin_inset Quotes erd\end_inset which sets groups of pins as inputs and outputs. The first two character set the direction of the first two 8 bit blocks of pins (0-7 and 8-15). The next two set blocks of 4 pins (16-19 and 20-23). The pattern then repeats, two more blocks of 8 bits (24-31 and 32-39) and two blocks of 4 bits (40-43 and 44-47). If more than one board is installed, the data for the second board follows the first. As an example, the string \family typewriter \series bold "0x220 IIIOIIOO 0x300 OIOOIOIO"\family default \series default installs drivers for two boards. The first board is at address 0x220, and has 36 inputs (0-19 and 24-39) and 12 outputs (20-23 and 40-47). The second board is at address 0x300, and has 20 inputs (8-15, 24-31, and 40-43) and 28 outputs (0-7. 16-23, 32-39, and 44-47). Up to 8 boards may be used in one system.\layout SubsectionPins\layout Itemize\family typewriter \noun on (bit\noun default ) ax5214.<boardnum>.out-<pinnum> \family default -- Drives a physical output pin.\layout Itemize\family typewriter (\noun on bit\noun default ) ax5214.<boardnum>.in-<pinnum>\family default -- Tracks a physical input pin.\layout Itemize\family typewriter (\noun on bit\noun default ) ax5214.<boardnum>.in-<pinnum>-not\family default -- Tracks a physical input pin, inverted.\layout StandardFor each pin, \family typewriter <boardnum>\family default is the board number (starts at zero), and \family typewriter <pinnum>\family default is the I/O channel number (0 to 47).\layout StandardNote that the driver assumes active LOW signals. This is so that modules such as OPTO-22 will work correctly (TRUE means output ON, or input energized). If the signals are being used directly without buffering or isolation the inversion needs to be accounted for. The \family typewriter in-\family default HAL pin is TRUE if the physical pin is low (OPTO-22 module energized), and FALSE if the physical pin is high (OPTO-22 module off). The \family typewriter in-<pinnum>-not\family default HAL pin is inverted -- it is FALSE if the physical pin is low (OPTO-22 module energized). By connecting a signal to one or the other, the user can determine the state of the input.\layout SubsectionParameters\layout Itemize\family typewriter (\noun on bit\noun default ) ax5214.<boardnum>.out-<pinnum>-invert\family default -- Inverts an output pin.\layout StandardThe \family typewriter -invert\family default parameter determines whether an output pin is active high or active low. If \family typewriter -invert\family default is FALSE, setting the HAL \family typewriter out-\family default pin TRUE drives the physical pin low, turning ON an attached OPTO-22 module, and FALSE drives it high, turning OFF the OPTO-22 module. If \family typewriter -invert\family default is TRUE, then setting the HAL \family typewriter out-\family default pin TRUE will drive the physical pin high and turn the module OFF.\layout SubsectionFunctions\layout Itemize\family typewriter \noun on (funct) \noun default ax5214.<boardnum>.read\family default -- Reads all digital inputs on one board.\layout Itemize\family typewriter \noun on (funct) \noun default ax5214.<boardnum>.write \family default -- Writes all digital outputs on one board.\layout Section\begin_inset LatexCommand \label{sec:Servo-To-Go}\end_inset Servo-To-Go\layout StandardThe Servo-To-Go is one of the first PC motion control cards\begin_inset Footcollapsed true\layout Standarda motion control card usually is a board containing devices to control one or more axes (the control devices are usually DAC's to set an analog voltage, encoder counting chips for feedback, etc.)\end_inset supported by EMC. It is an ISA card and it exists in different flavours (all supported by this driver). The board includes up to 8 channels of quadrature encoder input, 8 channels of analog input and output, 32 bits digital I/O, an interval timer with interrupt and a watchdog.\layout SubsectionInstalling:\layout LyX-Codeloadrt hal_stg [base=<address>] [num_chan=<nr>] [dio="<dio-string>"] [model=<model>]\layout StandardThe base address field is optional; if it's not provided the driver attempts to autodetect the board. The num_chan field is used to specify the number of channels available on the card, if not used the 8 axis version is assumed. The digital inputs/outputs configuration is determined by a config string passed to insmod when loading the module. The format consists of a four character string that sets the direction of each group of pins. Each character of the direction string is either "I" or "O". The first character sets the direction of port A (Port A - DIO.0-7), the next sets port B (Port B - DIO.8-15), the next sets port C (Port C - DIO.16-23), and the fourth sets port D (Port D - DIO.24-31). The model field can be used in case the driver doesn't autodetect the right card version\begin_inset Footcollapsed true\layout Standardhint: after starting up the driver, 'dmesg' can be consulted for messages relevant to the driver (e.g. autodetected version number and base address)\end_inset . For example:\layout LyX-Codeloadrt hal_stg base=0x300 num_chan=4 dio="IOIO"\layout StandardThis example installs the stg driver for a card found at the base address of 0x300, 4 channels of encoder feedback, DAC's and ADC's, along with 32 bits of I/O configured like this: the first 8 (Port A) configured as Input, the next 8 (Port B) configured as Output, the next 8 (Port C) configured as Input, and the last 8 (Port D) configured as Output\layout LyX-Codeloadrt hal_stg\layout StandardThis example installs the driver and attempts to autodetect the board address and board model, it installs 8 axes by default along with a standard I/O setup: Port A & B configured as Input, Port C & D configured as Output.\layout SubsectionPins\layout Itemize\family typewriter \noun on (s32\noun default ) stg.<channel>.counts \family default -- Tracks the counted encoder ticks.\layout Itemize\family typewriter (\noun on float\noun default ) stg.<channel>.position\family default -- Outputs a converted position.\layout Itemize\family typewriter (\noun on float\noun default ) stg.<channel>.dac-value \family default -- Drives the voltage for the corresponding DAC.\layout Itemize\family typewriter (\noun on float\noun default ) stg.<channel>.adc-value\family default -- Tracks the measured voltage from the corresponding ADC.\layout Itemize\family typewriter \noun on (bit) \noun default stg.in-<pinnum>\family default -- Tracks a physical input pin.\layout Itemize\family typewriter \noun on (bit) \noun default stg.in-<pinnum>-not\family default -- Tracks a physical input pin, but inverted.\layout Itemize\family typewriter \noun on (bit) \noun default stg.out-<pinnum>\family default -- Drives a physical output pin\layout StandardFor each pin, \family typewriter <channel>\family default is the axis number, and \family typewriter <pinnum>\family default is the logic pin number of the STG\begin_inset Footcollapsed true\layout Standardif IIOO is defined, there are 16 input pins (in-00 .. in-15) and 16 output pins (out-00 .. out-15), and they correspond to PORTs ABCD (in-00 is PORTA.0, out-15 is PORTD.7)\end_inset .\layout StandardThe \family typewriter in-\family default HAL pin is TRUE if the physical pin is high, and FALSE if the physical pin is low. The \family typewriter in-<pinnum>-not\family default HAL pin is inverted -- it is FALSE if the physical pin is high. By connecting a signal to one or the other, the user can determine the state of the input.\layout SubsectionParameters\layout Itemize\family typewriter \noun on (float) \noun default stg.<channel>.position-scale\family default -- The number of counts / user unit (to convert from counts to units).\layout Itemize\family typewriter (\noun on float\noun default ) stg.<channel>.dac-offset \family default -- Sets the offset for the corresponding DAC.\layout Itemize\family typewriter (\noun on float\noun default ) stg.<channel>.dac-gain\family default -- Sets the gain of the corresponding DAC.\layout Itemize\family typewriter (\noun on float\noun default ) stg.<channel>.adc-offset\family default -- Sets the offset of the corresponding ADC.\layout Itemize\family typewriter (\noun on float\noun default ) stg.<channel>.adc-gain\family default -- Sets the gain of the corresponding ADC.\layout Itemize\family typewriter (\noun on bit\noun default ) stg.out-<pinnum>-invert\family default -- Inverts an output pin.\layout StandardThe \family typewriter -invert\family default parameter determines whether an output pin is active high or active low. If \family typewriter -invert\family default is FALSE, setting the HAL \family typewriter out-\family default pin TRUE drives the physical pin high, and FALSE drives it low. If \family typewriter -invert\family default is TRUE, then setting the HAL \family typewriter out-\family default pin TRUE will drive the physical pin low.\layout SubsectionFunctions\layout Itemize\family typewriter \noun on (funct) \noun default stg.capture-position\family default -- Reads the encoder counters from the axis \family typewriter <channel>\family default .\layout Itemize\family typewriter \noun on (funct) \noun default stg.write-dacs \family default -- Writes the voltages to the DACs.\layout Itemize\family typewriter \noun on (funct) \noun default stg.read-adcs\family default -- Reads the voltages from the ADCs.\layout Itemize\family typewriter \noun on (funct) \noun default stg.di-read\family default -- Reads physical \family typewriter in-\family default pins of all ports and updates all HAL \family typewriter in-\family default and \family typewriter in-<pinnum>-not\family default pins.\layout Itemize\family typewriter \noun on (funct) \noun default stg.do-write\family default -- Reads all HAL \family typewriter out-\family default pins and updates all physical output pins.\layout SectionMesa Electronics m5i20 \begin_inset Quotes eld\end_inset Anything I/O Card\begin_inset Quotes erd\end_inset \layout StandardThe Mesa Electronics m5i20 card consists of an FPGA that can be loaded with a wide variety of configurations, and has 72 pins that leave the PC. The assignment of the pins depends on the FPGA configuration. Currently there is a HAL driver for the \begin_inset Quotes eld\end_inset 4 axis host based motion control\begin_inset Quotes erd\end_inset configuration, and this FPGA configurations is also provided with EMC2. It provides 8 encoder counters, 4 PWM outputs (normally used as DACs) and up to 48 digital I/O channels, 32 inputs and 16 outputs.\begin_inset Footcollapsed true\layout StandardIdeally the encoders, \begin_inset Quotes eld\end_inset DACs\begin_inset Quotes erd\end_inset , and digital I/O would comply with the canonical interfaces defined earlier, but they don't. Fixing that is on the things-to-do list.\end_inset \layout StandardInstalling:\layout LyX-Codeloadrt hal_m5i20 [loadFpga=1|0] [dacRate=<rate>]\layout StandardIf \family typewriter \series bold
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -