1
0
mirror of git://projects.qi-hardware.com/ben-wpan.git synced 2024-08-27 02:57:43 +03:00
Commit Graph

193 Commits

Author SHA1 Message Date
Werner Almesberger
4fa909debc libatrf: renamed driver specification argument from "arg" to "spec"
- tools/include/atrf.h (atrf_open), tools/lib/atrf.c (select_driver,
  atrf_open): renamed "arg" argument to "spec"
2011-04-20 08:15:19 -03:00
Werner Almesberger
d7d2bd4704 tools/Makefile (upload): copy tools to /usr/bin instead of $HOME 2011-04-20 01:04:53 -03:00
Werner Almesberger
6eebf37bab tools/atrf-xtal/Makefile (clean, spotless): also clean up if target is the host 2011-04-20 01:02:43 -03:00
Werner Almesberger
a15ab43b1c tools/lib/atrf.c (select_driver): "default" selects the default driver 2011-04-19 23:37:44 -03:00
Werner Almesberger
c4167d8df4 atrf-xmit.c (usage): the "packets" argument is optional 2011-04-19 15:10:17 -03:00
Werner Almesberger
16b095ca08 atrf-txrx.c (receive_message, receive_pcap): also ignore IRQ_AMI
The "raw" patterns can accidently trigger an address match, particularly
in BER test mode.
2011-04-19 06:59:19 -03:00
Werner Almesberger
9ab94a53e2 tools: new utility atrf-xmit for fast transmission tests
- Makefile (DIRS): added atrf-xmit
- atrf-xmit/Makefile, atrf-xmit/atrf-xmit.c: new utility atrf-xmit to
  rapidly send packets from one device to another and analyze the outcome
2011-04-19 06:35:31 -03:00
Werner Almesberger
5e196552c5 atrf-txrx.c (main): option parsing in PER test mode segfaulted 2011-04-19 04:51:18 -03:00
Werner Almesberger
07a2e5c5cc atrf-path/gui.c: indicate status not only with color but also with shape
- gui.c (disc, indicate): moved drawing of disc to separate function
- gui.c (triangle, up, down): draw an up/down triangle
- gui.c (indicate): use up/down triangle for over/under
2011-04-13 21:32:02 -03:00
Werner Almesberger
66d641f624 atrf-path/genpathprof: profile generator
- genpathprof: generate a profile for atrf-path from measurements and/or
  user-provided limits
- profile.example: example profile
2011-04-13 21:13:26 -03:00
Werner Almesberger
87b76af2fa atrf-path.c (usage, main): use ... [[sweeps] samples] with and without GUI
This was just too confusing ...
2011-04-13 20:55:45 -03:00
Werner Almesberger
9e3d17460a atrf-path/gui.c (tstart, tstop): commented out benchmarking code 2011-04-13 20:40:26 -03:00
Werner Almesberger
c86ce307e2 atrf-path: added pass/fail indication (in the GUI, accept the result with P/F)
- atrf-path.c (do_sweeps): return a pass/fail/undecided value
- gui.h (gui), gui.c (gui): return a pass/fail/undecided value
- gui.c (gui): return pass/fail when P or F is pressed; exit
  unconditionally if Q is pressed
- atrf-path.c (main): according to the decision of "gui" or "do_sweeps",
  print "#PASS", "#FAIL", or nothing
2011-04-13 20:24:50 -03:00
Werner Almesberger
fbc7aee55f atrf-path/gui.c (main): cycle counting was broken; fixed it 2011-04-13 19:34:00 -03:00
Werner Almesberger
f32f48ae26 atrf-path: visualize the limits in GUI mode
- gui.c (avg2y, segment): moved mapping from measurement to y position
  to separate function, to allow for sharing
- gui.c (LIMIT_RGBA, draw_limit, gui): draw the limits
2011-04-13 19:08:23 -03:00
Werner Almesberger
a1fc867bf2 atrf-path: option -P to load a min/max profile; pass/fail indication in GUI
- sweep.h (MIN_DIFF, MAX_DIFF, struct sweep): added min/max profile
- sweep.h (do_sweep), atrf-path.c (do_half_sweep, do_sweep): compare
  result against limits and return pass/fail decision
- sweep.h (N_CHAN), atrf-path.c (do_half_sweep, do_sweeps), gui.c
  (N_CHAN): declare number of channels in one central place instead of
  scattering it all around the program
- atrf-path.c (do_read_profile, read_profile, usage, main): new option -P
  to read a min/max profile
