SAMV71 Xplained Ultra Software Package 1.5

Collaboration diagram for Usbd_hid_key:

Data Structures

struct  KBDInputReport
struct  KBDOutputReport
struct  HIDDKeyboard
struct  _HIDDKeyboardOutputReport
struct  _HIDDKeyboardInputReport
struct  _HIDDKeyboardDriverConfigurationDescriptors

Modules

 HID Device Descriptor IDs
 HIDD Keyboard Driver Definitions

Functions

 COMPILER_ALIGNED (32)
void HIDDKeyboard_Initialize (USBDDriver *pUsbd, uint8_t bInterfaceNb)
void HIDDKeyboard_ConfigureFunction (USBGenericDescriptor *pDescriptors, uint16_t wLength)
uint32_t HIDDKeyboard_RequestHandler (const USBGenericRequest *request)
uint32_t HIDDKeyboard_ChangeKeys (uint8_t *pressedKeys, uint8_t pressedKeysSize, uint8_t *releasedKeys, uint8_t releasedKeysSize)
void HIDDKeyboard_RemoteWakeUp (void)
WEAK void HIDDKeyboardCallbacks_LedsChanged (uint8_t numLockStatus, uint8_t capsLockStatus, uint8_t scrollLockStatus)
void HIDDKeyboardDriver_Initialize (const USBDDriverDescriptors *pDescriptors)
void HIDDKeyboardDriver_ConfigurationChangedHandler (uint8_t cfgnum)
void HIDDKeyboardDriver_RequestHandler (const USBGenericRequest *request)
void HIDDKeyboardInputReport_Initialize (HIDDKeyboardInputReport *report)
void HIDDKeyboardInputReport_PressStandardKey (HIDDKeyboardInputReport *report, uint8_t key)
void HIDDKeyboardInputReport_ReleaseStandardKey (HIDDKeyboardInputReport *report, uint8_t key)
void HIDDKeyboardInputReport_PressModifierKey (HIDDKeyboardInputReport *report, uint8_t key)
void HIDDKeyboardInputReport_ReleaseModifierKey (HIDDKeyboardInputReport *report, uint8_t key)
void HIDDKeyboardOutputReport_Initialize (HIDDKeyboardOutputReport *report)
unsigned char HIDDKeyboardOutputReport_GetNumLockStatus (const HIDDKeyboardOutputReport *report)
unsigned char HIDDKeyboardOutputReport_GetCapsLockStatus (const HIDDKeyboardOutputReport *report)
unsigned char HIDDKeyboardOutputReport_GetScrollLockStatus (const HIDDKeyboardOutputReport *report)
struct _HIDDKeyboardOutputReport __attribute__ ((__packed__)) HIDDKeyboardOutputReport

Variables

USBDDriverDescriptors hiddKeyboardDriverDescriptors
const USBDeviceDescriptor usbDeviceDescriptor
struct
UsbVideoCamConfigurationDescriptors 
configurationDescriptorsFS
struct
UsbVideoCamConfigurationDescriptors 
configurationDescriptorsHS
const USBDDriverDescriptors usbdDriverDescriptors
const USBDeviceDescriptor usbDeviceDescriptor
struct
UsbVideoCamConfigurationDescriptors 
configurationDescriptorsFS
struct
UsbVideoCamConfigurationDescriptors 
configurationDescriptorsHS
const USBDDriverDescriptors usbdDriverDescriptors

Detailed Description

Implement HID Keyboard Function For USB Device.

Implement a USB device that only have HID Keyboard Function.


Function Documentation

COMPILER_ALIGNED ( 32   ) 

HIDD Keyboard Input Report Instance Report descriptor used by the driver.

Definition at line 125 of file HIDDKeyboard.c.

uint32_t HIDDKeyboard_ChangeKeys ( uint8_t *  pressedKeys,
uint8_t  pressedKeysSize,
uint8_t *  releasedKeys,
uint8_t  releasedKeysSize 
)

Reports a change in which keys are currently pressed or release to the host.

