Commit graph

158 commits

Author SHA1 Message Date
Amir Hammad
a75535e52b core: Simplify device removes
Signed-off-by: Amir Hammad <amir.hammad@hotmail.com>
2016-09-11 13:31:47 +02:00
Amir Hammad
1d08641a15 Added travis.yml
and badge

Signed-off-by: Amir Hammad <amir.hammad@hotmail.com>
2016-09-11 13:31:34 +02:00
Amir Hammad
3d68ea2807 make hid_mouse driver generic HID driver
+ keyboard support
+ SET_REPORT commands - usually leds on keyboards (WIP)

- missing parsing of HID report descriptor

Signed-off-by: Amir Hammad <amir.hammad@hotmail.com>
2016-09-11 13:30:13 +02:00
Amir Hammad
ed70a1efa3 Switch to cmake build system
* use tinyprintf
* ability to configure project via ccmake

Signed-off-by: Amir Hammad <amir.hammad@hotmail.com>
2016-09-11 13:30:10 +02:00
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
Amir Hammad
4aa69b4eaf make usbh_packet->data of union type
out: const void *
in: void *

Signed-off-by: Amir Hammad <amir.hammad@hotmail.com>
2016-09-08 07:54:06 +02:00
Amir Hammad
e0fbb799bd usbh_core refactor
Signed-off-by: Amir Hammad <amir.hammad@hotmail.com>
2016-09-08 07:54:06 +02:00
Amir Hammad
3493c1c087 fix bmRequestType field - use of defines
Signed-off-by: Amir Hammad <amir.hammad@hotmail.com>
2016-09-01 10:36:36 +02:00
Amir Hammad
5615b9c938 hub: fix commented out code and comments
Signed-off-by: Amir Hammad <amir.hammad@hotmail.com>
2016-08-30 03:55:24 +02:00
Amir Hammad
96dd22d047 core: make endpoint_type of enum USBH_ENDPOINT_TYPE
Signed-off-by: Amir Hammad <amir.hammad@hotmail.com>
2016-08-23 07:15:56 +02:00
Amir Hammad
049b67b492 remove not needed carriage returns in printf
Signed-off-by: Amir Hammad <amir.hammad@hotmail.com>
2016-08-23 07:15:51 +02:00
Amir Hammad
64969f1935 usbh_core: logs: DEVICE DESCRIPTOR EOL
Signed-off-by: Amir Hammad <amir.hammad@hotmail.com>
2016-07-30 14:12:23 +02:00
Amir Hammad
d535c93ade lld: stm32f4: fix logs
Signed-off-by: Amir Hammad <amir.hammad@hotmail.com>
2016-07-30 12:24:39 +02:00
Amir Hammad
3e95b389c3 add option to pass data to control writes
Signed-off-by: Amir Hammad <amir.hammad@hotmail.com>
2016-07-30 12:24:20 +02:00
Amir Hammad
0c1bd8ff76 Fix broken demo after rework
Signed-off-by: Amir Hammad <amir.hammad@hotmail.com>
2016-07-25 18:36:46 +02:00
Amir Hammad
ac7eae8866 Adjust documentation to fit doxygen
Signed-off-by: Amir Hammad <amir.hammad@hotmail.com>
2016-07-09 00:22:22 +02:00
Amir Hammad
90d7268876 Add doxyfile
Signed-off-by: Amir Hammad <amir.hammad@hotmail.com>
2016-07-09 00:22:22 +02:00
Amir Hammad
4f3a3905c9 rename usbh_hubbed.* to usbh_core.*
Signed-off-by: Amir Hammad <amir.hammad@hotmail.com>
2016-07-08 23:53:42 +02:00
Amir Hammad
dd950136aa lld: stm32f4: adjust reporting of the unahandled block of code
Signed-off-by: Amir Hammad <amir.hammad@hotmail.com>
2016-07-08 23:45:57 +02:00
Amir Hammad
1c8aa9d315 rename usbh_driver to usbh_low_level_driver
Signed-off-by: Amir Hammad <amir.hammad@hotmail.com>
2016-07-08 23:45:57 +02:00
Amir Hammad
2c0f82a4f0 documentation: add some basic documentation accross the headers
Signed-off-by: Amir Hammad <amir.hammad@hotmail.com>
2016-07-08 23:45:57 +02:00
Amir Hammad
e61ed66174 refactor: use enum instead of #define: USBH_ENDPOINT_TYPE and USBH_SPEED
Signed-off-by: Amir Hammad <amir.hammad@hotmail.com>
2016-07-08 23:22:53 +02:00
Amir Hammad
27fe98f2d6 Embed information about compilation with the debug functions into make output
Signed-off-by: Amir Hammad <amir.hammad@hotmail.com>
2016-06-25 10:09:55 +02:00
Amir Hammad
e59f23ad5c Don't compile usart_helpers.o when USART_DEBUG is not defined
Signed-off-by: Amir Hammad <amir.hammad@hotmail.com>
2016-06-25 10:09:55 +02:00
Amir Hammad
40192caee0 let the user build an array of lld drivers
Signed-off-by: Amir Hammad <amir.hammad@hotmail.com>
2016-06-25 10:09:54 +02:00
Amir Hammad
0432429aa6 move USE_STM32f4_USBH_DRIVER_HS/FS from config.mk to usbh_config.h
Leave the behaviour as before: Default: FullSpeed

Signed-off-by: Amir Hammad <amir.hammad@hotmail.com>
2016-06-25 10:09:54 +02:00
Amir Hammad
4bf0db8f7b add todo: clean-up makefiles
* organize files properly into directories
* avoid the need for make clean

