Changeset e1dbcbc in mainline for uspace/drv/usbhid/mouse/mousedev.h


Ignore:
Timestamp:
2011-04-29T13:43:01Z (14 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
a81a1d09
Parents:
380e0364 (diff), f19f1b7 (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:

Merge development/ changes

File:
1 moved

Legend:

Unmodified
Added
Removed
  • uspace/drv/usbhid/mouse/mousedev.h

    r380e0364 re1dbcbc  
    11/*
    2  * Copyright (c) 2010 Vojtech Horky
     2 * Copyright (c) 2011 Lubos Slovak
    33 * All rights reserved.
    44 *
     
    2727 */
    2828
    29 /** @addtogroup libusbvirt
     29/** @addtogroup drvusbhid
    3030 * @{
    3131 */
    3232/** @file
    33  * @brief Debugging support.
     33 * USB Mouse driver API.
    3434 */
    35 #include <stdio.h>
    36 #include <bool.h>
    3735
    38 #include "private.h"
     36#ifndef USB_HID_MOUSEDEV_H_
     37#define USB_HID_MOUSEDEV_H_
    3938
     39#include <usb/devdrv.h>
    4040
    41 static void debug_print(int level, uint8_t tag,
    42     int current_level, uint8_t enabled_tags,
    43     const char *format, va_list args)
    44 {
    45         if (level > current_level) {
    46                 return;
    47         }
    48        
    49         if ((tag & enabled_tags) == 0) {
    50                 return;
    51         }
    52        
    53         bool print_prefix = true;
    54        
    55         if ((format[0] == '%') && (format[1] == 'M')) {
    56                 format += 2;
    57                 print_prefix = false;
    58         }
    59        
    60         if (print_prefix) {
    61                 printf("[vusb]: ");
    62                 while (--level > 0) {
    63                         printf(" ");
    64                 }
    65         }
    66        
    67         vprintf(format, args);
    68        
    69         if (print_prefix) {
    70                 printf("\n");
    71         }
    72 }
     41struct usb_hid_dev;
    7342
     43/*----------------------------------------------------------------------------*/
    7444
    75 void user_debug(usbvirt_device_t *device, int level, uint8_t tag,
    76     const char *format, ...)
    77 {
    78         va_list args;
    79         va_start(args, format);
    80        
    81         debug_print(level, tag,
    82             device->debug_level, device->debug_enabled_tags,
    83             format, args);
    84        
    85         va_end(args);
    86 }
     45/** Container for USB mouse device. */
     46typedef struct {
     47        ///** Polling interval in microseconds. */
     48        //suseconds_t poll_interval_us;
     49        /** IPC phone to console (consumer). */
     50        int console_phone;
     51} usb_mouse_t;
    8752
    88 void lib_debug(usbvirt_device_t *device, int level, uint8_t tag,
    89     const char *format, ...)
    90 {
    91         va_list args;
    92         va_start(args, format);
    93        
    94         debug_print(level, tag,
    95             device->lib_debug_level, device->lib_debug_enabled_tags,
    96             format, args);
    97        
    98         va_end(args);
    99 }
     53/*----------------------------------------------------------------------------*/
     54
     55usb_endpoint_description_t usb_hid_mouse_poll_endpoint_description;
     56
     57const char *HID_MOUSE_FUN_NAME;
     58const char *HID_MOUSE_CLASS_NAME;
     59
     60/*----------------------------------------------------------------------------*/
     61
     62int usb_mouse_init(struct usb_hid_dev *hid_dev);
     63
     64bool usb_mouse_polling_callback(struct usb_hid_dev *hid_dev, uint8_t *buffer,
     65    size_t buffer_size);
     66
     67void usb_mouse_deinit(struct usb_hid_dev *hid_dev);
     68
     69int usb_mouse_set_boot_protocol(struct usb_hid_dev *hid_dev);
     70
     71/*----------------------------------------------------------------------------*/
     72
     73#endif // USB_HID_MOUSEDEV_H_
    10074
    10175/**
Note: See TracChangeset for help on using the changeset viewer.