- gui.c (indicate, main): moved indicator to separate function and
  improved blink logic
- gui.c (OVER_RGBA, UNDER_RGBA, indicate, main): change color to indicate
  pass/fail
2011-04-13 18:40:39 -03:00
Werner Almesberger
a7d9dfd258 atrf-path.c: do cw test setup only once if sweeping a single offset
atrf-path -T +0.5 -g ... 10 10 time:

before:	0.32-0.33 s
after:	0.27-0.29 s	(88%)

- atrf-path.c (sample): force cw test setup if never done before
- atrf-path.c (do_half_sweep): only request cw test setup if sweeping
  both offsets
2011-04-13 14:17:01 -03:00
Werner Almesberger
e2a9c9d068 atrf-path: new option -T to sweep only one offset
atrf-path -T +0.5 -g ... 10 10 time:

before (both offsets)	0.65 s
after (one offset)	0.32-0.33 s	(50%)

- atrf-path.c (usage, main): new option -T to specify which offset to
  sweep (default: sweep both)
- atrf-path.c (do_half_sweep): only sample points with the desired offset
- atrf-path.c (print_sweep): only prints points we've sweeped
- gui.c (segment, draw): inverted flag logic from "have_last" to "first"
- gui.c (draw): only plot points we've sweeped
- gui.c (gui): pass the offset selection to "draw"
2011-04-13 14:01:12 -03:00
Werner Almesberger
598582c26a atrf-path.c (do_half_sweep, do_sweep): don't duplicate the loop - use a function 2011-04-13 13:47:41 -03:00
Werner Almesberger
d263ffcb8b atrf-path.c (usage): list common args only once, not in each synopsis 2011-04-13 13:38:07 -03:00
Werner Almesberger
2c1cb715e4 atrf-path: sweep offsets separately, so that the we can reuse the cw setup
atrf-path -g ... 10 10 time:

before	1.92 s
after	0.65 s	(34%)

- atrf-path.c (do_sweep): separate -0.5 MHz and +0.5 MHz sweep
- atrf-path.c (sample, do_sweep): set up cw test mode only twice per
  sweep (once for each offset), and simply resume in all other cases
2011-04-13 13:07:55 -03:00
Werner Almesberger
e3463ef8a0 atrf-path.c: moved tx init out of sample loop (breaks 230 support)
atrf-path -g ... 10 10 time is now stable at 1.92 s

- atrf-path.c (sample): commented-out init sequence needed for AT86RF230
- atrf-path.c (sample, do_sweep): set TX channel only once per +/-0.5 MHz
  pair
- atrf-path.c (sample, do_sweep): "sample" no longer needs the channel
  argument
- atrf-path.c (sample, main): do TX init only once
2011-04-13 12:53:46 -03:00
Werner Almesberger
16a48d6931 libatrf: cw test mode can now be resumed, with lower overhead (231 only)
- lib/cwtest.c (enter_test_mode_231, prepare_test_mode_231,
  start_test_mode_231, cw_test_begin): broke enter_test_mode_231 into
  a slow setup component and a fast start/resume component
- include/cwtest.h (cw_test_resume), lib/cwtest.c (cw_test_resume):
  resume transmission in a previously set up test mode
2011-04-13 12:17:02 -03:00
Werner Almesberger
5f153ca4b8 atrf-path/atrf-path.c: initialize the receiver only once, not for each sweep
atrf-path -g ... 10 10 time:

before	2.08 s
after	1.92-1.93 s	(92-93%)

- atrf-path.c (set_channel, init_common): moved setting of the channel
  to separate function, for better granularity
- atrf-path.c (init_common, init_tx, init_rx, sample, do_sweep): the
  init_* functions no longer set the channel; use set_channel
- atrf-path.c (main): initialize the receiver only once
2011-04-13 11:55:04 -03:00
Werner Almesberger
436c9faed5 atrf-path: the GUI is now activated with -g; also changed arguments in GUI mode
- atrf-path.c (usage, main): new option -g to invoke the GUI
- atrf-path.c (usage, main): in GUI mode, the number of sweeps is optional
  (default: infinite)
- atrf-path.c (main), gui.h (gui), gui.c (gui): exit after the specified
  number of sweeps
2011-04-13 11:54:58 -03:00
Werner Almesberger
cee0296579 tools/atrf-path/gui.c (gui): added pulsating disc as progress/status indicator 2011-04-13 11:54:58 -03:00
Werner Almesberger
4244af265c tools/lib/cwtest.c (cw_test_end): try "quick reset" on AT86RF231
The transceiver reset takes quite a while. It seems that also going into
sleep mode has the effect of stopping cw test mode and it's much faster.

