Lines Matching +full:trigger +full:- +full:external

1 /* SPDX-License-Identifier: LGPL-2.0+ WITH Linux-syscall-note */
6 * COMEDI - Linux Control and Measurement Device Interface
7 * Copyright (C) 1998-2001 David A. Schleef <ds@schleef.org>
32 * NOTE: 'comedi_config --init-data' is deprecated
40 /* length of nth chunk of firmware data -*/
78 /* counters -- these are arbitrary values */
120 /* try to use a real-time interrupt while performing command */
123 /* wake up on end-of-scan events */
154 /* trigger sources */
159 #define TRIG_NONE 0x00000001 /* never trigger */
160 #define TRIG_NOW 0x00000002 /* trigger now + N ns */
161 #define TRIG_FOLLOW 0x00000004 /* trigger on next lower level trig */
162 #define TRIG_TIME 0x00000008 /* trigger at time N ns */
163 #define TRIG_TIMER 0x00000010 /* trigger at rate N ns */
164 #define TRIG_COUNT 0x00000020 /* trigger when count reaches N */
165 #define TRIG_EXT 0x00000040 /* trigger on external signal N */
166 #define TRIG_INT 0x00000080 /* trigger on comedi-internal signal N */
179 #define SDF_PWM_HBRIDGE 0x0100 /* PWM is signed (H-bridge) */
200 #define SDF_LSAMPL 0x10000000 /* subdevice uses 32-bit samples */
206 * enum comedi_subdevice_type - COMEDI subdevice types
219 * @COMEDI_SUBD_PWM: Pulse-Width Modulation output.
240 * enum comedi_io_direction - COMEDI I/O directions
243 * @COMEDI_OPENDRAIN: Open-drain (or open-collector) output.
256 * enum configuration_ids - COMEDI configuration instruction codes
259 * @INSN_CONFIG_DIO_OPENDRAIN: Configure digital I/O as open-drain (or open
261 * @INSN_CONFIG_ANALOG_TRIG: Configure analog trigger.
263 * @INSN_CONFIG_DIGITAL_TRIG: Configure digital trigger.
265 * @INSN_CONFIG_TIMER_1: Configure divisor for external clock.
273 * @INSN_CONFIG_PWM_OUTPUT: Configure pulse-width modulator output.
274 * @INSN_CONFIG_GET_PWM_OUTPUT: Get pulse-width modulator output configuration.
291 * on-board FIFOs used during streaming
306 * regardless of trigger sources.
355 * enum device_configuration_ids - COMEDI configuration instruction codes global
358 * globally-named route
359 * @INSN_DEVICE_CONFIG_CONNECT_ROUTE: Connect a globally-named route
360 * @INSN_DEVICE_CONFIG_DISCONNECT_ROUTE:Disconnect a globally-named route
361 * @INSN_DEVICE_CONFIG_GET_ROUTES: Get a list of all globally-named routes
372 * enum comedi_digital_trig_op - operations for configuring a digital trigger
373 * @COMEDI_DIGITAL_TRIG_DISABLE: Return digital trigger to its default,
376 * that each can fire the trigger.
378 * level inputs that can fire the trigger.
385 * data[%1] = trigger ID
395 * The trigger ID (data[%1]) is used to differentiate multiple digital triggers
402 * configuration parameter 1 (data[%3]) contains a "left-shift" value that
404 * and 3. This is useful if the trigger has more than 32 inputs.
407 * specifies which of up to 32 inputs have rising-edge sensitivity, and
409 * have falling-edge sensitivity that can fire the trigger.
414 * must be at a low level for the trigger to fire.
417 * accumulative effect, depending on the low-level driver. This is useful
418 * when setting up a trigger that has more than 32 inputs, or has a combination
419 * of edge- and level-triggered inputs.
428 * enum comedi_support_level - support level for a COMEDI feature
440 * enum comedi_counter_status_flags - counter status bits
479 * struct comedi_insn - COMEDI instruction
501 * struct comedi_insnlist - list of COMEDI instructions
513 * struct comedi_cmd - COMEDI asynchronous acquisition command details
516 * @start_src: "Start acquisition" trigger source (%TRIG_xxx).
517 * @start_arg: "Start acquisition" trigger argument.
518 * @scan_begin_src: "Scan begin" trigger source.
519 * @scan_begin_arg: "Scan begin" trigger argument.
520 * @convert_src: "Convert" trigger source.
521 * @convert_arg: "Convert" trigger argument.
522 * @scan_end_src: "Scan end" trigger source.
523 * @scan_end_arg: "Scan end" trigger argument.
524 * @stop_src: "Stop acquisition" trigger source.
525 * @stop_arg: "Stop acquisition" trigger argument.
530 * @data: Pointer to miscellaneous set-up data (not used).
531 * @data_len: Length of miscellaneous set-up data.
533 * This is used with the %COMEDI_CMD or %COMEDI_CMDTEST ioctl to set-up
539 * %CMDF_BOGUS - makes %COMEDI_CMD ioctl return error %EAGAIN instead of
542 * %CMDF_PRIORITY - requests "hard real-time" processing (which is not
545 * %CMDF_WAKE_EOS - requests the command makes data available for reading
548 * %CMDF_WRITE - marks the command as being in the "write" (to device)
552 * %CMDF_RAWDATA - prevents the command from "munging" the data between the
555 * %CMDF_ROUND_NEAREST - requests timing periods to be rounded to nearest
558 * %CMDF_ROUND_DOWN - requests timing periods to be rounded down to supported
561 * %CMDF_ROUND_UP - requests timing periods to be rounded up to supported
564 * Trigger source values for @start_src, @scan_begin_src, @convert_src,
567 * %TRIG_ANY - "all ones" value used to test which trigger sources are
570 * %TRIG_INVALID - "all zeroes" value used to indicate that all requested
571 * trigger sources are invalid.
573 * %TRIG_NONE - never trigger (often used as a @stop_src value).
575 * %TRIG_NOW - trigger after '_arg' nanoseconds.
577 * %TRIG_FOLLOW - trigger follows another event.
579 * %TRIG_TIMER - trigger every '_arg' nanoseconds.
581 * %TRIG_COUNT - trigger when count '_arg' is reached.
583 * %TRIG_EXT - trigger on external signal specified by '_arg'.
585 * %TRIG_INT - trigger on internal, software trigger specified by '_arg'.
587 * %TRIG_OTHER - trigger on other, driver-defined signal specified by '_arg'.
616 * struct comedi_chaninfo - used to retrieve per-channel information
618 * @maxdata_list: Optional pointer to per-channel maximum data values.
619 * @flaglist: Optional pointer to per-channel flags.
620 * @rangelist: Optional pointer to per-channel range types.
623 * This is used with the %COMEDI_CHANINFO ioctl to get per-channel information
642 * struct comedi_rangeinfo - used to retrieve the range table for a channel
664 * struct comedi_krange - describes a range in a range table
665 * @min: Minimum value in millionths (1e-6) of a unit.
666 * @max: Maximum value in millionths (1e-6) of a unit.
683 * range needs to be multiplied by an external reference.
692 * struct comedi_subdinfo - used to retrieve information about a subdevice
721 * %SDF_BUSY - the subdevice is busy processing an asynchronous command or a
724 * %SDF_BUSY_OWNER - the subdevice is busy processing an asynchronous
728 * %SDF_LOCKED - the subdevice is locked by a %COMEDI_LOCK ioctl.
730 * %SDF_LOCK_OWNER - the subdevice is locked by a %COMEDI_LOCK ioctl from the
733 * %SDF_MAXDATA - maximum sample values are channel-specific.
735 * %SDF_FLAGS - channel flags are channel-specific.
737 * %SDF_RANGETYPE - range types are channel-specific.
739 * %SDF_PWM_COUNTER - PWM can switch off automatically.
741 * %SDF_PWM_HBRIDGE - or PWM is signed (H-bridge).
743 * %SDF_CMD - the subdevice supports asynchronous commands.
745 * %SDF_SOFT_CALIBRATED - the subdevice uses software calibration.
747 * %SDF_CMD_WRITE - the subdevice supports asynchronous commands in the output
750 * %SDF_CMD_READ - the subdevice supports asynchronous commands in the input
753 * %SDF_READABLE - the subdevice is readable (e.g. analog input).
755 * %SDF_WRITABLE (aliased as %SDF_WRITEABLE) - the subdevice is writable (e.g.
758 * %SDF_INTERNAL - the subdevice has no externally visible lines.
760 * %SDF_GROUND - the subdevice can use ground as an analog reference.
762 * %SDF_COMMON - the subdevice can use a common analog reference.
764 * %SDF_DIFF - the subdevice can use differential inputs (or outputs).
766 * %SDF_OTHER - the subdevice can use some other analog reference.
768 * %SDF_DITHER - the subdevice can do dithering.
770 * %SDF_DEGLITCH - the subdevice can do deglitching.
772 * %SDF_MMAP - this is never set.
774 * %SDF_RUNNING - an asynchronous command is still running.
776 * %SDF_LSAMPL - the subdevice uses "long" (32-bit) samples (for asynchronous
779 * %SDF_PACKED - the subdevice packs several DIO samples into a single sample
799 * struct comedi_devinfo - used to retrieve information about a COMEDI device
802 * @driver_name: Null-terminated COMEDI driver name.
803 * @board_name: Null-terminated COMEDI board name.
804 * @read_subdevice: Index of the current "read" subdevice (%-1 if none).
805 * @write_subdevice: Index of the current "write" subdevice (%-1 if none).
822 * struct comedi_devconfig - used to configure a legacy COMEDI device
823 * @board_name: Null-terminated string specifying the type of board
832 * handled in a driver-specific manner.
840 * struct comedi_bufconfig - used to set or get buffer size for a subdevice
852 * On ioctl input, non-zero values of @maximum_size and @size specify a
871 * struct comedi_bufinfo - used to manipulate buffer position for a subdevice
933 * 1 <-- Status byte returned here.
936 * B5 - B0 Current mode.
941 I8254_MODE1 = (1 << 1), /* Hardware retriggerable one-shot */
947 /* Use binary-coded decimal instead of binary (pretty useless) */
952 /* *** BEGIN GLOBALLY-NAMED NI TERMINALS/SIGNALS *** */
956 * Some of these have no NI_ prefix as they are useful for non-NI hardware, such
957 * as those that utilize the PXI/RTSI trigger lines.
979 * varying purposes, but the end-user had to gain a knowledge of register
982 * programming manuals and vendor-provided documentation are _not_ even
983 * close to the same names that are in the end-user documentation.
1009 #define _TERM_N(base, n, x) ((base) + ((x) & ((n) - 1)))
1012 * not necessarily all allowed 64 PFIs are valid--certainly not for all devices
1015 /* 8 trigger lines by standard, Some devices cannot talk to all eight. */
1016 #define TRIGGER_LINE(x) _TERM_N(NI_PFI(-1) + 1, 8, x)
1018 #define NI_RTSI_BRD(x) _TERM_N(TRIGGER_LINE(-1) + 1, 4, x)
1022 #define NI_COUNTER_NAMES_BASE (NI_RTSI_BRD(-1) + 1)
1025 #define NI_GATES_NAMES_BASE (NI_CtrSource(-1) + 1)
1027 #define NI_CtrAux(x) _TERM_N(NI_CtrGate(-1) + 1, NI_MAX_COUNTERS, x)
1028 #define NI_CtrA(x) _TERM_N(NI_CtrAux(-1) + 1, NI_MAX_COUNTERS, x)
1029 #define NI_CtrB(x) _TERM_N(NI_CtrA(-1) + 1, NI_MAX_COUNTERS, x)
1030 #define NI_CtrZ(x) _TERM_N(NI_CtrB(-1) + 1, NI_MAX_COUNTERS, x)
1031 #define NI_GATES_NAMES_MAX NI_CtrZ(-1)
1032 #define NI_CtrArmStartTrigger(x) _TERM_N(NI_CtrZ(-1) + 1, NI_MAX_COUNTERS, x)
1034 _TERM_N(NI_CtrArmStartTrigger(-1) + 1, NI_MAX_COUNTERS, x)
1035 /** external pin(s) labeled conveniently as Ctr<i>Out. */
1036 #define NI_CtrOut(x) _TERM_N(NI_CtrInternalOutput(-1) + 1, NI_MAX_COUNTERS, x)
1037 /** For Buffered sampling of ctr -- x series capability. */
1038 #define NI_CtrSampleClock(x) _TERM_N(NI_CtrOut(-1) + 1, NI_MAX_COUNTERS, x)
1039 #define NI_COUNTER_NAMES_MAX NI_CtrSampleClock(-1)
1042 /* PXI_Star: this is a non-NI-specific signal */
1101 NI_NUM_NAMES = _NI_NAMES_MAX_PLUS_1 - NI_NAMES_BASE,
1104 /* *** END GLOBALLY-NAMED NI TERMINALS/SIGNALS *** */
1110 * mode bits for NI general-purpose counters, set with
1182 * INSN_CONFIG_SET_CLOCK_SRC when using NI general-purpose counters.
1192 /* NI 660x-specific */
1206 /* NI 660x-specific */
1216 * INSN_CONFIG_SET_GATE_SRC when using NI general-purpose counters.
1217 * May be bitwise-or'd with CR_EDGE or CR_INVERT.
1220 /* m-series gates */
1236 * m-series "second gate" sources are unknown,
1250 * INSN_CONFIG_SET_OTHER_SRC when using NI general-purpose counters.
1259 /* m-series gates */
1267 * start sources for ni general-purpose counters for use with
1278 * bits (3 bits for 660x or 5 bits for m-series) through to the
1279 * hardware. To select a hardware trigger, pass the appropriate select
1300 * PFI digital filtering options for ni m-series for use with
1314 * Doesn't work for m-series, use NI_MIO_PLL_RTSI_CLOCK()
1315 * the NI_MIO_PLL_* sources are m-series only
1340 /* Pre-m-series always have RTSI clock on line 7 */
1347 * Signals which can be routed to an NI PFI pin on an m-series board with
1349 * INSN_CONFIG_GET_ROUTING on pre-m-series boards, even though their routing
1396 * NI External Trigger lines. These values are not arbitrary, but are related
1400 #define NI_EXT_PFI(x) (NI_USUAL_PFI_SELECT(x) - 1)
1401 #define NI_EXT_RTSI(x) (NI_USUAL_RTSI_SELECT(x) - 1)
1404 * Clock sources for CDIO subdevice on NI m-series boards. Used as the
1405 * scan_begin_arg for a comedi_command. These sources may also be bitwise-or'd
1426 * boards. These scan begin sources can also be bitwise-or'd with CR_INVERT to
1447 * Per channel external clock
1468 AMPLC_DIO_CLK_EXT, /* per chip external input pin */
1493 AMPLC_DIO_GAT_GATN, /* per channel external gate input */
1507 /* non-negated output of counter channel minus 2 */
1519 * the counter subdevice on the Kolter Electronic PCI-Counter board
1525 KE_CLK_EXT /* external clock on pin 21 of D-Sub */