21 Commits

Author SHA1 Message Date
Andrey Smirnov
113e5c22e6 Change the way buffer for control requests data is allocated
Current way of having a globally, but weakly defined static buffer has
several shortcomings:
 - It forces user to have a certain "magic" byte array variable if
   they want to have a control buffer of different size.
 - Having a globally defined static array and a separate function to
   tell USB core about its size is error prone.
 - Its inner workings are not easily understandable form cursory look
   at API and one needs to go and look at the implementation code to
   connect all the pieces into a solid picture of how it works

This commit adds two parameters to 'usbd_init' call that allow user to
specify the pointer to the area of memory and a size of that memory
which would be used by the USB core to store the data received during
DATA stage of control requests. This approach, while further
complicating the prototype of 'usbd_init', provides user with more
flexibility allowing for any custom area of memory of any size to be
used as control buffer. It also forces user to provide both address
and memory size at the same time thus avoiding the possibility of user
redefining 'usbd_control_buffer', but not calling
'usbd_set_control_buffer_size' after that.
2013-04-25 17:24:27 -07:00
Ken Sarkies
1374d2622b Place generic USB header and source files into the documentation tree. 2013-04-19 10:26:01 +09:30
Jeff Ciesielski
db35fbb7ba Merge branch 'master' of git://github.com/libopencm3/libopencm3 into upstream-merge 2012-11-13 13:13:40 -08:00
Andrey Smirnov
7a5da60e26 Change USB strings handling code
This commit add an extra field to the _usbd_device, that allows to
keep track of the number of USB strings  which allows simplify
boundaries checking code in usb_standard_get_descriptor.

This commit also changes the index base for strings in
usb_standard_get_descriptor which allows to get rid of necessity to
have a dummy one-character string in a strings array.
2012-11-06 16:46:55 -08:00
Jason Kotzin
34beeae925 USB core updated for reentrance based on Christian Cier-Zniewski's branch 2012-09-13 10:43:35 -07:00
Piotr Esden-Tempski
43561de329 License change of the library to LGPL, version 3 or later.
Agreed to by all the significant contributors to the library.
2012-03-02 14:44:49 -08:00
Mike Smith
7da1967056 Add an interface for soft disconnection, and hook it up in the F107 driver. 2012-02-12 15:00:08 -08:00
Uwe Hermann
373794ab68 usb: Fix some Doxygen comments. 2011-11-17 00:12:47 +01:00
Uwe Hermann
3e9b9cb345 usb: Coding-style fixes. 2011-11-17 00:12:43 +01:00
Gareth McMullin
b05a5dcf2a Fixed some F105/F107 USB issues. Added user callback on SOF.
Made examples depend on lib.
2011-10-29 21:30:26 +13:00
Gareth McMullin
ef0ff192f7 Added usbd_ep_nak_set() to force flow control on OUT endpoints. 2011-03-30 07:17:02 +13:00
Gareth McMullin
e64a9d2bf9 Minor cleanup of usb. Template driver for STM32F107 added. 2011-02-10 19:58:51 +13:00
Uwe Hermann
a0091f18c7 Cosmetics, consistency fixes, fix compiler warnings. 2011-01-30 22:43:33 +01:00
Gareth McMullin
aac65d8560 Abstracted USB driver interface to to allow driver selection. 2011-01-30 17:04:56 +13:00
Uwe Hermann
8f251e8a9d Some more file/path restructuring.
All #includes now explicitly use the "<libopencm3/stm32/rcc.h>" format.
If you want to get rid of the "libopencm3" prefix in your local project you
can add a respective -I entry in your Makefile (not recommended though).

All .ld files and .a libs are installed in $(TOOLCHAIN_DIR)/lib
directly (as before), but are now renamed to avoid potential
conflicts now or in the future. Examples:

  libopencm3_lpc13xx.a
  libopencm3_lpc13xx.ld
  libopencm3_stm32.a
  libopencm3_stm32.ld
2010-12-31 18:18:39 +01:00
Uwe Hermann
18790a2454 More renames for libopenstm32 -> libopencm3. 2010-12-30 13:19:25 +01:00
Uwe Hermann
b5727a6c73 USB: Cosmetics and coding-style fixes. 2010-12-29 18:00:32 +01:00
Uwe Hermann
c39eb69e4d Replace uint8_t with u8 et al, fix whitespace. 2010-12-29 17:28:06 +01:00
Uwe Hermann
34fd228bf9 Move generic USB stuff to a subdir, dedupe .h files.
Adapt examples and the lib code accordingly.
2010-12-29 17:02:36 +01:00
Uwe Hermann
f062777930 More whitespace fixes. 2010-12-29 16:43:26 +01:00
Uwe Hermann
6e090ccee1 Initial USB device stack for STM32.
Patch provided by Gareth McMullin <gareth@blacksphere.co.nz>,
thanks a lot!
2010-11-02 02:02:21 +01:00