This has only been tried on the AT86RF231. For AT86RF230, we therefore
still use the reset.

Performance improvement:

Measurement: atrf-path sweep time in GUI mode, averaging over 10 samples.
Running on PC with remote ATBEN transceivers.

before	7.36-7.68 s
after	2.08 s		(27-28% of previous time)
2011-04-13 11:54:26 -03:00
Werner Almesberger
6efe37436f tools/atrf-path/gui.c: temporarily added code for sweep time measurements 2011-04-13 08:54:26 -03:00
Werner Almesberger
0a409103eb atrf-path: added basic graphical output
- gui.h, gui.c: plot sweep results with SDL_gfx
- Makefile: added target-specific variables for SDL and SDL_gfx
- atrf-path.c (main): invoke the GUI if the number of sweeps is zero
2011-04-12 22:52:39 -03:00
Werner Almesberger
2967f99966 - atrf-rssi.c (gui): moved system-dependent definition to gui.h 2011-04-12 22:47:18 -03:00
Werner Almesberger
6df648792a atrf-path: generalized sweep interface (for reuse)
- sweep.h (struct sweep ), atrf-path.c (sample, do_sweeps, main): pass
  sweep parameters via a struct
- sweep.h (do_sweep), atrf-path.c (do_sweep, do_sweeps): separated single
  sweep and made it public
- sweep.h (struct sample), atrf-path.c (sample, print_sweep, do_sweeps):
  made "sample" and do_sweep return the sample value/vector and moved
  output from "sample" to print_sweep
2011-04-12 22:35:46 -03:00
Werner Almesberger
b159e00316 atrf-path: added min/max values and corrected averaging algorithm
- atrf-path.c (rssi_to_dBm, sample): moved RSSI value to dBm conversion to
  separate function
- atrf-path.c (sample): corrected calculation of average
- atrf-path.c (sample): also output minimum and maximum value
- plot: new option -e to display extremal values
- plot: added comment to explain y range
2011-04-12 20:53:17 -03:00
Werner Almesberger
a2e0e1d807 tools: new utility atrf-path to measure path characteristics
- Makefile (DIRS): added atrf-path
- atrf-path/Makefile, atrf-path/atrf-path.c: new utility atrf-path to
  measure path characteristics (for now, TX-to-RX path attenuation)
- atrf-path/plot: visualize path loss measurements
2011-04-12 19:43:45 -03:00
Werner Almesberger
09e5d28768 xxx 2011-04-12 19:17:43 -03:00
Werner Almesberger
1618868f9f libatrf: further modularized transmit power setting and exported conversion
- lib/misctxrx.c (tx_pwr_230, tx_pwr_231): declare tables as "const"
- lib/misctxrx.c (POWER_TABLE_SIZE, set_power_dBm): don't open-code the
  table size calculation
- lib/misctxrx.c (tx_power_table, set_power_dBm): moved transmit power
  table selection out of set_power_dBm
- include/misctxrx.h (tx_power_dBm2step, tx_power_step2dBm),
  lib/misctxrx.c (tx_power_dBm2step, tx_power_step2dBm, set_power_dBm):
  moved conversion functions out of set_power_dBm and made them globally
  available
2011-04-12 18:41:03 -03:00
Werner Almesberger
8934c062a9 tools/: moved function to set transmit power from atrf-txrx to libatrf
- atrf-txrx/atrf-txrx.c (tx_pwr_230, tx_pwr_231, set_power): moved to
  lib/misctxrx.c
- include/misctxrx.h, lib/misctxr.c (set_power_step, set_power_dBm):
  separated dBm to index conversion from the actual operation
- atrf-txrx/atrf-txrx.c (main): use new set_power_dBm instead of old
  set_power
2011-04-12 16:37:05 -03:00
Werner Almesberger
8f7e5cdefe tools/lib/atnet.c: eliminated global variables to allow for multiple sessions
- atnet.c: introduced descriptor structure, replacing direct netio handle
- atnet.c (reply, error): moved global variables into descriptor
- atnet.c (atnet_reg_read, atnet_interrupt): when complaining about an
  invalid response, skip the leading "+"
2011-04-12 09:45:34 -03:00
Werner Almesberger
920fe3407f tools/lib/atnet.c (dialog_vsend): plugged memory leak 2011-04-12 09:32:26 -03:00
Werner Almesberger
95c8fce729 tools/lib/atusb.c: eliminated global variable to allow for multiple sessions
- atusb.c: introduced descriptor structure, replacing direct USB device
  handle
