Method: KATCP::Snapshot#trigger
- Defined in:
- lib/katcp/client/roach.rb
#trigger(opts = {}) ⇒ Object
Trigger a new snapshot. opts can be used to control the trigger type using the :trigger key and the write enable using the :wren key:
:trigger => :internal means trigger right away
:trigger => :external means trigger on the block's trigger input
:wren => :internal means to capture every FPGA clock cycle
:wren => :external means to capture when the block's we input is high
The default behavior is :internal for both.
133 134 135 136 137 138 139 140 141 142 |
# File 'lib/katcp/client/roach.rb', line 133 def trigger(opts={}) # Assume internal for both trigval = 6 # Turn off bits if external trigval ^= 2 if /^ext/ =~ (opts[:trigger]||opts[:trig]) trigval ^= 4 if /^ext/ =~ opts[:wren] @katcp_client.write(@ctrl_name, trigval) @katcp_client.write(@ctrl_name, trigval|1) @katcp_client.write(@ctrl_name, trigval) end |