AnsweredAssumed Answered

stm32f072 joystick

Question asked by Afonso Marques on Mar 16, 2018
Latest reply on Mar 18, 2018 by Ben K

Hi,

Please forgive as I am new to STM32 devices and tools.

I was suggested to use a STM32 F0 Discovery dev kit (STM32F072RBT6) in order to develop a very simple application: a custom made 3 axles joystick (x,y and throttle).

I have installed STM32CubeMX, SystemWorkbench for STM32 (SW4STM32) and followed all the steps without any problem until the point of creating a Custom HID Class.

1. How do I compile just to check that everything is OK so far? (it should be after all everything was automated)

2. I found a joystick descriptor (please see below) which, I think, fits the purpose. How do I use, configure, insert, edit, etc the current one either on CubeMX or SW4?

3. Is there a demo somewhere that I can look at?

Thanks in advance.

-x-x-x-x-x-

Joystick descriptor:

USAGE_PAGE (Generic Desktop)    05 01
LOGICAL_MINIMUM (0)    15 00
USAGE (Joystick)    09 04
COLLECTION (Application)    A1 01
  USAGE_PAGE (Simulation Controls)    05 02
  USAGE (Throttle)    09 BB
  LOGICAL_MINIMUM (-127)    15 81
  LOGICAL_MAXIMUM (127)    25 7F
  REPORT_SIZE (8)    75 08
  REPORT_COUNT (1)    95 01
  INPUT (Data,Var,Abs)    81 02
  USAGE_PAGE (Generic Desktop)    05 01
  USAGE (Pointer)    09 01
  COLLECTION (Physical)    A1 00
    USAGE (X)    09 30
    USAGE (Y)    09 31
    REPORT_COUNT (2)    95 02
    INPUT (Data,Var,Abs)    81 02
  END_COLLECTION    C0
  USAGE (Hat switch)    09 39
  LOGICAL_MINIMUM (0)    15 00
  LOGICAL_MAXIMUM (3)    25 03
  PHYSICAL_MINIMUM (0)    35 00
  PHYSICAL_MAXIMUM (270)    46 0E 01
  UNIT (Eng Rot:Angular Pos)    65 14
  REPORT_SIZE (4)    75 04
  REPORT_COUNT (1)    95 01
  INPUT (Data,Var,Abs)    81 02
  USAGE_PAGE (Button)    05 09
  USAGE_MINIMUM (Button 1)    19 01
  USAGE_MAXIMUM (Button 4)    29 04
  LOGICAL_MINIMUM (0)    15 00
  LOGICAL_MAXIMUM (1)    25 01
  REPORT_SIZE (1)    75 01
  REPORT_COUNT (4)    95 04
  UNIT_EXPONENT (0)    55 00
  UNIT (None)    65 00
  INPUT (Data,Var,Abs)    81 02
END_COLLECTION    C0

joystick

stm32f072 discovery

!stm32f072 !usb !custom_hid

Outcomes