]> sigrok.org Git - libsigrok.git/commit - src/hardware/demo/api.c
Make the demo driver work.
authorUwe Hermann <redacted>
Sat, 8 Jan 2011 17:29:10 +0000 (18:29 +0100)
committerUwe Hermann <redacted>
Sat, 8 Jan 2011 17:29:10 +0000 (18:29 +0100)
commit85b5af068776cca18c704a101d6d56be1ec236b6
tree51bd5bd0f52ac2d6765ca64abc57f74f678e225a
parentd4ae8eaa7c09e31ef246b7d56008a0aa21db9f0d
Make the demo driver work.

When initialized, the driver starts a thread that generates signal data.
This data is written to a pipe (write file descriptor).
The other end of the pipe (read file descriptor), is connected to the
main polling code, like any other driver.

Note: This patch adds a new dependency on libgthread.

At the moment, you can list the driver's device:

$ ./cli/sigrok-cli -D
The following devices were found:
ID  Device
0   Sigrok project Demo Driver v1.0 with 8 probes

And use it for random signal generation:

$ /opt/sigrok/bin/sigrok-cli -d 0 --samples 50 -f bits -p 1-8
sigrok 0.1pre2
Acquisition with 8/8 probes at 0 Hz
1:10111100 11010110 00001011 00011110 00111010 11110100 10
2:11010110 00111111 01001010 11111101 11010011 00010010 11
3:11000101 01000001 10100011 10100100 10110000 11110011 00
4:00100111 11110100 10011101 01100111 00100101 01001110 10
5:00011100 00101100 10111000 11001101 01011101 01011011 01
6:10110101 10111110 10010110 10111000 11011010 10000100 11
7:11111111 01001111 11110110 11010010 10000101 01001111 00
8:01000101 01111110 01010111 00000111 00010010 00000101 11

The next step is to make demo driver customisable (per-probe signal clock,
reference sample signals : serial, I2C, CAN...).

Thanks Olivier Fauchon <redacted> for the patch.
hardware/demo/demo.c