Parameters:
pressedKeys Pointer to an array of key codes indicating keys that have been pressed since the last call to HIDDKeyboardDriver_ChangeKeys().
pressedKeysSize Number of key codes in the pressedKeys array.
releasedKeys Pointer to an array of key codes indicates keys that have been released since the last call to HIDDKeyboardDriver_ChangeKeys().
releasedKeysSize Number of key codes in the releasedKeys array.
Returns:
USBD_STATUS_SUCCESS if the report has been sent to the host; otherwise an error code.
void HIDDKeyboard_ConfigureFunction ( USBGenericDescriptor *  pDescriptors,
uint16_t  wLength 
)

Configure function with expected descriptors and start functionality. Usually invoked when device is configured. Pointer to the descriptors for function configure. Length of descriptors in number of bytes.

void HIDDKeyboard_Initialize ( USBDDriver pUsbd,
uint8_t  bInterfaceNb 
)

Initializes the HID keyboard device driver SW. (Init USBDDriver .., Init function driver .., Init USBD ...)

Parameters:
pUsbd Pointer to USBDDriver instance.
bInterfaceNb Interface number for the function.
void HIDDKeyboard_RemoteWakeUp ( void   ) 

Starts a remote wake-up sequence if the host has explicitely enabled it by sending the appropriate SET_FEATURE request.

uint32_t HIDDKeyboard_RequestHandler ( const USBGenericRequest request  ) 

Handles HID-specific SETUP request sent by the host.

Parameters:
request Pointer to a USBGenericRequest instance.
Returns:
USBRC_SUCCESS if request is handled.
WEAK void HIDDKeyboardCallbacks_LedsChanged ( uint8_t  numLockStatus,
uint8_t  capsLockStatus,
uint8_t  scrollLockStatus 
)

For HID Keyboard Function. Indicates that the status of one or more LEDs has been changed by the host.

Parameters:
numLockStatus Indicates the current status of the num. lock key.
capsLockStatus Indicates the current status of the caps lock key.
scrollLockStatus Indicates the current status of the scroll lock key.
void HIDDKeyboardDriver_ConfigurationChangedHandler ( uint8_t  cfgnum  ) 

Handles configureation changed event.

Parameters:
cfgnum New configuration number
void HIDDKeyboardDriver_Initialize ( const USBDDriverDescriptors pDescriptors  ) 

Initializes the HID keyboard device driver.

void HIDDKeyboardDriver_RequestHandler ( const USBGenericRequest request  ) 

Handles HID-specific SETUP request sent by the host.

Parameters:
request Pointer to a USBGenericRequest instance.
void HIDDKeyboardInputReport_Initialize ( HIDDKeyboardInputReport *  report  ) 

Initializes a keyboard input report instance.

Parameters:
report Pointer to a HIDDKeyboardInputReport instance.
void HIDDKeyboardInputReport_PressModifierKey ( HIDDKeyboardInputReport *  report,
uint8_t  key 
)

Reports a modifier key as being currently pressed.

Parameters:
report Pointer to a HIDDKeyboardInputReport instance.
key Key code of the modifier key.
void HIDDKeyboardInputReport_PressStandardKey ( HIDDKeyboardInputReport *  report,
uint8_t  key 
)

Reports a standard key as being pressed.

Parameters:
report Pointer to a HIDDKeyboardInputReport instance.
key Key code of the standard key.
void HIDDKeyboardInputReport_ReleaseModifierKey ( HIDDKeyboardInputReport *  report,
uint8_t  key 
)

Reports a modifier key as not being pressed anymore.

Parameters:
report Pointer to a HIDDKeyboardInputReport instance.
key Key code of the modifier key.
void HIDDKeyboardInputReport_ReleaseStandardKey ( HIDDKeyboardInputReport *  report,
uint8_t  key 
)

Reports a standard key as not being pressed anymore.

Parameters:
report Pointer to a HIDDKeyboardInputReport instance.
key Key code of the standard key
uint8_t HIDDKeyboardOutputReport_GetCapsLockStatus ( const HIDDKeyboardOutputReport *  report  ) 

Indicates the current status of the caps lock LED according to the given report.