- atusb.c (error): moved global variable into descriptor
- driver.h (atusb_dev_handle), atusb.c (atusb_dev_handle), atrf.c
  (atrf_usb_handle): call driver to perform the no longer trivial
  translation
2011-04-12 09:22:40 -03:00
Werner Almesberger
02b80879bf atrf-proxy.c (loop): use SO_REUSEADDR to avoid "address already in use" 2011-04-12 06:58:55 -03:00
Werner Almesberger
8c5d21b0d7 tools/Makefile (DIRS): include atrf-proxy in builds 2011-04-12 06:58:20 -03:00
Werner Almesberger
6e0657ea71 tools/atrf-proxy/PROTOCOL: added specification of asynchronous WAIT command 2011-04-12 06:32:22 -03:00
Werner Almesberger
4246535456 tools/lib/: atnet now works (tried atrf-txrx send and receive, atrf-rssi)
- atrf-proxy/atrf-proxy.c (cmd_two): "SET" wrote the wrong value
- lib/atnet.c (atnet_buf_read): cleaned up the logic and fixed some
  small bugs
2011-04-11 10:40:44 -03:00
Werner Almesberger
5dd2b4ae58 tools/lib/atusb.c (atusb_interrupt): if we have an error, report it immediately 2011-04-10 19:55:48 -03:00
Werner Almesberger
39319e145a tools/lib/: added network proxy-based driver (in progress)
- atnet.c: driver "net", which accessed hardware via atrf-proxy
- Makefile (OBJS): added atnet.o
- driver.h (atnet_driver), atrf.c (drivers): added the atnet driver
- atrf.c (drivers): moved the driver list closer to the top
2011-04-10 19:55:48 -03:00
Werner Almesberger
7be700df11 tools/lib/atrf.c: perform driver-specific operations only if using that driver
- atrf.c (atrf_usb_handle): only return the handle if using the atusb
  driver
- atrf.c (atrf_ben_regs): only call atben_regs if using the atben driver
2011-04-10 19:55:48 -03:00
Werner Almesberger
641567e393 tools/lib/atrf.c: moved declaration of driver operations to driver.h 2011-04-10 19:55:47 -03:00
Werner Almesberger
0b0b5712e8 atrf-trim.c (main): passing the trim value is not a usage error 2011-04-10 19:55:47 -03:00
Werner Almesberger
4ad0383020 tools/atrf-proxy/: network proxy (untested) 2011-04-10 19:55:47 -03:00
Werner Almesberger
3b0ee3c00a tools/: added network (TCP) I/O helper functions
- include/netio.h, lib/netio.c: network I/O helper functions
- lib/Makefile (OBJS): added netio.o
2011-04-10 17:28:09 -03:00
Werner Almesberger
a2f38c044e tools/: two small usage fixes
- atrf-id/atrf-id.c (usage): options were before the program name
- atrf-rssi/atrf-rssi.c (usage): the driver option was missing the "[-d"
2011-04-10 11:28:16 -03:00
Werner Almesberger
4190aded8c tools/lib/: added mechanism to remove USB restrictions (enabling multiple sessions)
- usbopen.h (usb_unrestrict), usbusb.c (usb_unrestrict): drop ID and
  path restrictions
- atusb.c (atusb_open): call usb_unrestrict to remove restrictions
2011-04-10 10:55:49 -03:00
Werner Almesberger
4b07e5c894 tools/: moved constant wave test mode code to libatrf (for sharing)
- lib/Makefile (OBJS), include/cwtest.h (cw_test_begin, cw_test_end),
  lib/cwtest.c (enter_test_mode_230, enter_test_mode_231,
  cw_test_begin, cw_test_end): moved constant wave test mode setup
  over from atrf-txrx.c
- atrf-txrx/atrf-txrx.c (transmit_pattern): use functions from cwtest.o
2011-04-10 10:24:24 -03:00
Werner Almesberger
fc1ad9fffd tools/lib: atusb can now be selected by bus/device or by bus-port path
Examples:

  usb:1/6	select logical device 6 on bus 1
  usb:1-3.1.4	starting at bus 1, choose ports 3, 1, and 4

- usbopen.c (initialize, open_usb): moved libusb initialization to
  separate function, to allow for sharing
- usbopen.h (restrict_usb_path), usbopen.c (restricted_path, open_usb,
  restrict_usb_dev, restrict_usb_by_dev, read_num, restrict_usb_by_port,
  restrict_usb_path): added mechanism to restrict USB path
- atusb.c (atusb_open): if an argument is given, call restrict_usb_path
  with it
2011-04-10 09:51:30 -03:00
Werner Almesberger
a75edf0cc0 tools/lib/: copied USB device opening code over from f32xbase
We shared it across projects so far, but since the code will be further
customized, it's better to keep it local (at least for a while).

- usbopen.h, usbopen.c: moved over f32xbase/include/usb.h and
  f32xbase/lib/usb.c (for further customization)
- Makefile (CFLAGS, OBJS_host): use usbopen.o instead of usb.o from
  f32xbase
- atusb.c: use usbopen.h instead of usb.h from f32xbase (also removes
  include path ambiguity)
2011-04-10 07:43:42 -03:00
Werner Almesberger
1a27e590d9 tools/: cleaned up the gross layering violation in atrf-xtal/atben.c
- include/atrf.h (atrf_ben_regs), lib/atrf.c (atrf_ben_regs),
  lib/driver.h (atben_regs), lib/atben.c (atben_regs): new function to
  get the mmap'ed registers in a less disgusting way
- atrf-xtal/atben.c (base, ben_setup): cleaned up the horrible layering
  violation
2011-04-10 07:28:27 -03:00
Werner Almesberger
7ff1a32ccf tools/: added option -d driver[:arg] to all tools
- atrf-id/atrf-id.c (main), atrf-reset/atrf-reset.c (main),
  atrf-trim/atrf-trim.c (main): changed command-line parsing to use
  "getopt"
- atrf-id/atrf-id.c (usage, main), atrf-reset/atrf-reset.c (usage, main),
  atrf-rssi/atrf-rssi.c (usage, main), atrf-trim/atrf-trim.c (usage,
  main), atrf-txrx/atrf-txrx.c (init_txrx, usage, main),
  atrf-xtal/atrf-xtal.c (usage, main): added option -d to select a driver
2011-04-10 07:28:27 -03:00
Werner Almesberger
1175923df7 tools/lib/atrf.c (select_driver): fixed name length calculation 2011-04-09 22:38:46 -03:00
Werner Almesberger
54edf17a1e libatrf: new function atrf_default_driver_name to get the default driver name
- include/atrf.h (atrf_default_driver_name),
  lib/atrf.c (atrf_default_driver_name): return the name of the default
  driver, or "none" if no drivers are defined
2011-04-09 22:35:29 -03:00
Werner Almesberger
1830454b49 atrf-xtal.c (usage, main): renamed option "d" (dump) to "r" (dump raw) 2011-04-09 21:36:52 -03:00
Werner Almesberger
adc14c4742 tools/lib/: make driver name matching case-sensitive and lower-case names
Case-sensitive is the Unix way, and so is avoiding unnecessary upper-case.

- atben.c (atben_driver): changed name from "Ben" to "ben"
- atusb.c (atusb_driver): changed name from "USB" to "usb"
- atrf.c (select_driver): made driver name matching case-sensitive
2011-04-09 21:18:31 -03:00
Werner Almesberger
5296fc8cf5 tools/: API change - atrf_open now requires a string argument (can be NULL)
atrf_open(NULL) maintains the old behaviour. To select a driver, use
atrf_open("name") or atrf_open("name:driver-specific-arguments")
The driver name is "ben" or "usb".

- include/atrf.h (atrf_open), lib/atrf.c (do_atrf_open, atrf_open):
  atrf_open now requires the string argument for driver selection
- atrf-id/atrf-id.c (main), atrf-reset/atrf-reset.c (main),
  atrf-rssi/atrf-rssi.c (main), atrf-trim/atrf-trim.c (main),
  atrf-txrx/atrf-txrx.c (main), atrf-xtal/atrf-xtal.c (main):
  changed atrf_open() to atrf_open(NULL)
2011-04-09 21:13:11 -03:00
Werner Almesberger
4e64e7ad90 atrf-reset.c: title comment claimed this was atrf-rssi 2011-04-09 21:08:01 -03:00
Werner Almesberger
c18d3e58d2 tools/lib/: added driver selection and driver-specific parameters to backend
- atrf.c (atrf_open, select_driver, do_atrf_open): added infrastructure
  for passing the driver name and further parameters to atrf_open
