Disable Mouse and Keyboard endpoints

Hi!

This question has been asked before but I wonder with newer versions of the Arduino IDE if it's possible to disable Mouse and Keyboard endpoints altogether for Leonardo/Pro Micro?

Even if I don't include Mouse.h or Keyboard.h, the Arduino will have USB endpoints setup for both keyboard and mouse. This limits the endpoints available to only 2.

There are several examples available how to setup more than two endpoints but they don't work (they cause weird device conflicts). An example of this is the Joystick library, the multiple joysticks example in that library sets up four joysticks but only three are visible in Windows and only the first two works. https://github.com/MHeironimus/ArduinoJoystickLibrary/tree/master/Joystick/examples/MultipleJoystickTest

I have also tried other libraries and examples with the same effect, I can create a max of two endpoints.

Grateful for any insight!

Mice typically send movement in increments, an absolute position is generated only in the target GUI. In so far I don't understand "endpoints", in detail not with keyboards.

DrDiettrich:
Mice typically send movement in increments, an absolute position is generated only in the target GUI. In so far I don't understand "endpoints", in detail not with keyboards.

The Atmega32u4 has seven USB endpoints, three of those are used for CDC, so four are available for the user. The problem is that Keyboard and Mouse always steel two of the endpoints, leaving only two free endpoints to use.

Do you mean USB ports (conectors)?

DrDiettrich:
Do you mean USB ports (conectors)?

No, sorry, I mean endpoints, the Atmega has seven (six programmable endpoints), four are available for the user but since mouse and keyboard are always “activated”, only two endpoints remain. From the Atmega32u4 datasheet:

USB 2.0 Full-speed/Low Speed Device Module with Interrupt on Transfer Completion
– Complies fully with Universal Serial Bus Specification Rev 2.0
– Supports data transfer rates up to 12Mbit/s and 1.5Mbit/s
– Endpoint 0 for Control Transfers: up to 64-bytes
– Six Programmable Endpoints with IN or Out Directions and with Bulk, Interrupt or
Isochronous Transfers
– Configurable Endpoints size up to 256 bytes in double bank mode
– Fully independent 832 bytes USB DPRAM for endpoint memory allocation
– Suspend/Resume Interrupts
– CPU Reset possible on USB Bus Reset detection
– 48MHz from PLL for Full-speed Bus Operation
– USB Bus Connection/Disconnection on Microcontroller Request
– Crystal-less operation for Low Speed mode

Sorry, I don’t know anything about USB endpoints. I was misleaded by your topic title :frowning:

witchmaster:
No, sorry, I mean endpoints, the Atmega has seven (six programmable endpoints), four are available for the user but since mouse and keyboard are always “activated”, only two endpoints remain.

That would then be a consequence of the library you use rather than the ATmega. :astonished:

I see no reference whatsoever in the datasheet to keyboard or mouse emulation or HID. Find out how to properly configure the library or find a better library. :roll_eyes: