Commit Graph

671 Commits

Author SHA1 Message Date
Bert Vermeulen 5df7b20156 serial: avoid Cyrillic conversion specifiers 2012-11-11 03:27:51 +01:00
Bert Vermeulen fe1c50fba6 ols: fix device discovery 2012-11-11 03:12:10 +01:00
Alexandru Gagniuc a99e0d2a0c ols: Do not randomly probe serial ports
ols driver used to probe a series of available serial ports obtained
by regexp matching of common serial port names.
There are a number of problems with this approach:
1. It will probe all serial devices, including devices that do not
like to be probed, potentially causing them to act up.
2. It will try to probe serial ports which may already be opened in
other applications for other purposes.
3. It assumes the naming of the serial ports is set in stone, and
creates an unnecessary OS-specific list.
4. It produces unnecessary debug output even when an OLS device is
not connected.
5. etc...

Do not implicitly probe serial ports. Only probe the port specified
by the frontend, if any; otherwise, just quit.
Also get rid of all functionality in serial.c which was designed
specifically for random probing.

Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
2012-11-11 03:12:10 +01:00
Uwe Hermann 56eb9f95ba link-mso19: Use message logging helpers. 2012-11-10 19:42:37 +01:00
Uwe Hermann 92bcedf6e8 demo: Use message logging helpers. 2012-11-10 19:42:37 +01:00
Uwe Hermann e98b7f1be0 hantek-dso: Use message logging helpers. 2012-11-10 19:42:37 +01:00
Uwe Hermann 47f4f073e0 asix-sigma: Use message logging helpers. 2012-11-10 19:42:37 +01:00
Uwe Hermann 936e27f197 radioshack-dmm: Use new file naming conventions. 2012-11-10 19:42:37 +01:00
Uwe Hermann 4e172b8f8d radioshack-dmm: Move some stuff out of .h file.
Most of the enums and #defines are not needed in multiple files, just
put them in the respective .c file where they're used.
2012-11-10 19:42:37 +01:00
Uwe Hermann ba6383f855 radioshack-dmm: Cosmetics, coding-style, cleanups.
Also, drop some uneeded code and simplify some parts.
2012-11-10 19:41:21 +01:00
Uwe Hermann 302c4b5ab5 serial: Deduplicate log messages a bit. 2012-11-10 01:45:51 +01:00
Uwe Hermann c073af80f8 Add initial Tondaj SL-814 protocol handling. 2012-11-10 01:45:51 +01:00
Uwe Hermann aa2af32432 tondaj-sl-814: Initial driver skeleton. 2012-11-10 01:01:28 +01:00
Bert Vermeulen 63f7cb9791 agilent-dmm: use standard serial_readline() 2012-11-07 01:25:10 +01:00
Bert Vermeulen 318dd53c70 serial_readline() now terminates on and strips CR and/or LF 2012-11-07 01:24:23 +01:00
Bert Vermeulen b87f8504dc g_get_monotonic_time() takes a signed int64 2012-11-07 01:23:24 +01:00
Bert Vermeulen 74ac7d7f73 agilent-dmm: no need to specify a serialcomm scan parameter
It's always 9600/8n1 anyway.
2012-11-07 00:46:30 +01:00
Bert Vermeulen 33e8a3c525 chronovu-la8: not a bug if an unused driver gets asked to clean up 2012-11-07 00:39:46 +01:00
Bert Vermeulen ff94568366 victor-dmm: add protocol decoder 2012-11-06 19:37:33 +01:00
Bert Vermeulen 642e9d623c more deconstifying sr_dev_inst for dev_acquisition_stop() 2012-11-06 19:32:53 +01:00
Bert Vermeulen 7a36037546 victor-dmm: add basic USB driver skeleton 2012-11-06 15:16:22 +01:00
Bert Vermeulen 69b07d14db allow for intermediate stage in stopping acquisition
In the case of USB drivers, a driver's dev_acquisition_stop() cannot
simply remove its fd sources from the session and close its devices:
a USB transfer might still be underway, and it needs to be finished
(and its memory freed) properly.

An sr_dev_inst->status value is added: SR_ST_STOPPING, which should
be set when the driver's dev_acquisition_stop() is called, and acts
as a marker for the USB event handler to wind up its operations.

In order for dev_acquisition_stop() to be able to set the sdi status,
however, it needs to be unconstified.
2012-11-06 15:16:22 +01:00
Bert Vermeulen ac3898d2d0 victor-dmm: Initial driver skeleton. 2012-11-06 15:16:22 +01:00
Toshiaki Yoshida 0ab0cb942f zeroplus-logic-cube: Fix samplerate and trigger
- Default to 1MHz.
   The default sample rate is the lowest frequency (100Hz),
   but it takes a very long time until 128K memory is full.

 - Fix the 1MHz setting.

 - Use samplerate list.

 - Fix 10MHz frequency.

 - Fix trigger.

 - Change the size of memory according to the number of samples.

 - Add pre-trigger (capture ratio) setting.

 - Fix the first acquisition after power on.
