TM STM32F4xx Libraries  v1.0.0
Libraries for STM32F4xx devices from Tilen Majerle
TM_USB_HID_HOST

USB HID HOST library for STM32F4xx devices - http://stm32f4-discovery.com/2014/08/library-31-usb-hid-host-for-stm32f4xx-devices. More...

Modules

 TM_USB_HID_HOST_Macros
 Library defines.
 
 TM_USB_HID_HOST_Typedefs
 Library Typedefs.
 
 TM_USB_HID_HOST_Functions
 Library Functions.
 

Detailed Description

USB HID HOST library for STM32F4xx devices - http://stm32f4-discovery.com/2014/08/library-31-usb-hid-host-for-stm32f4xx-devices.

This library allows you to operate with USB keyboard and USB mouse devices

It works in USB FS or USB HS in FS mode.

By default, library works in USB FS mode (for STM32F4-Discovery board). If you want to use this on STM32F429-Discovery board, you have to activate USB HS in FS mode. Activate this with lines below in your defines.h file:

//Activate USB HS in FS mode
#define USE_USB_OTG_HS

Pinout (can not be changed)

USB         |STM32F4xx FS mode              |STM32F4xx HS in FS mode    |Notes
            |STM32F4-Discovery              |STM32F429-Discovery
Data +      PA12                            PB15                        Data+ for USB, standard and used pin
Data -      PA11                            PB14                        Data- for USB, standard and used pin
ID          PA10                            PB12                        ID pin, used on F4 and F429 discovery boards, not needed if you don't like it
VBUS        PA9                             PB13                        VBUS pin, used on F4 and F429 discovery board for activating USB chip.
                                                                        You have to use VBUS on discovery boards, but on nucleo, it's ok with only Data+ and Data- pins
Disable necessary pins

USB technically needs only Data+ and Data- pins. Also, ID pin can be used, but it is not needed.

Disable ID PIN

If you need pin for something else, where ID is located, you can disable this pin for USB. Add lines below in your defines.h file:

//Disable ID pin
#define USB_HID_HOST_DISABLE_ID

Disable VBUS PIN

VBUS pin is located on Discovery boards, to activate USB chip on board. If you are working with Discovery boards, then you need this pin, otherise USB will not work. But if you are working on other application (or Nucleo board), you only need Data+ and Data- pins. To disable VBUS pin, add lines below in your defines.h file:

//Disable VBUS pin
#define USB_HID_HOST_DISABLE_VBUS
Choose keyboard style

Default configuration for keyboard is AZERTY style. If you want to use QWERTY keyboard style, then add line below in defines.h to activate it.

//Enable QUERTY keyboard style
#define QWERTY_KEYBOARD
Changelog
 Version 1.0
  - First release
Dependencies
 - STM32F4xx
 - STM32F4xx RCC
 - STM32F4xx GPIO
 - defines.h
 - USB HID HOST stack