Changeset fd17ab5 in mainline for uspace/lib/usb/hcd.h


Ignore:
Timestamp:
2010-10-13T06:42:53Z (14 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
2c381250
Parents:
2b887bf7
Message:

libusb: base types in separate file

Base USB types (address, protocol type etc.) are now in separate file usb.h.

Also added HID protocol type enum to hid.h.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/usb/hcd.h

    r2b887bf7 rfd17ab5  
    3636#define LIBUSB_HCD_H_
    3737
     38#include "usb.h"
     39
    3840#include <ipc/ipc.h>
    3941#include <async.h>
     
    4143/** Maximum size of transaction payload. */
    4244#define USB_MAX_PAYLOAD_SIZE 1020
    43 
    44 /** USB transfer type. */
    45 typedef enum {
    46         USB_TRANSFER_CONTROL = 0,
    47         USB_TRANSFER_ISOCHRONOUS = 1,
    48         USB_TRANSFER_BULK = 2,
    49         USB_TRANSFER_INTERRUPT = 3
    50 } usb_transfer_type_t;
    51 
    52 const char * usb_str_transfer_type(usb_transfer_type_t t);
    53 
    54 /** USB data transfer direction. */
    55 typedef enum {
    56         USB_DIRECTION_IN,
    57         USB_DIRECTION_OUT
    58 } usb_direction_t;
    59 
    60 /** USB address type.
    61  * Negative values could be used to indicate error.
    62  */
    63 typedef int usb_address_t;
    64 
    65 /** USB endpoint number type.
    66  * Negative values could be used to indicate error.
    67  */
    68 typedef int usb_endpoint_t;
    69 
    70 /** USB complete address type.
    71  * Pair address + endpoint is identification of transaction recipient.
    72  */
    73 typedef struct {
    74         usb_address_t address;
    75         usb_endpoint_t endpoint;
    76 } usb_target_t;
    77 
    78 static inline int usb_target_same(usb_target_t a, usb_target_t b)
    79 {
    80         return (a.address == b.address)
    81             && (a.endpoint == b.endpoint);
    82 }
    8345
    8446/** Opaque handle of active USB transaction.
Note: See TracChangeset for help on using the changeset viewer.