source: thomson/elec/CrO2/software/device.h@ 53c4be3

main
Last change on this file since 53c4be3 was 53c4be3, checked in by Adrien Destugues <pulkomandy@…>, 12 years ago
  • Support for ZX spectrup TAP files.

git-svn-id: svn://localhost/thomson@17 85ae3b6b-dc8f-4344-a89d-598714f2e4e5

  • Property mode set to 100644
File size: 929 bytes
Line 
1/* CrO2 datassette emulator
2 * Copyright 2012, Adrien Destugues <pulkomandy@pulkomandy.ath.cx>
3 *
4 * Distributed under the terms of the MIT licence.
5 *
6 * Handles device communication through libusb
7 */
8
9#include <stdint.h>
10#include <lusb0_usb.h>
11
12class Tape;
13
14class Device
15{
16 public:
17 static Device& getDevice() throw(const char*);
18
19 ~Device();
20
21 int read(uint8_t* buffer, size_t max); // Fill the buffer with data from device
22 int write(const uint8_t* buffer, size_t size, int blktype);
23 void write(const Tape& file) throw (const char*);
24 uint8_t getStatus();
25
26 private:
27 Device() throw(const char*); // Open device and set it up for communication
28 Device(const Device& other);
29
30
31 usb_dev_handle* handle;
32
33 static bool initOnce;
34 static Device* instance;
35
36 static const uint32_t vid;
37 static const uint32_t pid;
38 static const char* vendor;
39 static const char* product;
40};
Note: See TracBrowser for help on using the repository browser.