summaryrefslogtreecommitdiff
path: root/utils/hwstub/include/hwstub.h
diff options
context:
space:
mode:
Diffstat (limited to 'utils/hwstub/include/hwstub.h')
-rw-r--r--utils/hwstub/include/hwstub.h70
1 files changed, 0 insertions, 70 deletions
diff --git a/utils/hwstub/include/hwstub.h b/utils/hwstub/include/hwstub.h
deleted file mode 100644
index 4d12de8eda..0000000000
--- a/utils/hwstub/include/hwstub.h
+++ /dev/null
@@ -1,70 +0,0 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2012 by Amaury Pouly
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
16 *
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
19 *
20 ****************************************************************************/
21#ifndef __HWSTUB__
22#define __HWSTUB__
23
24#include <libusb.h>
25#include "hwstub_protocol.h"
26
27#ifdef __cplusplus
28extern "C" {
29#endif
30
31/**
32 *
33 * Low-Level interface
34 *
35 */
36
37struct hwstub_device_t;
38
39/* Returns hwstub interface, or -1 if none was found */
40int hwstub_probe(libusb_device *dev);
41/* Helper function which returns a list of all hwstub devices found. The caller
42 * must unref all of them when done, possibly using libusb_free_device_list().
43 * Return number of devices or <0 on error */
44ssize_t hwstub_get_device_list(libusb_context *ctx, libusb_device ***list);
45/* Returns NULL on error */
46struct hwstub_device_t *hwstub_open(libusb_device_handle *handle);
47/* Returns 0 on success. Does *NOT* close the usb handle */
48int hwstub_release(struct hwstub_device_t *dev);
49
50/* Returns number of bytes filled */
51int hwstub_get_desc(struct hwstub_device_t *dev, uint16_t desc, void *info, size_t sz);
52/* Returns number of bytes filled */
53int hwstub_get_log(struct hwstub_device_t *dev, void *buf, size_t sz);
54/* Returns number of bytes written/read or <0 on error */
55int hwstub_read(struct hwstub_device_t *dev, uint32_t addr, void *buf, size_t sz);
56int hwstub_read_atomic(struct hwstub_device_t *dev, uint32_t addr, void *buf, size_t sz);
57int hwstub_write(struct hwstub_device_t *dev, uint32_t addr, const void *buf, size_t sz);
58int hwstub_write_atomic(struct hwstub_device_t *dev, uint32_t addr, const void *buf, size_t sz);
59int hwstub_rw_mem(struct hwstub_device_t *dev, int read, uint32_t addr, void *buf, size_t sz);
60int hwstub_rw_mem_atomic(struct hwstub_device_t *dev, int read, uint32_t addr, void *buf, size_t sz);
61/* Returns <0 on error */
62int hwstub_exec(struct hwstub_device_t *dev, uint32_t addr, uint16_t flags);
63int hwstub_call(struct hwstub_device_t *dev, uint32_t addr);
64int hwstub_jump(struct hwstub_device_t *dev, uint32_t addr);
65
66#ifdef __cplusplus
67} // extern "C"
68#endif
69
70#endif /* __HWSTUB__ */ \ No newline at end of file