Signed-off-by: Amir Hammad <amir.hammad@hotmail.com>
2016-06-20 22:42:15 +02:00
Amir Hammad
2963113e8e Merged usb midi code into current libusbmaster
+ merge fixes

Signed-off-by: Amir Hammad <amir.hammad@hotmail.com>
2016-06-20 22:34:32 +02:00
Amir Hammad
4cbbb39624 lld/stm32f4: Send correct amount of data
+ added logging output of data that is going to be sent.

Signed-off-by: Amir Hammad <amir.hammad@hotmail.com>
2015-08-26 08:00:40 +02:00
Amir Hammad
631a614c81 Device driver/gp_xbox:Use correct endpoint type:INTERRUPT
Signed-off-by: Amir Hammad <amir.hammad@hotmail.com>
2015-08-26 07:53:00 +02:00
Amir Hammad
4abcb07a75 lld/stm32f4: fix bug, setting wrong eptyp field
it was always 0 - control transfer...

Signed-off-by: Amir Hammad <amir.hammad@hotmail.com>
2015-08-26 07:46:00 +02:00
Amir Hammad
9f0651caf9 Make: Compile also *.cpp files
Signed-off-by: Amir Hammad <amir.hammad@hotmail.com>
2015-08-26 07:46:00 +02:00
Amir Hammad
b45e10a391 usbh_hubbed: set packet_size_max0 field also when DT_DEVICE returns OK
packet_size_max0 was set only if it was 8. It was not working for 16 or 32.

Signed-off-by: Amir Hammad <amir.hammad@hotmail.com>
2015-08-26 07:46:00 +02:00
Amir Hammad
eb80e43818 Device driver/mouse: use correct endpoint type: INTERRUPT
Signed-off-by: Amir Hammad <amir.hammad@hotmail.com>
2015-08-26 07:46:00 +02:00
Amir Hammad
1566e7012f hub: Empty packet readings after SET_ and CLEAR_ commands
* fixed typo/bug: "hub->state += 2" must have been
	"hub->state = 2" to issue empty read

Now, after each SET_ or CLEAR_ command, empty read is issued.

+ removed forward declaration of event() - cleaning

Signed-off-by: Amir Hammad <amir.hammad@hotmail.com>
2015-07-29 18:18:44 +02:00
Amir Hammad
09c861c975 gp_xbox: Do not allow unitialized driver to be loaded
Signed-off-by: Amir Hammad <amir.hammad@hotmail.com>
2015-07-13 16:18:03 +02:00
Amir Hammad
f8658f9411 mouse: Do not allow unitialized driver to be loaded
Signed-off-by: Amir Hammad <amir.hammad@hotmail.com>
2015-07-13 16:17:28 +02:00
Amir Hammad
3003006216 hub: Do not allow unitialized driver to be loaded
Signed-off-by: Amir Hammad <amir.hammad@hotmail.com>
2015-07-13 16:16:39 +02:00
Amir Hammad
33856ce17c Global logging: use \n for a new line instead \r\n in LOG_PRINTF
Signed-off-by: Amir Hammad <amir.hammad@hotmail.com>
2015-07-13 14:54:15 +02:00
Amir Hammad
54f3b37a71 usbh_hubbed: When in unknown state, print Error
Signed-off-by: Amir Hammad <amir.hammad@hotmail.com>
2015-07-13 14:54:11 +02:00
Amir Hammad
0c04dcd6ef usbh_hubbed: cleaning newlines after break; in switch
Signed-off-by: Amir Hammad <amir.hammad@hotmail.com>
2015-07-13 14:54:09 +02:00
Amir Hammad
99f24e9389 hub: Fix forgotten break
Signed-off-by: Amir Hammad <amir.hammad@hotmail.com>
2015-07-13 14:53:56 +02:00
Amir Hammad
4b23cb4850 demo: timer: BUGFIX: TIM6 prescaler
TIM6 has clock running at 84MHz instead of 168MHz,
so set the prescaler accordingly.

Signed-off-by: Amir Hammad <amir.hammad@hotmail.com>
2015-04-15 20:26:09 +02:00
Amir Hammad
187d01e3b2 Device drivers: Refactor: Remove prefixes of static functions and variables
Signed-off-by: Amir Hammad <amir.hammad@hotmail.com>
2015-04-08 08:08:55 +02:00
Amir Hammad
6625cda9f3 Device drivers: Refactor: Move driver declaration to the end of file
forward declarations are not needed

Signed-off-by: Amir Hammad <amir.hammad@hotmail.com>
2015-04-08 08:08:48 +02:00
Amir Hammad
ba197f8007 lld: stm32f4: refactor: Remove prefixes of static functions and variables
Signed-off-by: Amir Hammad <amir.hammad@hotmail.com>
2015-04-08 08:08:34 +02:00
Amir Hammad
7503fd901a lld: stm32f4: Move driver definitions to the end of file
This way, we don't need forward declarations

Signed-off-by: Amir Hammad <amir.hammad@hotmail.com>
2015-04-08 08:08:09 +02:00
Amir Hammad
5622fb0fda usbh_hubbed: device_register: Don't check for USB_DT_DEVICE twice
Signed-off-by: Amir Hammad <amir.hammad@hotmail.com>
2015-04-07 19:17:54 +02:00
Amir Hammad
0827b6982b LLD: stm32f4: change type of i to signed integer
this was causing infinite loop, when size of the
data was not multiple of 4.

Signed-off-by: Amir Hammad <amir.hammad@hotmail.com>
2015-04-06 19:53:03 +02:00
Amir Hammad
f86aacc59c Refactor device drivers: don't use automatic casts
Signed-off-by: Amir Hammad <amir.hammad@hotmail.com>
2015-04-06 19:52:48 +02:00