SWRA715 December 2021 CC2642R , CC2652R
To facilitate development, an HID input union was created. The union, named hid_input, holds a keyboard structure and mouse structure. Through the use of the hid_input, an hid input can be easily packaged for transmission. The union definition is shown in Figure 4-2.
As shown in Figure 4-2, a variable of type hid_input contains all of the information necessary for the HID Device to communicate with the HID host the necessary input information. For the keyboard section of the union, the structure is able to send several key presses at a time, if desired. The keyboard section is also used to transmit consumer reports. The mouse section of the union sends relative position data, mouse button presses, and mouse wheel data. This structure can be easily modified to implement a different HID use-case.