- atrf.c (struct atrf_dsc): made "driver" constant
- driver.h (struct atrf_driver), atben.c (atben_open), atusb.c
  (atusb_open): added string argument to the "open" function
- atusb.c (atusb_driver): corrected unterminated comment
2011-04-09 21:00:48 -03:00
Werner Almesberger
bc6bce9923 atrf-xtal/atben.c: restructured the code for better clarity; added warnings 2011-04-04 09:42:03 -03:00
Werner Almesberger
28e7f25585 tools/atrf-xtal: new utility to measure the crystal frequency
- Makefile (DIRS): added atrf-xtal
- atrf-xtal/Makefile: build atrf-xtal for the Ben or do nothing elsewhere
- atrf-xtal/atrf-xtal.h, atrf-xtal/atrf-xtal.c: diagnostic utility to
  determine the transceiver's crystal frequency
- atrf-xtal/atben.c: dirty low-level driver for ATBEN
2011-04-03 22:50:19 -03:00
Werner Almesberger
fe2720e63a tools/: new libatrf function atrf_slp_tr to control SLP_TR (for now only atben)
- include/atrf.h, lib/atrf.c (atrf_slp_tr): new function to set the SLP_TR
  line
- lib/driver.h (struct atrf_driver): added driver function slp_tr
- lib/atusb.c (atusb_driver): we dont support slp_tr yet
- lib/atben.c (atben_slp_tr, atben_driver): implement SLP_TR control
2011-04-03 20:13:38 -03:00
Werner Almesberger
7cf2b0d352 Makefile.recurse: moved into makefiles/
- Makefile.recurse: moved into makefiles/
- tools/Makefile, cntr/tools/Makefile: updated path to Makefile.recurse
2011-03-22 12:37:16 -03:00
Werner Almesberger
da8962344c tools/atrf-txrx (DEFAULT_TRIM, usage, main): changed default trim from 0 to 8
As explained in ECN0002, atben and atusb are designed for the trim to
be set to the mid-range value. This just wasn't implemented so far.
2011-03-03 23:18:43 -03:00
Werner Almesberger
9552b9f4af tools/Makefile.common: offer LDLIBS_$(TARGET) twice (hack - needs more study) 2011-03-03 23:17:32 -03:00
Werner Almesberger
1d6fbcbd21 atrf-id.c (show_usb_info): pretty-print the MCU type for ATUSB boards 2011-02-10 23:43:36 -03:00
Werner Almesberger
19926ae32f tools/lib/Makefile (clean): didn't remove Ben-specific object files
- tools/lib/Makefile (clean): $(OBJS_ben) is now $(OBJS_ben_jlime) and
  $(OBJS_ben_openwrt)
2011-02-10 23:21:31 -03:00
Werner Almesberger
b0c15b7e7c tools: give the driver control over CLKM (for ATmega32U2 boards)
- include/atrf.h (atrf_set_clkm), lib/atrf.c (atrf_set_clkm): set or
  disable CLKM
- lib/driver.h (atrf_set_clkm_generic), lib/atrf.c (atrf_set_clkm_generic):
  generic function to set CLKM without restrictions
- lib/driver.h (struct atrf_driver): added driver operation "set_clkm"
  to set CLKM
- lib/atusb.c (atusb_set_clkm, atusb_driver): restrict CLKM on ATmega32U2
  boards
- atrf-txrx/atrf-txrx.c (init_txrx): use atrf_set_clkm to set CLKM
- atrf-txrx/atrf-txrx.c (init_txrx, main): pass CLKM frequency in MHz
  instead of code point
2011-02-10 23:11:34 -03:00
Werner Almesberger
e73ca5fcd5 tools/lib: cache chip ID in the descriptor
- atrf.c (struct atrf_dsc): added field "chip_id" to cache chip ID
- atrf.c (identify, atrf_identify): moved identification logic to new
  function
- atrf.c (atrf_open, atrf_identify): cache chip ID when opening the
  device and return ID from cache
2011-02-10 21:15:05 -03:00
Werner Almesberger
705864d076 atrf-txrx: new option -r to select data rate
- atrf-txrx.c (set_rate, main): allow setting a non-standard high data
  rate on the AT86RF231
- atrf-txrx.c (usage, main): added option -r to select the data rate
2011-01-20 19:42:52 -03:00
Werner Almesberger
f16224f575 atrf-txrx: new option -P to select ping mode
- atrf-txrx.c (struct ping, enum rx_res, ping_tx, ping_rx, ping): send
  back a packet containing a locally generated sequence number and the
  last sequence number received whenever a packet arrives
