1
0
mirror of git://projects.qi-hardware.com/ben-wpan.git synced 2024-11-09 10:50:37 +02:00
Commit Graph

18 Commits

Author SHA1 Message Date
Werner Almesberger
4aff7af370 tools/lib/atusb.c: added SRAM access to atusb driver
- atusb.c (atusb_sram_write, atusb_sram_read): SRAM access functions
- atusb.c (atusb_driver): added new functions to driver operations
2011-06-03 14:26:47 -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
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
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
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
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
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
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
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
809311284d lib/atusb.c: fix typo in function name
- lib/atusb.c (atusd_interrupt, atusb_driver): we're in atusb.c, so the
  function name should begin with atusb_, not atusd_
2010-11-11 10:34:09 -03:00
Werner Almesberger
688df9771d The Great ATSPI Renaming, part 5: rename "struct atspi_driver" to "atrf_driver"
- lib/driver.h: rename "struct atspi_driver" to "struct atrf_driver"
- lib/atrf.c, lib/atusb.c, lib/atusd.c: track above change
2010-11-11 09:04:36 -03:00
Werner Almesberger
96b6a50b3a The Great ATSPI Renaming, part 2: rename ATSPI_* identifiers to ATUSB_*
- atusb/fw/include/atusb/ep0.h, atusb/fw/atusb/ep0.c: rename all ATSPI_*
  identifiers (EP0 commands, protocol revision, etc.) to ATUSB_*
- tools/lib/atusb.c, tools/atspi-id/atspi-id.c: track identifier change
2010-11-11 08:41:25 -03:00
Werner Almesberger
7e71f98007 The Great ATSPI Renaming, part 1: rename atusb firmware files from atspi to atusb
- atusb/fw/atspi/atspi.c: renamed to atusb/fw/atspi/atusb.c
- atusb/fw/atspi/Makefile: track above change
- atusb/fw/include/atspi/: renamed to atusb/fw/include/atusb/
- atusb/fw/common/config.h, atusb/fw/atspi/atspi.c, atusb/fw/atspi/descr.c,
  atusb/fw/atspi/ep0.c: track change of include location
- atusb/fw/atspi/: renamed to atusb
- atusb/fw/Makefile: track above change
- tools/atspi-id/atspi-id.c, tools/atspi-trim/atspi-trim.c,
  tools/lib/atusb.c: track change of include location
2010-11-11 08:26:01 -03:00
Werner Almesberger
5d63a009c8 libatspi: new function atspi_test_mode to enter test mode
- include/atspi.h, lib/atspi.c: new function atspi_test_mode to enter test
  mode
- lib/driver.h (struct atspi_driver): add backend function test_mode
- lib/atusb.c (atusb_test_mode), lib/atusb.c (atusb_driver): enter test
  mode
- lib/atusd.c (atusd_driver): test mode is not supported
2010-11-11 02:29:07 -03:00
Werner Almesberger
b6a80ba3dd Added interrupt polling support for atusb.
- atrf/fw/include/atspi/ep0.h enum atspi_requests), atrf/fw/atspi/ep0.c
  (my_setup): new command ATSPI_POLL_INT to poll IRQ_RF
- atrf/fw/atspi/ep0.c (my_setup): ATSPI_BUILD sent one byte too many
- tools/lib/atusb.c (atusd_interrupt, atusb_driver): implemented interrupt
  polling
- tools/lib/atusd.c: added section title for the RF interrupt function
2010-09-09 20:22:45 -03:00
Werner Almesberger
f20d685f8e Merged uSD driver into unified tool build, completed conversion of tools.
- atusd/tools/lib/atusd.c: moved to tools/lib/
- atusd/tools/lib/atusd.h: removed, we can now use tools/include/atspi.h
- tools/lib/atusd.c: added copyright header
- tools/lib/atusd.c: updated for driver API
- tools/lib/Makefile: added atusd.o
- tools/Makefile.common: moved common elements from all other makefiles in
  tools/*/ here
- tools/Makefile.common: added target-specific compiler and flags
- tools/atspi-id/Makefile, tools/atspi-reset/Makefile,
  tools/atspi-rssi/Makefile, tools/atspi-trim/Makefile,
  tools/atspi-txrx/Makefile, tools/lib/Makefile: used Makefile.common
- tools/lib/Makefile: differentiate USB and uSD build
- tools/atspi-id/atspi-id.c, tools/atspi-reset/atspi-reset.c,
  tools/atspi-rssi/atspi-rssi.c, tools/atspi-trim/atspi-trim.c,
  tools/atspi-txr/atspi-txr.c: updated for driver-agnostic API
- tools/atspi-id/atspi-id.c, tools/atspi-reset/atspi-reset.c,
  tools/atspi-rssi/atspi-rssi.c, tools/atspi-trim/atspi-trim.c,
  tools/atspi-txr/atspi-txr.c: corrected AF86RF230 typo in title
- tools/include/atspi.h, tools/lib/atspi.c, tools/lib/driver.c,
  tools/lib/atusb.c: brought back support for atspi_error and
  atspi_clear_error
- tools/atspi-id/atspi-id.c (atspi_get_protocol): renamed to get_protocol,
  to make it clear that it's not from libatspi
- tools/atspi-id/atspi-id.c (atspi_get_build): renamed to get_build, to
  make it clear that it's not from libatspi
- tools/include/atspi.h, tools/lib/atspi.c (atspi_usb_handle): new function
  to obtain a driver's USB device handle (or NULL if the driver doesn't use
  USB)
2010-09-05 20:32:58 -03:00
Werner Almesberger
e2b2df2e31 Made the libatspi API driver-agnostic.
- tools/include/atspi.h: API is now driver-independent
- tools/lib/driver.h: API between driver and frontend
- tools/lib/atspi.c: renamed to atusb.c and updated for driver API
- tools/lib/atspi.c: frontend functions for the driver API
- tools/lib/Makefile: added atusb.o
2010-09-05 19:06:48 -03:00