2012-11-05 11:46:58 +01:00
Uwe Hermann 41d9427f27 uni-t-dmm: Use new USB helper functions. 2012-11-03 00:03:01 +01:00
Uwe Hermann 0c632d36be genericdmm: Factor out USB functions.
Move sr_usb_connect() and sr_usb_open() to hardware/common/usb.c in a
slightly more generic form and add more error checks and logging.

Let genericdmm use the new/moved functions.
2012-11-03 00:02:56 +01:00
Bert Vermeulen 538ac9a91e colead-slm: fix sloppy driver context handling 2012-11-02 20:44:34 +01:00
Uwe Hermann 83e3c368c6 serial: Output successful open and the FD. 2012-11-02 18:49:00 +01:00
Uwe Hermann 20af610683 serial: Fix two segfaults. 2012-11-02 18:45:37 +01:00
Uwe Hermann c485db908a serial: Fix some sr_err() items. 2012-11-02 18:35:30 +01:00
Uwe Hermann 43d8eaf601 genericdmm: Drop left-over entry. 2012-11-02 18:16:58 +01:00
Uwe Hermann 441b80035e genericdmm: Drop some dead code. 2012-11-02 18:05:18 +01:00
Uwe Hermann b19f4622b6 serial: More error-checking & logging, add baudrates.
This mostly affects the non-Windows code so far, the rest will follow.
2012-11-02 18:02:20 +01:00
Uwe Hermann d7c776b9ff serial: Add missing "break"s.
This would otherwise cause bugs when e.g. asking for 2 stopbits.
2012-11-02 15:57:21 +01:00
Bert Vermeulen a8d09e1326 colead-slm: SL-5868P support 2012-11-02 15:24:30 +01:00
Bert Vermeulen 4d729ddcaf colead-slm: Initial driver skeleton. 2012-11-02 15:24:30 +01:00
Uwe Hermann 8c1adf3738 Rework FS9721 parser.
Merge parts of the tekpower-dmm code (the chip of the TekPower
TP4000ZC seems to be an FS9721_LP3 too) and rework parts of the functions.

Adapt the tekpower-dmm and uni-t-dmm code accordingly.
2012-11-02 01:09:58 +01:00
Alexandru Gagniuc be5c1d3b52 tekpower-dmm: Use generic fs9721 parser
Replace the parser with the fs9721 parser, which is just an adapted
version of this parser.

Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
2012-11-02 00:50:56 +01:00
Uwe Hermann 886a52b6fb Return SR_ERR_MALLOC upon allocation errors.
Add some TODOs.
2012-10-30 20:25:54 +01:00
Uwe Hermann 6f22a8ef2c Factor out serial_readline() to serial.c.
Only one (slightly different) variant remains in agilent-dmm, this will
be merged soon too, though.
2012-10-30 19:59:21 +01:00
Uwe Hermann 2980cc2494 genericdmm/victor-dmm: Use message logging helpers. 2012-10-30 19:43:46 +01:00
Uwe Hermann dccbd0ede0 radioshack-dmm: Use message logging helpers. 2012-10-30 19:43:45 +01:00
Uwe Hermann 38d326e879 agilent-dmm: Use message logging helpers. 2012-10-30 19:35:35 +01:00
Uwe Hermann 31d84da3a2 fluke-dmm: Use message logging helpers. 2012-10-30 19:28:37 +01:00
Uwe Hermann 6ac5f8922e uni-t-dmm: Simplify subdriver setup.
So far, it seems we can make this work with just hw_init() needing to
be subdriver-specific (it will point 'di' to the respective per-subdriver
entry), the rest of the API functions can then use a strcmp() on di->name to
learn which subdriver they belong to.
2012-10-30 14:23:05 +01:00
Uwe Hermann fdbcb86dba Draft: Make UT61D and VC-820 "first-class" drivers.
The 'uni-t-dmm' driver/directory will not appear as a "driver" to
frontends anymore, it's just an internal thing.

The frontends will see a uni-t-ut61d and voltcraft-vc820 driver now,
with the correct names and parsers etc. attached to them.

This is not fully finished yet, but it's a start (and works mostly):

  $ sigrok-cli -D
  The following devices were found:
  UNI-T UT61D with 1 probe: P1
  Voltcraft VC-820 with 1 probe: P1

  $ sigrok-cli --driver voltcraft-vc820 -D
  The following devices were found:
  Voltcraft VC-820 with 1 probe: P1

  $ sigrok-cli --driver uni-t-ut61d -D
  The following devices were found:
  UNI-T UT61D with 1 probe: P1

  # Now attaching a UNI-T UT61D device via USB.

  $ sigrok-cli --driver uni-t-ut61d --samples 3 -O analog
  P1: -0.017800 V DC
  P1: -0.017600 V DC
  P1: -0.017700 V DC

  # Now attaching a Voltcraft VC-820 device via USB instead.

  $ sigrok-cli --driver voltcraft-vc820 --samples 3 -O analog
  P1: -0.319200 V DC
  P1: -0.319300 V DC
  P1: -0.319300 V DC