- atrf-txrx.c (usage, main): added option -P to select ping mode
2011-01-20 19:42:52 -03:00
Werner Almesberger
fc226b2b51 atrf-txrc.c (usage, main): changed -P to -E to free -P for other use 2011-01-20 12:41:49 -03:00
Werner Almesberger
6282c334bc perdump: print relative receive timestamp
- perdump.h (struct result_ops), perdump.c (analyze, pcap_record): pass
  receive timestamp to reporter
- per-text.c (t_line, flush, text_undecided, text_packet): print relative
  receive timestamp before each packet
2011-01-19 19:34:16 -03:00
Werner Almesberger
6002759464 tools/atrf-txrx/perdump: new utility to analyze a PER dump
- Makefile: added perdump
- perdump.h, perdump.c: read and analyze a PER dump in pcap format
- per-text.c: report PER test results as text on the console
2011-01-19 18:29:14 -03:00
Werner Almesberger
1fb05c221d misctxrx.c (wait_for_interrupt): let "ignore" control printing more tightly
When some interrupt(s) happened but the one(s) wait_for_interrupt was
waiting for weren't among them, it printed the list of interrupts
even if they were all in "ignore". This made sequences like RX_START
followed by TRX_END unnecessarily noisy.

Now, wait_for_interrupt only prints the pending interrupts if at
least one of them is not in "ignore".
2011-01-19 18:27:17 -03:00
Werner Almesberger
96e8fc6dbf atrf-txrx: renamed BER (bit error rate) test to PER (packet ...) test
- atrf-txrx.c (usage, main): changed option -B to -P
- atrf-txrx.c (usage): "BER test mode" is now "PER test mode"
- atrf-txrx.c (main): mode_ber is now mode_per
2011-01-19 18:27:17 -03:00
Werner Almesberger
ea81e70cf9 atrf-txrx: define the pcap file magic number (0xa1b2c3d4) in pcap.h
- pcap.h (PCAP_FILE_MAGIC): define the pcap file magic number
- atrf-txrx.c (write_pcap_hdr): use PCAP_FILE_MAGIC instead of open-coding
  the magic number
2011-01-19 18:27:16 -03:00
Werner Almesberger
999ce5302e atrf-txrx: added BER test pattern transmit mode
- atrf-txrx.c (main): indicate mode of operation in variable "mode" instead
  of dual-using "cont_tx"
- atrf-txrx.c (usage, main): added option -B to enter BER test pattern
  transit mode
- atrf-txrx.c (transmit_pattern): transmit raw frames with a cyclic frame
  number
2011-01-19 18:27:16 -03:00
Werner Almesberger
f9aee54323 atrf-txrx: added ability to record received frames in pcap format
- pcap.h: basic pcap file structure definitions
- atrf-txrx.c (usage, main): added option "-o file" to write received
  frames to a pcap file instead of displaying them
- atrf-txrx.c (receive): moved code to receive and display a single message
  into new function receive_message
- atrf-txrx.c (write_pcap_hdr, write_pcap_rec, receive_pcap): receive
  messages into a pcap file
2011-01-19 18:27:16 -03:00
Werner Almesberger
5407180c32 atrf-txrx: cleaned up the usage output
- atrf-txrx.c (usage): split options and arguments for different modi into
  separate sections
- atrf-txrx.c (usage): moved details for common options to a separate
  section
- atrf-txrx.c (usage): added -C mhz to synopsis
2011-01-19 01:11:48 -03:00
Werner Almesberger
1cd079ee82 great atusd -> atben renaming: changed remaining references in tools/
- Makefile.common (MACROS_ben_jlime, MACROS_ben_openwrt), lib/atrf.c
  (atrf_open): changed HAVE_USD to HAVE_BEN
- lib/atben.c: changed "uSD version" in title to "Ben 8:10 card version"
- lib/atrf.c, lib/atben.c: changed all occurrences of "atusd" to "atben"
2011-01-17 12:06:16 -03:00
Werner Almesberger
32de4b6ad4 great atusd -> atben renaming: renamed tools/atusd.c and Makefile reference
- lib/atusd.c: renamed to lib/atben.c
- lib/Makefile (OBJS_ben_jlime, OBJS_ben_openwrt): changed "atusd" to
  "atben"
2011-01-17 11:56:17 -03:00
Werner Almesberger
ebe667197a dirtly made the atrf tools run with the new atusd board
- lib/atusd.c: renamed CLK to SLP_TR
- lib/atusd.c (atusd_cycle, atusd_cycle, atusd_open, atusd_close):
  #ifdef'ed all uses of CLK and changed them to SLP_TR (along with the
  change in function)
