Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Custom HID and Sensor example for nRF5 SDK 15.x

Hi,

I had some troubles getting a custom HID device to work that has both input and output reports to Windows 10 host. Here is my working example template that might save some time for others attempting something similar.

https://github.com/tikonen/ble_app_hids_custom

This implements

  • Custom BLE HID device that has both an output and input report. Tested to work with Windows 10. I used Win32 API SetupDiEnumDeviceInterfaces+SetupDiGetDeviceInterfaceDetail to find the device path. Device path can be opened CreateFile. Reports can be read/received simply via WriteFile and ReadFile
  • Delayed I2C read from si7021 sensor (this sensor requires wait of 25ms before data is ready to read)
  • GPIO interrupt triggered reading from sensor

Thanks!

Related