Du kannst nicht mehr als 25 Themen auswählen Themen müssen mit entweder einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

UsbRaw.h 919B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /*
  2. * Based on Obdev's AVRUSB code and under the same license.
  3. * Modified by Robin Thoni <robin@rthoni.com>
  4. */
  5. #ifndef __UsbRaw_h__
  6. #define __UsbRaw_h__
  7. #include <avr/pgmspace.h>
  8. #include <avr/interrupt.h>
  9. #include <Arduino.h>
  10. #include "usbdrv.h"
  11. #define CALLBACK_ARGS usbRequest_t* rq, UsbRawDevice* dev, uchar* data, uchar len
  12. class UsbRawDevice {
  13. public:
  14. UsbRawDevice();
  15. void init();
  16. void poll();
  17. void setData(const uchar* data, uchar len);
  18. void setDataString(const char* data);
  19. usbMsgLen_t _usbFunctionSetup(usbRequest_t* rq);
  20. uchar _usbFunctionWrite(uchar *data, uchar len);
  21. void setCallback(void (*callback)(CALLBACK_ARGS));
  22. private:
  23. const uchar* _dataSend;
  24. uchar _dataSendLen;
  25. void (*_callback)(CALLBACK_ARGS);
  26. uchar* _dataReceived;
  27. uchar _dataReceivedLen;
  28. usbRequest_t* _rq;
  29. };
  30. extern UsbRawDevice UsbRaw;
  31. #endif // __UsbRaw_h__