- atrf-txrx/atrf-txrx.c (init_txrx): always use the crystal oscillator
2011-01-16 16:03:11 -03:00
Werner Almesberger
e90c59635b atrf-txrx.c (enter_test_mode_231): disable CLKM in AT86RF231 test mode
According to the data sheet, it has to be enabled. The Software Model
doesn't mention it. Experiments show that it's indeed useless and just
adds noise.
2011-01-12 20:11:28 -03:00
Werner Almesberger
cb7afe132d atrf-txrx: new option -C to control CLKM output
- atrf-txrx.c (usage, main): added option -C mhz to enable the CLKM output
  and to set its frequency
- atrf-txrx.c (init_txrx): if requested, enable CLKM and set to maximum
  drive strength
2011-01-12 20:11:14 -03:00
Werner Almesberger
6ff235e8ea tools/lib/misctxrx.c (wait_for_interrupt): restore signal also after timeout 2011-01-10 13:52:57 -03:00
Werner Almesberger
110d5abe32 tools/atrf-txrx/atrf-txrx.c (enter_test_mode_231): clean up and exit on error 2011-01-10 00:14:35 -03:00
Werner Almesberger
9b498ae244 atrf-txrx: small 231 continuous transmission mode cleanup (doesn't work yet)
- atrf-txrx.c (enter_test_mode_231): test value read from TRX_STATUS
- atrf-txrx.c (enter_test_mode_231): wait indefinitely for the PLL to lock
2011-01-09 20:16:11 -03:00
Werner Almesberger
1befc69e37 tools/lib/misctxrx.c: decode AMI and CCA_ED_DONE interrupts (231 only) 2011-01-09 19:38:33 -03:00
Werner Almesberger
0c7146cad9 atrf-txrx: updated for AT86RF231 interrupt handling
- atrf-txrx.c (init_txrx): unmask all interrupts for 231 compatibilit,
  where masked interrupts are now indicated in IRQ_STATUS
- atrf-txrx.c (init_txrx): on the 231, wait for (and clear) the CCA_ED_DONE
  interrupt when entering TRX_OFF after reset
2011-01-09 19:36:29 -03:00
Werner Almesberger
45e55fe2f1 tools/: renamed OpenWRT target from "ben" to "ben_openwrt" and added "ben_jlime"
- tools/Makefile (upload): make destinastion host name ("ben" or "jlime")
  depend on TARGET
- tools/Makefile.common (CC_ben, CFLAGS_ben, LDLIBS_ben, MACROS_ben):
  renamed to *_openwrt and added *_jlime equivalents
- tools/atrf-rssi/Makefile: added settings to use SDL_gfx on Jlime
- tools/lib/Makefile (OBJS_ben): renamed to OBJS_ben_openwrt and added
  OBJS_ben_jlime
2011-01-09 19:01:27 -03:00
Werner Almesberger
4d2395e23c atrf-rssi.c: unmask IRQ_PLL_LOCK, for 231 compatibility 2011-01-09 19:01:27 -03:00
Werner Almesberger
b2d90cd3d3 atrf-txrx: added support for AT86RF231 continuous transmission mode
- atrf-txrx.c (test_mode): moved test mode setup to enter_test_mode_230
- atrf-txrx.c (enter_test_mode_231): enter test mode on AT86RF231 (untested)
- atrf-txrx.c (test_mode): reset AT86RF231 register 0x1c when leaving
2011-01-07 14:59:23 -03:00
Werner Almesberger
309a5ed6d5 atusb/fw/include/at86rf230.h: make 231-centric
- at86rf230.h (TX_AUTO_CRC_ON): changed to TX_AUTO_CRC_ON_230
- at86rf230.h (TX_AUTO_CRC_ON_231): changed to TX_AUTO_CRC_ON
- tools/atrf-txrx/atrf-txrx.c: updated for above changes
2011-01-07 14:31:27 -03:00
Werner Almesberger
02e394a706 atrf-txrx: set CRC and transmit power depending on chip (AT86RF230/231)
- atrf-txrx.c (tx_pwr, tx_pwr_230, tx_pwr_231, set_power): table of power
  values depends on chip
- atrf-txrx.c (set_power): location of TX_AUTO_CRC_ON and use of
  REG_PHY_TX_PWR depends on chip
2011-01-07 13:49:52 -03:00