No description
Find a file
Amir Hammad 28ccd32608 core: adjust search for the device driver
in finding compatibility there are 3 steps how to find
out whether the provided device driver supports currently
inserted device.

1. compare fields in the driver info structure
If there is a match (all CHECK_PARTIAL_COMPATIBILITY() macros return true),
we proceed to step 2.
If all device drivers are searched, but none is compatible ->
that means no device driver is available for currently inserted device.

2. try to call driver's init function.
If it return non-null pointer to data we may proceed to the step 3.
Otherwise, we continue in the loop handling step 1.

3. call analyze descriptor for all descriptors. When it returns true,
it means success and that the driver supports current device. From now on
poll function is allowed to be called.
If all descriptors were provided to the analyze_descriptor method and
it still returns false, it means device driver is not initialized and
should not be used with this device.

Signed-off-by: Amir Hammad <amir.hammad@hotmail.com>
2016-09-08 07:54:06 +02:00
build libusbhost: Open source USB host stack for embedded devices 2015-04-01 16:22:05 +02:00
include make usbh_packet->data of union type 2016-09-08 07:54:06 +02:00
libopencm3@798c1edf4d libusbhost: Open source USB host stack for embedded devices 2015-04-01 16:22:05 +02:00
src core: adjust search for the device driver 2016-09-08 07:54:06 +02:00
.gitignore Add doxyfile 2016-07-09 00:22:22 +02:00
.gitmodules libusbhost: Open source USB host stack for embedded devices 2015-04-01 16:22:05 +02:00
compileDemo.sh libusbhost: Open source USB host stack for embedded devices 2015-04-01 16:22:05 +02:00
config.mk move USE_STM32f4_USBH_DRIVER_HS/FS from config.mk to usbh_config.h 2016-06-25 10:09:54 +02:00
COPYING.GPL3 libusbhost: Open source USB host stack for embedded devices 2015-04-01 16:22:05 +02:00
COPYING.LGPL3 libusbhost: Open source USB host stack for embedded devices 2015-04-01 16:22:05 +02:00
DEVICE_DRIVER_HOWTO libusbhost: Open source USB host stack for embedded devices 2015-04-01 16:22:05 +02:00
Doxyfile Add doxyfile 2016-07-09 00:22:22 +02:00
initRepo.sh libusbhost: Open source USB host stack for embedded devices 2015-04-01 16:22:05 +02:00
libopencm3_stm32f4.ld libusbhost: Open source USB host stack for embedded devices 2015-04-01 16:22:05 +02:00
Makefile Add doxyfile 2016-07-09 00:22:22 +02:00
README.md Add doxyfile 2016-07-09 00:22:22 +02:00

###General Information

This library is in an active development.
WARNING: None of its features are considered stable !

This library implement usb host driver allowing users use or write device drivers, which functionality is abstracted of low level implementation.

Main objectives are:

  • provide open-source(Lesser GPL3) usb host library for embedded devices
  • execution speed: This library doesn't use blocking sleep, making low overhead on runtime performance
  • uses static allocation for all its buffers, so no allocation and reallocation is affecting performance (possibility of memory fragmentation. execution time indeterminism), so no malloc(), realloc(), free().
  • written in C, with the support to use it with C++.
  • does not depend on any Operating System. Library libopencm3 is used for testing purposes and to get proper defines. So no runtime dependency is on this library.

Currently supported devices (yet tested) are:

  • stm32f407 (stm32f4 Discovery)

Native device drivers (mostly for demonstration purposes):

  • HUB
  • Gamepad - XBox compatible Controller
  • mouse (draft: only displays raw data)
  • USB MIDI devices (raw data + note on/off)

###Practical info

!!! Do not forget to invoke "make clean" before new build when defines change(TODO: remove this warning and fix the Makefile)

How to initialize repository

./initRepo.sh

fetch libopencm3 submodule and compile needed libraries

How to generate documentation

make doc

How to compile demo

Edit usbh_config.h to configure the library (By default Full speed OTG periphery on stm32f4 is supported)

./compileDemo.sh

compiles demo, that can be flashed into stm32f4 Discovery platform and debug by USART

How to upload firmware (FLASH) to stm32f4 Discovery

sudo make flash

How to view debug data

connect uart to USART6 pins on gpios: GPIOC6(TX - data), GPIOC7(RX - not used) configure uart baud on PC side to 921600 with 1 stop bit, no parity, 8bit data, no handshake

How to compile library only

make lib

libusbhost.a is built without usart debug support (check compileDemo.sh for hint on how to compile with debug)

###Contact Amir Hammad - amir.hammad@hotmail.com

Library is maintained there

http://github.com/libusbhost/libusbhost