2012-10-30 13:11:27 +01:00
Bert Vermeulen 4ca378df88 don't use deprecated g_thread_init/_create 2012-10-29 22:10:05 +01:00
Uwe Hermann 015f1508ad uni-t-dmm: Voltcraft VC-820 draft support.
This is commented out so far, will be implemented properly soon.
2012-10-29 15:20:17 +01:00
Uwe Hermann 6c701476ad Add protocol parser for FS9721_LP3/FS9721B.
The Fortune Semiconductor FS9721_LP3 and FS9721B/Q100 DMM chips are very
similar and the protocol looks identical.

Tested on a Voltcraft VC-820 (FS9721_LP3) with the uni-t-dmm driver
(needs some small changes, tbd).
2012-10-29 15:17:17 +01:00
Bert Vermeulen a28dac0a73 fluke-dmm: code cleanup 2012-10-29 11:54:20 +01:00
Bert Vermeulen 2c04dede20 Fluke 287/289: support for dBu/dBV measurement units 2012-10-29 11:50:34 +01:00
Uwe Hermann 79081ec80c Initial support for UNI-T DMMs.
This is not yet fully finished, but works for most use-cases.

Tested with a UNI-T UT61D using the UT-D04 USB/HID cable (new version).
2012-10-27 23:17:30 +02:00
Uwe Hermann 45e080b60b la8: Rename driver.[ch] to protocol.[ch]. 2012-10-27 22:36:34 +02:00
Uwe Hermann f3a35908ef la8: Adapt to new driver conventions. 2012-10-27 22:36:19 +02:00
Uwe Hermann bbabddbd64 tekpower-dmm: Cosmetics, coding-style, consistency fixes. 2012-10-27 22:25:04 +02:00
Alexandru Gagniuc 7dc55d930f Add support for the TekPower TP4000ZC DMM.
Also known as Digitek DT4000ZC.

Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
2012-10-27 22:25:04 +02:00
Uwe Hermann 545f978639 config.h usage cleanups.
- Drop config.h #include from files that don't actually use any of
   its contents (at the moment).

 - Add comment for those that do need it.
2012-10-24 00:41:21 +02:00
Bert Vermeulen 589a10135a clean up autoconf/autobuild scripts 2012-10-22 01:48:39 +02:00
Alexandru Gagniuc 7c41dc4774 radioshack-dmm: Implement support for "LOGIC" mode
LOGIC mode sends the following data:
     V < 0 : actual voltage
0 <= V < 1 : LOW
1 <= V < 2 : actual voltage
2 <= V     : HIGH

We follow the same idea, and set our unit to BOOLEAN for the crazy
case (HIGH or LOW).

Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
2012-10-20 23:03:51 +02:00
Alexandru Gagniuc 0f70830194 libsigrok: (Trivial) Add support for 2400 baud
Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
2012-10-20 23:02:14 +02:00
Bert Vermeulen fe31f8b9f9 fluke-dmm: add support for Fluke 187 2012-10-16 23:33:54 +02:00
Alexandru Gagniuc be8dbf3ab2 radioshack-dmm: (Trivial) Convenience fixes
While testing the new radioshack-dmm driver with pulseview, I found
a few inconvenients.

1. Print an info message when a port is probed, and when a device is
found. This makes it easy to tell if and where the driver is looking.

2. num_samples was not reset after the first aquisition, so the
second aquisition would quit right away. Reset num_samples at start
of a new aquisition.

3. There's no need to  open the serial port RW, so change O_RDWR to
O_RDONLY when opening the port.

