Changeset 9c0f158 in mainline for uspace/lib/usb/include


Ignore:
Timestamp:
2011-03-25T15:21:01Z (14 years ago)
Author:
Matej Klonfar <maklf@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
57d9c05e
Parents:
96bfe76 (diff), f08c560 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

development merge

Location:
uspace/lib/usb/include/usb
Files:
1 edited
2 moved

Legend:

Unmodified
Added
Removed
  • uspace/lib/usb/include/usb/classes/hidreport.h

    r96bfe76 r9c0f158  
    11/*
    2  * Copyright (c) 2010 Lubos Slovak
     2 * Copyright (c) 2011 Lubos Slovak
    33 * All rights reserved.
    44 *
     
    2727 */
    2828
    29 /** @addtogroup drvusbhid
     29/** @addtogroup libusb
    3030 * @{
    3131 */
    3232/** @file
    33  * Descriptor dumping.
     33 * USB HID report parser initialization from descriptors.
    3434 */
    3535
    36 #ifndef USBHID_DESCDUMP_H_
    37 #define USBHID_DESCDUMP_H_
     36#ifndef LIBUSB_HIDREPORT_H_
     37#define LIBUSB_HIDREPORT_H_
    3838
    39 #include <usb/descriptor.h>
    40 #include <usb/classes/hid.h>
     39#include <usb/devdrv.h>
     40#include <usb/classes/hidparser.h>
    4141
    42 void dump_standard_configuration_descriptor(
    43     int index, const usb_standard_configuration_descriptor_t *d);
     42/**
     43 * Retrieves the Report descriptor from the USB device and initializes the
     44 * report parser.
     45 *
     46 * \param dev USB device representing a HID device.
     47 * \param parser HID Report parser.
     48 *
     49 * \retval EOK if successful.
     50 * \retval EINVAL if one of the parameters is not given (is NULL).
     51 * \retval ENOENT if there are some descriptors missing.
     52 * \retval ENOMEM if an error with allocation occured.
     53 * \retval EINVAL if the Report descriptor's size does not match the size
     54 *         from the interface descriptor.
     55 * \return Other value inherited from function usb_pipe_start_session(),
     56 *         usb_pipe_end_session() or usb_request_get_descriptor().
     57 */
     58int usb_hid_process_report_descriptor(usb_device_t *dev,
     59    usb_hid_report_parser_t *parser);
    4460
    45 void dump_standard_interface_descriptor(
    46     const usb_standard_interface_descriptor_t *d);
    47 
    48 void dump_standard_endpoint_descriptor(
    49     const usb_standard_endpoint_descriptor_t *d);
    50 
    51 void dump_standard_hid_descriptor_header(
    52     const usb_standard_hid_descriptor_t *d);
    53 
    54 void dump_standard_hid_class_descriptor_info(
    55     const usb_standard_hid_class_descriptor_info_t *d);
    56 
    57 void dump_hid_class_descriptor(int index, uint8_t type,
    58     const uint8_t *d, size_t size);
    59 
    60 #endif /* USBHID_DESCDUMP_H_ */
     61#endif /* LIBUSB_HIDREPORT_H_ */
    6162
    6263/**
  • uspace/lib/usb/include/usb/classes/hidreq.h

    r96bfe76 r9c0f158  
    2727 */
    2828
    29 /** @addtogroup drvusbhid
     29/** @addtogroup libusb
    3030 * @{
    3131 */
     
    3434 */
    3535
    36 #ifndef USBHID_HIDREQ_H_
    37 #define USBHID_HIDREQ_H_
     36#ifndef USB_KBD_HIDREQ_H_
     37#define USB_KBD_HIDREQ_H_
    3838
    3939#include <stdint.h>
    4040
    4141#include <usb/classes/hid.h>
    42 
    43 #include "hiddev.h"
     42#include <usb/pipes.h>
    4443
    4544/*----------------------------------------------------------------------------*/
    4645
    47 int usbhid_req_set_report(usbhid_dev_t *hid_dev,
     46int usbhid_req_set_report(usb_pipe_t *ctrl_pipe, int iface_no,
    4847    usb_hid_report_type_t type, uint8_t *buffer, size_t buf_size);
    4948
    50 int usbhid_req_set_protocol(usbhid_dev_t *hid_dev, usb_hid_protocol_t protocol);
     49int usbhid_req_set_protocol(usb_pipe_t *ctrl_pipe, int iface_no,
     50    usb_hid_protocol_t protocol);
    5151
    52 int usbhid_req_set_idle(usbhid_dev_t *hid_dev, uint8_t duration);
     52int usbhid_req_set_idle(usb_pipe_t *ctrl_pipe, int iface_no, uint8_t duration);
    5353
    54 int usbhid_req_get_report(usbhid_dev_t *hid_dev, usb_hid_report_type_t type,
    55     uint8_t *buffer, size_t buf_size, size_t *actual_size);
     54int usbhid_req_get_report(usb_pipe_t *ctrl_pipe, int iface_no,
     55    usb_hid_report_type_t type, uint8_t *buffer, size_t buf_size,
     56    size_t *actual_size);
    5657
    57 int usbhid_req_get_protocol(usbhid_dev_t *hid_dev, usb_hid_protocol_t *protocol);
     58int usbhid_req_get_protocol(usb_pipe_t *ctrl_pipe, int iface_no,
     59    usb_hid_protocol_t *protocol);
    5860
    59 int usbhid_req_get_idle(usbhid_dev_t *hid_dev, uint8_t *duration);
     61int usbhid_req_get_idle(usb_pipe_t *ctrl_pipe, int iface_no, uint8_t *duration);
    6062
    6163/*----------------------------------------------------------------------------*/
    6264
    63 #endif /* USBHID_HIDREQ_H_ */
     65#endif /* USB_KBD_HIDREQ_H_ */
    6466
    6567/**
  • uspace/lib/usb/include/usb/request.h

    r96bfe76 r9c0f158  
    4141#include <usb/pipes.h>
    4242#include <usb/descriptor.h>
     43
     44/** USB device status - device is self powered (opposed to bus powered). */
     45#define USB_DEVICE_STATUS_SELF_POWERED ((uint16_t)(1 << 0))
     46
     47/** USB device status - remote wake-up signaling is enabled. */
     48#define USB_DEVICE_STATUS_REMOTE_WAKEUP ((uint16_t)(1 << 1))
     49
     50/** USB endpoint status - endpoint is halted (stalled). */
     51#define USB_ENDPOINT_STATUS_HALTED ((uint16_t)(1 << 0))
    4352
    4453/** Standard device request. */
Note: See TracChangeset for help on using the changeset viewer.