Commit graph

26 commits

Author SHA1 Message Date
Kumar Gala
a1b77fd589 zephyr: replace zephyr integer types with C99 types
git grep -l 'u\(8\|16\|32\|64\)_t' | \
		xargs sed -i "s/u\(8\|16\|32\|64\)_t/uint\1_t/g"
	git grep -l 's\(8\|16\|32\|64\)_t' | \
		xargs sed -i "s/s\(8\|16\|32\|64\)_t/int\1_t/g"

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-06-08 08:23:57 -05:00
Emil Obalski
8fa51bca58 usb: Allow Audio Class to handle custom_hander for all interfaces
This exception allows USB Audio Class to properly respond to the
interface requests.

This commit is temporary solution and shall not be considered as
valid solution for other classes.

Signed-off-by: Emil Obalski <emil.obalski@nordicsemi.no>
2020-05-07 11:20:27 +02:00
Barry Solomon
6118ca2785 usb: make usb descriptor power options configurable
Add two new kconfig options USB_SELF_POWERED and USB_MAX_POWER.
These can be set by the user to change the USB configuration descriptor.
USB_MAX_POWER can be set to any value between 0 and 250, but practically
should be 50 or 250. These values are half the ammount of mA that the
device will tell the host that it needs.
USB_SELF_POWERED sets the 7th bit in bmAttributes of the USB config
descriptor. Should be set to y if the device has its own power source
other than USB.

Signed-off-by: Barry Solomon <barry.solomon@dexcom.com>
2019-12-20 19:46:16 -05:00
Emil Obalski
85a08da966 usb: Rename defines to match present naming convention
This commit renames two defines:
CS_INTERFACE -> USB_CS_INTERFACE_DESC
CS_ENDPOINT -> USB_CS_ENDPOINT_DESC
in order to match current naming convention when it comes
to descriptors fields.

All relevant files are updated to match renamed macros.

Signed-off-by: Emil Obalski <emil.obalski@nordicsemi.no>
2019-12-09 12:48:13 -05:00
Emil Obalski
c1f5e11bb6 usb: Cleanup for multiplied defines
Some of defines are present in several header files.
Those defines are the same with value but with different naming.

Common defines are brought to usb_common.h

Signed-off-by: Emil Obalski <emil.obalski@nordicsemi.no>
2019-12-09 12:48:13 -05:00
Arnaud Taffanel
a06a6da03b usb: Fix BCD() macro used to set bcdDevice
According to API documentation, the bcdDevice field of the USB
descriptor is supposed to represents the Zephyr kernel major
and minor versions as a binary coded decimal value. However,
when using zephyr 2.0, bcdDevice is shown as 0.00 instead of 2.00.

This is due to a typo in the implementation of the BCD macro in
usb_commond.h. This commit fixes the macro.

Signed-off-by: Arnaud Taffanel <arnaud@bitcraze.io>
2019-11-20 19:38:13 +01:00
Paweł Zadrożniak
3ecbff501a usb: Add remote wakeup support
This commit adds support for remote wakeup and extends USB api
with a wakeup request call. Remote wakeup can be dsabled in kconfig
when a specific driver does not support this feature.

Signed-off-by: Paweł Zadrożniak <pawel.zadrozniak@nordicsemi.no>
2019-02-27 10:37:16 +01:00
Marcin Szymczyk
d5b79ff42c usb: hid: implement idle rate
Idle rate functionality has been implemented for HID USB class.
Bassed on Device Class Definition for Human Interface Devices 1.11.
Tested with USB3CV and host with idle rate.