These changes are too trivial to split into different patches.

Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
2012-10-16 11:16:41 +02:00
Bert Vermeulen 7b0a85c81c radioshack-dmm: build fixes 2012-10-15 18:25:48 +02:00
Alexandru Gagniuc d375b3c3ec radioshack-dmm: Add support for Radioshack 22-812 DMM
Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
2012-10-15 17:32:58 +02:00
Alexandru Gagniuc e8e9dcdd70 serial: (Trivial) add support for 4800 baud
Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
2012-10-15 17:32:58 +02:00
Uwe Hermann a2e222d24f sr: struct drv_context is global now. 2012-09-27 23:29:33 +02:00
Bert Vermeulen d38d2ef0ce fluke-dmm: support for all basic 287 functionality 2012-09-25 19:53:05 +02:00
Bert Vermeulen f46a36ad80 fluke-dmm: definitely use CR as line terminator 2012-09-25 19:53:05 +02:00
Bert Vermeulen acd29accb3 fluke-dmm: add Fluke 287 to supported list 2012-09-25 19:53:05 +02:00
Bert Vermeulen fb9d3bf9cc sr: always turn off ICRNL on serial ports
It does rather screw with protocols that use CR.
2012-09-25 19:53:05 +02:00
Bert Vermeulen d3f8f1415c fluke-dmm: flesh out the driver API 2012-09-25 19:53:05 +02:00
Bert Vermeulen 4129832014 fluke-dmm: auto-discover serial bitrate if not provided 2012-09-25 19:53:05 +02:00
Bert Vermeulen bc41e012e6 fluke-dmm: don't log anything if no conn params given 2012-09-25 19:53:05 +02:00
Bert Vermeulen fb480d578e fluke-dmm: fix discovery 2012-09-25 19:53:05 +02:00
Bert Vermeulen 5c51e09868 sr: turn off canonical mode and echo ion serial ports by default 2012-09-25 19:53:05 +02:00
Bert Vermeulen e7edd64f45 fluke-dmm: build fixes 2012-09-25 19:53:05 +02:00
Bert Vermeulen 4f958423d1 fluke-dmm: basic scan functionality 2012-09-25 19:53:05 +02:00
Bert Vermeulen 883a2e9e71 fluke-dmm: initial driver skeleton 2012-09-25 19:53:05 +02:00
Bert Vermeulen c2016fa0eb agilent-dmm: don't log anything if no conn params given 2012-09-17 00:00:27 +02:00
Bert Vermeulen e9022f596d sr: make struct drv_context global 2012-09-11 21:27:26 +02:00
Bert Vermeulen f5cfe894ec fx2lafw: use default libusb context 2012-09-11 21:20:50 +02:00
Bert Vermeulen 19b0cce312 hantek-dso: use default libusb context 2012-09-11 21:16:16 +02:00
Bert Vermeulen b186aa78b8 agilent-dmm: fix model identifiers 2012-09-10 21:27:50 +02:00
Bert Vermeulen 8c0152f29b agilent-dmm: tentative support for all U123x and U125x models
Only tested on U1233A, but it just might work.

The U125x protocol decoding only supports voltage, current, resistance,
capacitance and diode measurements for now.
2012-09-10 01:00:48 +02:00
Bert Vermeulen a4394fb3d9 agilent-dmm: code cleanup
This should make it easier to support other Agilent U12xx models
2012-09-10 00:13:26 +02:00
Bert Vermeulen e066c32a25 agilent-dmm: fix AC/DC mode detection 2012-09-09 22:49:07 +02:00
Bert Vermeulen f2e86bbfa6 agilent-dmm: make parser deal with input better 2012-09-09 22:48:22 +02:00
Bert Vermeulen 81599cc55b agilent-dmm: remove IDN check at 1Hz, we just don't need it.
Some debug message cleanup.
2012-09-08 14:53:49 +02:00
Bert Vermeulen e6b021f377 agilent-dmm: support for submodes 2012-09-08 03:06:45 +02:00
Bert Vermeulen 69a7402490 genericdmm/victor-70c: fix resistance and frequency measurements 2012-09-08 02:28:41 +02:00
Bert Vermeulen c0d93341cb generic-dmm: cosmetics 2012-09-02 15:42:56 +02:00
Bert Vermeulen f6b8ffa6c0 genericdmm/victor-70c: warn if detaching kernel driver fails 2012-09-02 15:42:56 +02:00
Bert Vermeulen e93cdf428c sr: mostly finished Agilent DMM driver 2012-09-02 15:42:56 +02:00
Bert Vermeulen 792fc68658 serial: add serial_set_paramstr() 2012-09-02 15:42:56 +02:00
Bert Vermeulen f38b9763fa serial: fix flow control setting 2012-09-02 15:42:56 +02:00
Bert Vermeulen 6a6e23abf5 serial: set speed in both directions 2012-09-02 15:42:56 +02:00
Bert Vermeulen 6ac0db19f3 sr: add new agilent-dmm driver (Agilent U12xxA multimeters) 2012-09-02 15:42:56 +02:00
Bert Vermeulen b84c13d700 genericdmm: Victor 70C multimeter support 2012-08-18 16:23:08 +02:00
Bert Vermeulen 3c6ce226de genericdmm: finish basic USB support 2012-08-18 16:23:08 +02:00
Bert Vermeulen 811deee4af sr/drivers: add API calls sr_dev_inst_list() and sr_dev_inst_clear()
These are used to list the device instances currently known to the driver,
and clear that list.

Drivers that don't necessarily clear their list of instances on every scan,
such as genericdmm, need to provide these to the frontend to keep instance
management sane.
2012-08-06 00:59:25 +02:00