Changeset d4da860 in mainline for uspace/lib/usb/include/usb/usb.h


Ignore:
Timestamp:
2017-10-27T00:20:51Z (6 years ago)
Author:
jzr <zarevucky.jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
0798689, 584121d
Parents:
37e8c4a
Message:

Break circular dependency between libdrv and libusb.

File:
1 edited

Legend:

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

    r37e8c4a rd4da860  
    3939#include <stdint.h>
    4040#include <types/common.h>
     41#include <usb_iface.h>
    4142
    4243/** Convert 16bit value from native (host) endianness to USB endianness. */
     
    5253#define uint32_usb2host(n) uint32_t_le2host((n))
    5354
    54 
    55 /** USB transfer type. */
    56 typedef enum {
    57         USB_TRANSFER_CONTROL = 0,
    58         USB_TRANSFER_ISOCHRONOUS = 1,
    59         USB_TRANSFER_BULK = 2,
    60         USB_TRANSFER_INTERRUPT = 3
    61 } usb_transfer_type_t;
    62 
    6355const char * usb_str_transfer_type(usb_transfer_type_t t);
    6456const char * usb_str_transfer_type_short(usb_transfer_type_t t);
    6557
    66 /** USB data transfer direction. */
    67 typedef enum {
    68         USB_DIRECTION_IN,
    69         USB_DIRECTION_OUT,
    70         USB_DIRECTION_BOTH
    71 } usb_direction_t;
    72 
    7358const char *usb_str_direction(usb_direction_t);
    74 
    75 /** USB speeds. */
    76 typedef enum {
    77         /** USB 1.1 low speed (1.5Mbits/s). */
    78         USB_SPEED_LOW,
    79         /** USB 1.1 full speed (12Mbits/s). */
    80         USB_SPEED_FULL,
    81         /** USB 2.0 high speed (480Mbits/s). */
    82         USB_SPEED_HIGH,
    83         /** Psuedo-speed serving as a boundary. */
    84         USB_SPEED_MAX
    85 } usb_speed_t;
    8659
    8760static inline bool usb_speed_is_11(const usb_speed_t s)
     
    10881} usb_request_recipient_t;
    10982
    110 /** USB address type.
    111  * Negative values could be used to indicate error.
    112  */
    113 typedef int16_t usb_address_t;
    114 
    11583/** Default USB address. */
    11684#define USB_ADDRESS_DEFAULT 0
     
    132100}
    133101
    134 /** USB endpoint number type.
    135  * Negative values could be used to indicate error.
    136  */
    137 typedef int16_t usb_endpoint_t;
    138 
    139102/** Default control endpoint */
    140103#define USB_ENDPOINT_DEFAULT_CONTROL 0
     
    155118            (ep < USB11_ENDPOINT_MAX);
    156119}
    157 
    158 
    159 /** USB complete address type.
    160  * Pair address + endpoint is identification of transaction recipient.
    161  */
    162 typedef union {
    163         struct {
    164                 usb_address_t address;
    165                 usb_endpoint_t endpoint;
    166         } __attribute__((packed));
    167         uint32_t packed;
    168 } usb_target_t;
    169120
    170121/** Check USB target for allowed values (address and endpoint).
Note: See TracChangeset for help on using the changeset viewer.