File: DaqSetTrigger.m

package info (click to toggle)
psychtoolbox-3 3.0.19.14.dfsg1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 86,796 kB
  • sloc: ansic: 176,245; cpp: 20,103; objc: 5,393; sh: 2,753; python: 1,397; php: 384; makefile: 193; java: 113
file content (28 lines) | stat: -rw-r--r-- 1,196 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
function err=DaqSetTrigger(daq,rising)
% err=DaqSetTrigger(DeviceIndex,rising)
% USB-1208FS: Configure the external trigger. This function configures the
% external trigger for analog input. The trigger may be configured to
% respond to either a logic rising edge ("rising"=1) or falling edge input
% ("rising"=0). Once the trigger is received, the analog input will proceed
% as configured. options.trigger must be 1 in the DaqAInScan command
% to utilize this feature. 
% "DeviceIndex" is a small integer, the array index specifying which HID
%         device in the array returned by PsychHID('Devices') is interface
%         0 of the desired USB-1208FS box.
% "rising" selects the desired edge type (0 = falling, 1 = rising) for the 
%         external trigger.
% See also Daq, DaqFunctions, DaqPins, DaqTest, PsychHIDTest.

% 4/15/05 dgp Wrote it.
% 1/11/08 mpr swept through attempting to improve consistency across daq
%               functions

if ~ismember(rising,0:1)
	error('"rising" must be 0 or 1.');
end
err=PsychHID('SetReport',daq,2,66,uint8([66 rising])); % SetTrigger
if err.n
    fprintf('SetTrigger error 0x%s. %s: %s\n',hexstr(err.n),err.name,err.description);
end

return;