Parameters:
report Pointer to a HIDDKeyboardOutputReport instance.
Returns:
1 if the caps lock LED is light on; otherwise 0.
uint8_t HIDDKeyboardOutputReport_GetNumLockStatus ( const HIDDKeyboardOutputReport *  report  ) 

Indicates the current status of the num. lock LED according to the given report.

Parameters:
report Pointer to a HIDDKeyboardOutputReport instance.
Returns:
1 if the num. lock LED is light on; otherwise 0.
uint8_t HIDDKeyboardOutputReport_GetScrollLockStatus ( const HIDDKeyboardOutputReport *  report  ) 

Indicates the current status of the scroll lock LED according to the given report.

Parameters:
report Pointer to a HIDDKeyboardOutputReport instance.
Returns:
1 if the scroll lock LED is light on; otherwise 0.
void HIDDKeyboardOutputReport_Initialize ( HIDDKeyboardOutputReport *  report  ) 

Initializes a keyboard output report.

Parameters:
report Pointer to a HIDDKeyboardOutputReport instance.

Variable Documentation

Configuration descriptors.

Definition at line 89 of file USBDDriverDescriptors.c.

Configuration descriptors.

Definition at line 89 of file USBDDriverDescriptors.c.

Configuration descriptors.

Definition at line 302 of file USBDDriverDescriptors.c.

Configuration descriptors.

Definition at line 302 of file USBDDriverDescriptors.c.

Initial value:
 {

    &deviceDescriptor,
    (USBConfigurationDescriptor *) &configurationDescriptors,
    &qualifierDescriptor,
    0, 
    0, 
    0, 
    &qualifierDescriptor,
    0, 
    stringDescriptors,
    4 
}

List of descriptors used by the HID keyboard driver.

Definition at line 256 of file USBDDriverDescriptors.c.

Initial value:
 {
    &usbDeviceDescriptor,
    (const USBConfigurationDescriptor *) &configurationDescriptorsFS,
    &qualifierDescriptor,
    0, 
    0, 
    (const USBConfigurationDescriptor *) &configurationDescriptorsHS,
    &qualifierDescriptor,
    0, 
    0, 
    0  
}

List of descriptors used by the device.

Definition at line 517 of file USBDDriverDescriptors.c.

Initial value:
 {
    &usbDeviceDescriptor,
    (const USBConfigurationDescriptor *) &configurationDescriptorsFS,
    &qualifierDescriptor,
    0, 
    0, 
    (const USBConfigurationDescriptor *) &configurationDescriptorsHS,
    &qualifierDescriptor,
    0, 
    0, 
    0  
}

List of descriptors used by the device.

Definition at line 517 of file USBDDriverDescriptors.c.

const USBDeviceDescriptor usbDeviceDescriptor
Initial value:
 {
    sizeof(USBDeviceDescriptor),
    USBGenericDescriptor_DEVICE,
    USBDeviceDescriptor_USB2_00,
    VIDDeviceDescriptor_CLASS,
    VIDDeviceDescriptor_SUBCLASS,
    VIDDeviceDescriptor_PROTOCOL,
    CHIP_USB_ENDPOINTS_MAXPACKETSIZE(0),
    USBD_VID_ATMEL, 
    USBD_PID_UVC, 
    USBD_RELEASE_0_01, 
    0, 
    0, 
    0, 
    1 
}

USB Device descriptor.

Definition at line 55 of file USBDDriverDescriptors.c.

const USBDeviceDescriptor usbDeviceDescriptor
Initial value:
 {
    sizeof(USBDeviceDescriptor),
    USBGenericDescriptor_DEVICE,
    USBDeviceDescriptor_USB2_00,
    VIDDeviceDescriptor_CLASS,
    VIDDeviceDescriptor_SUBCLASS,
    VIDDeviceDescriptor_PROTOCOL,
    CHIP_USB_ENDPOINTS_MAXPACKETSIZE(0),
    USBD_VID_ATMEL, 
    USBD_PID_UVC, 
    USBD_RELEASE_0_01, 
    0, 
    0, 
    0, 
    1 
}

USB Device descriptor.

Definition at line 55 of file USBDDriverDescriptors.c.

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines