comm.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /*
  2. * Linux driver for TerraTec DMX 6Fire USB
  3. *
  4. * Author: Torsten Schenk <torsten.schenk@zoho.com>
  5. * Created: Jan 01, 2011
  6. * Version: 0.3.0
  7. * Copyright: (C) Torsten Schenk
  8. *
  9. * This program is free software; you can redistribute it and/or modify
  10. * it under the terms of the GNU General Public License as published by
  11. * the Free Software Foundation; either version 2 of the License, or
  12. * (at your option) any later version.
  13. */
  14. #ifndef USB6FIRE_COMM_H
  15. #define USB6FIRE_COMM_H
  16. #include "common.h"
  17. enum /* settings for comm */
  18. {
  19. COMM_RECEIVER_BUFSIZE = 64,
  20. };
  21. struct comm_runtime {
  22. struct sfire_chip *chip;
  23. struct urb receiver;
  24. u8 receiver_buffer[COMM_RECEIVER_BUFSIZE];
  25. u8 serial; /* urb serial */
  26. void (*init_urb)(struct comm_runtime *rt, struct urb *urb, u8 *buffer,
  27. void *context, void(*handler)(struct urb *urb));
  28. /* writes control data to the device */
  29. int (*write8)(struct comm_runtime *rt, u8 request, u8 reg, u8 value);
  30. int (*write16)(struct comm_runtime *rt, u8 request, u8 reg,
  31. u8 vh, u8 vl);
  32. };
  33. int __devinit usb6fire_comm_init(struct sfire_chip *chip);
  34. void usb6fire_comm_abort(struct sfire_chip *chip);
  35. void usb6fire_comm_destroy(struct sfire_chip *chip);
  36. #endif /* USB6FIRE_COMM_H */