Signed-off-by: Marcin Szymczyk <Marcin.Szymczyk@nordicsemi.no>
2018-12-04 15:58:19 -05:00
Flavio Ceolin
67ca176754 headers: Fix headers across the project
Any word started with underscore followed by and uppercase letter or a
second underscore is a reserved word according with C99.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2018-09-17 15:49:26 -04:00
Andrei Emeltchenko
c1724f65bf usb: bos: Add USB BOS descriptors API
Add API for USB BOS Descriptors.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2018-06-20 15:47:00 -04:00
Johann Fischer
46700eaa65 include: usb: add USB DFU class header
Add USB DFU class header.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2018-04-30 17:42:40 -04:00
Andrei Emeltchenko
4f84cf782d usb: Add BOS Descriptors
Add Binary Device Object Store descriptors

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2018-04-20 21:04:42 -07:00
Andrei Emeltchenko
efa3a137cf usb: Remove duplicated ACM_SUBCLASS definition
ACM_SUBCLASS is already defined in USB CDC header.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2018-04-04 08:21:06 -04:00
Andrei Emeltchenko
4291fb67a3 usb: Remove duplicated CDC_ECM_SUBCLASS definition
Use ECM_SUBCLASS instead.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2018-04-04 08:21:06 -04:00
Iván Sánchez Ortega
fa57ebd5b7 usb: Rename unicode into UTF16LE
In order to avoid confusion between "Unicode", UTF8, UTF16, UTF32,
and endianess of these encodings, rename all instances of "Unicode"
in the USB subsystem and samples into "UTF16LE".

Signed-off-by: Iván Sánchez Ortega <ivan@sanchezortega.es>
2018-03-14 13:40:59 +01:00
Patrik Flykt
010fb40b95 subsys: usb: Set Zephyr project USB Vendor and Product IDs
Document USB Vendor and Product IDs and their intended usage.
Set the Vendor and Product IDs and define the USB bcdDevice
Device Descriptor Device Release Number to be the binary
coded decimal representation of the Zephyr major and minor
kernel version number.

Signed-off-by: Patrik Flykt <patrik.flykt@intel.com>
2018-01-15 15:47:53 -05:00
Johann Fischer
eb501f6253 include: usb: fix style and add standard descriptors to usb_common.h
Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2017-10-13 07:47:48 -04:00
Andrei Emeltchenko
54831ec5c7 usb: webusb: Move USB version definition to right place
Make it possible to reuse definitions from other samples.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2017-09-21 13:10:04 -04:00
Andrei Emeltchenko
0aebb0faf4 usb: Add USB definitions for RNDIS Ethernet device
And useful definitions for composite device with RNDIS Ethernet
function.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2017-09-21 09:00:23 -04:00
Andrei Emeltchenko
b60a0af586 usb: Add DEVICE_QUAL descriptor definitions
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2017-09-21 09:00:23 -04:00
Andrei Emeltchenko
03d6692d30 usb: Add Custom subclass definition
Change-Id: I2a3d15ce45f3a44c5fbb5986c91bcc66621796b0
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2017-09-21 09:00:23 -04:00
Andrei Emeltchenko
e2b90cdf68 usb: Update USB common definitions
Add support for USB 2.0 and NCM CDC protocol

Change-Id: Ib815b7d9d02d404b5dfbcc8aba1fcd7e6de71bd3
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2017-09-21 09:00:23 -04:00
Andrei Emeltchenko
edea77b155 usb: Add Ethernet Control Mode (ECM) subclass definition
Change-Id: Ie7dd270de9d972ac8e09255a930fe42295ae1533
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2017-09-21 09:00:23 -04:00
Andrei Emeltchenko
4cccc24391 usb: Add Bluetooth class codes definitions
Change-Id: Idc60324bcf9ee3e9a3ce9a24b71cf5ae5b339792
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-08-10 15:27:35 +00:00
Adrian Bradianu
ab2c18b0ad usb: Move LOW_BYTE and HIGH_BYTE to samples code
Move LOW_BYTE and HIGH_BYTE macros from usb_common.h to
samples code.

Change-Id: I26296bde8c5b3991b3bfab71272c861b5360ce97
Signed-off-by: Adrian Bradianu <adrian.bradianu@windriver.com>
Signed-off-by: Jesus Sanchez-Palencia <jesus.sanchez-palencia@intel.com>
2016-06-30 17:51:58 +00:00
Adrian Bradianu
7a16ade6d1 usb: Add USB device core layer
USB Device core layer is a hardware independent interface between USB
device controller driver and USB device class drivers or customer
applications. It's a port of the LPCUSB device stack.

Change-Id: I9371ffab7034d20953fec0525e72fbe9e094c931
Signed-off-by: Adrian Bradianu <adrian.bradianu@windriver.com>
Signed-off-by: Jesus Sanchez-Palencia <jesus.sanchez-palencia@intel.com>
Signed-off-by: Jithu Joseph <jithu.joseph@intel.com>
2016-06-30 17:51:56 +00:00