SAMV71 Xplained Ultra Software Package 1.3

host_hid.h File Reference

Management of the generic host HID features. More...

#include "compiler.h"
#include "hid.h"

Go to the source code of this file.

Data Structures

struct  host_hid_item_t
 HID report descriptor item. More...

Functions

Standard Requests Applied to HID

Status_t host_hid_get_descriptor (U8 descriptor_type, U8 descriptor_index, U8 s_interface)
 Gets a HID class descriptor.
Status_t host_hid_set_descriptor (U8 descriptor_type, U8 descriptor_index, U8 s_interface, U16 length)
 Sets a HID class descriptor.
HID-Specific Requests

Status_t host_hid_get_report (U8 report_type, U8 report_id, U8 s_interface)
 Gets a HID report.
Status_t host_hid_set_report (U8 report_type, U8 report_id, U8 s_interface, U16 length)
 Sets a HID report.
U8 host_hid_get_idle (U8 report_id, U8 s_interface)
 Reads the current idle rate for a particular Input report.
Status_t host_hid_set_idle (U8 duration_4_ms, U8 report_id, U8 s_interface)
 Silences a particular report on the Interrupt In pipe until a new event occurs or the specified amount of time passes.
U8 host_hid_get_protocol (U8 s_interface)
 Reads which protocol is currently active (either the boot protocol or the report protocol).
Status_t host_hid_set_protocol (U8 protocol, U8 s_interface)
 Switches between the boot protocol and the report protocol (or vice versa).
HID Report Descriptor Parsing Functions

Status_bool_t host_hid_get_item (host_hid_item_t *item)
 Gets the next HID report descriptor item.

Detailed Description

Management of the generic host HID features.

This file manages the generic host HID features.

Author:
Atmel Corporation: http://www.atmel.com
Support and FAQ: http://support.atmel.no/

Definition in file host_hid.h.


Function Documentation

Status_t host_hid_get_descriptor ( U8  descriptor_type,
U8  descriptor_index,
U8  s_interface 
)

Gets a HID class descriptor.

Parameters:
descriptor_type Type of the descriptor to get.
descriptor_index Index of the descriptor to get.
s_interface The supported interface number of which to get the descriptor.
Returns:
Status.

Definition at line 86 of file host_hid.c.

U8 host_hid_get_idle ( U8  report_id,
U8  s_interface 
)

Reads the current idle rate for a particular Input report.

Parameters:
report_id ID of the report of which to get the idle rate.
s_interface The supported interface number of which to get the idle rate.
Returns:
Idle duration with a 4-ms resolution, or HID_IDLE_DURATION_INDEFINITE.

Definition at line 171 of file host_hid.c.

Status_bool_t host_hid_get_item ( host_hid_item_t item  ) 

Gets the next HID report descriptor item.

Parameters:
item Pointer to the item structure to fill.
Returns:
Status.
Note:
host_hid_get_descriptor must have been called before this function for HID_DESCRIPTOR and HID_REPORT_DESCRIPTOR.

Definition at line 235 of file host_hid.c.

U8 host_hid_get_protocol ( U8  s_interface  ) 

Reads which protocol is currently active (either the boot protocol or the report protocol).

Parameters:
s_interface The supported interface number of which to get the protocol.
Returns:
Protocol: HID_BOOT_PROTOCOL or HID_REPORT_PROTOCOL.
Note:
This request is supported by devices in the Boot subclass.

Definition at line 199 of file host_hid.c.

Status_t host_hid_get_report ( U8  report_type,
U8  report_id,
U8  s_interface 
)

Gets a HID report.

Parameters:
report_type Type of the report to get.
report_id ID of the report to get.
s_interface The supported interface number of which to get the report.
Returns:
Status.

Definition at line 145 of file host_hid.c.

Status_t host_hid_set_descriptor ( U8  descriptor_type,
U8  descriptor_index,
U8  s_interface,
U16  length 
)

Sets a HID class descriptor.

Parameters:
descriptor_type Type of the descriptor to set.
descriptor_index Index of the descriptor to set.
s_interface The supported interface number of which to set the descriptor.
length Length of the descriptor to set.
Returns:
Status.

Definition at line 124 of file host_hid.c.

Status_t host_hid_set_idle ( U8  duration_4_ms,
U8  report_id,
U8  s_interface 
)

Silences a particular report on the Interrupt In pipe until a new event occurs or the specified amount of time passes.

Parameters:
duration_4_ms Idle duration with a 4-ms resolution, or HID_IDLE_DURATION_INDEFINITE.
report_id ID of the report of which to set the idle rate (can be HID_REPORT_ID_ALL).
s_interface The supported interface number of which to set the idle rate.
Returns:
Status.

Definition at line 186 of file host_hid.c.

Status_t host_hid_set_protocol ( U8  protocol,
U8  s_interface 
)

Switches between the boot protocol and the report protocol (or vice versa).

Parameters:
protocol Protocol: HID_BOOT_PROTOCOL or HID_REPORT_PROTOCOL.
s_interface The supported interface number of which to set the protocol.
Returns:
Status.
Note:
This request is supported by devices in the Boot subclass.
When initialized, all devices default to the report protocol. However, the host should not make any assumptions about the device's state and should set the desired protocol whenever initializing a device.

Definition at line 214 of file host_hid.c.

Status_t host_hid_set_report ( U8  report_type,
U8  report_id,
U8  s_interface,
U16  length 
)

Sets a HID report.

Parameters:
report_type Type of the report to set.
report_id ID of the report to set.
s_interface The supported interface number of which to set the report.
length Length of the report to set.
Returns:
Status.

Definition at line 158 of file host_hid.c.

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines