How opiopan/simhid-g1000 works
SimHID G1000 is firmware for a physical flight-simulator control panel: its switches and encoders are scanned, represented as named controls, and exposed to a PC over USB virtual serial using SimHID protocol; fsmapper interprets that protocol and manages PFD/MFD switching. The sampled startup calls runApp, while source-index references show the application’s scanner and protocol modules. The USB CDC-to-application wiring is not shown in the excerpts, so that relationship is marked unverified rather than asserted as a confirmed call.
Main entry points: scanner.c Input scanner · appmain.h Application entry · hostprotocol.c SimHID protocol · usbd_cdc_if.c CDC application interface
Components 15
Firmware startup
- Board startup
firmware/Core/Src/main.c - Pin definitions
firmware/Core/Inc/main.h - Application entry
firmware/src/appmain.h
Physical controls
- Input scanner
firmware/src/scanner.c - Switch state
firmware/src/switch.c - Switch groups
firmware/src/switchgroup.c
Host protocol
- Command executor
firmware/src/command.c - SimHID protocol
firmware/src/hostprotocol.c
USB transport
- CDC application interface
firmware/USB_DEVICE/App/usbd_cdc_if.c - USB CDC class
firmware/Middlewares/ST/STM32_USB_Device_Library/Class/CDC/Src/usbd_cdc.c - USB device core
firmware/Middlewares/ST/STM32_USB_Device_Library/Core/Inc/usbd_core.h - USB board support
firmware/USB_DEVICE/Target/usbd_conf.c
Other components
- Panel operator
- Windows host
- fsmapper
Connections 13
- Panel operator → Input scanner: operates controls
- Board startup → Application entry: starts runApp
firmware/Core/Src/main.c - Application entry → Input scanner: includes scanner API
firmware/src/appmain.h - Application entry → SimHID protocol: includes protocol API
firmware/src/appmain.h - Input scanner → Switch state: uses switch state
firmware/src/scanner.c - Input scanner → Switch groups: uses switch groups
firmware/src/scanner.c - Command executor → Input scanner: queries scanner
firmware/src/command.c - Windows host → CDC application interface: serial connection
- CDC application interface → SimHID protocol: passes protocol data
- USB CDC class → USB device core: uses device core
firmware/Middlewares/ST/STM32_USB_Device_Library/Class/CDC/Src/usbd_cdc.c - USB board support → USB device core: dispatches USB events
firmware/USB_DEVICE/Target/usbd_conf.c - Windows host → fsmapper: runs host software
- fsmapper → SimHID protocol: interprets protocol