diff options
author | Ian Abbott <abbotti@mev.co.uk> | 2015-10-27 16:59:25 +0000 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-10-29 08:58:36 +0900 |
commit | 0cf55bbef2f9f5a51d947c430e207d2360e89e4c (patch) | |
tree | a49c28caf87e3c92ce216409c69dad0c2ad0c3fb /drivers/staging/board/board.c | |
parent | 9406a3140a76772cc6bbf8704ecebbd249e9ca9b (diff) |
staging: comedi: comedi_test: implement commands on AO subdevice
Implement COMEDI asynchronous commands on the fake analog output
subdevice. This is useful for testing asynchronous commands in the
"write" direction when no real hardware is available.
A normal kernel timer is used to drive the command. The new timer
expiry function `waveform_ao_timer()` handles whole "scans" at a time
according to the number of scan period that have elapsed since the last
scan. Data for each channel in the scan is written to the internal
loopback array `devpriv->ao_loopbacks[]` and can be read back on the
analog input channels. However, if several scan periods are outstanding
in the timer expiry function, only the latest available scan data is
written to the loopback array in order to save processing time. The
expiry function also checks for underrun conditions, and checks for
normal termination of the asynchronous command when a "stop" scan count
is reached.
After the command is tested by `waveform_ao_cmdtest()` and set up by
`waveform_ao_cmd()`, it is not started until an internal trigger
function `waveform_ao_inttrig_start()` is called as a result of the user
performing an `INSN_INTTRIG` instruction on the subdevice. The command
is stopped when the "cancel" handler `waveform_ao_cancel()` is called.
This may be due to the command terminating due to completion or an
error, or as a result of the user cancelling the command.
Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/board/board.c')
0 files changed, 0 insertions, 0 deletions