| 1 | /* |
| 2 | * JzBoot: an USB bootloader for JZ series of Ingenic(R) microprocessors. |
| 3 | * Copyright (C) 2010 Sergey Gridassov <grindars@gmail.com>, |
| 4 | * Peter Zotov <whitequark@whitequark.org> |
| 5 | * |
| 6 | * This program is free software: you can redistribute it and/or modify |
| 7 | * it under the terms of the GNU General Public License as published by |
| 8 | * the Free Software Foundation, either version 3 of the License, or |
| 9 | * (at your option) any later version. |
| 10 | * |
| 11 | * This program is distributed in the hope that it will be useful, |
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 14 | * GNU General Public License for more details. |
| 15 | * |
| 16 | * You should have received a copy of the GNU General Public License |
| 17 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 18 | */ |
| 19 | |
| 20 | #ifndef __USBDEV__H__ |
| 21 | #define __USBDEV__H__ |
| 22 | |
| 23 | #include <stdint.h> |
| 24 | |
| 25 | int usbdev_init(); |
| 26 | void usbdev_fini(); |
| 27 | |
| 28 | #define USBDEV_FROMDEV 0 |
| 29 | #define USBDEV_TODEV 1 |
| 30 | |
| 31 | int usbdev_enumerate(); |
| 32 | void *usbdev_open(void *dev); |
| 33 | void usbdev_close(void *hndl); |
| 34 | int usbdev_vendor(void *hndl, int direction, uint8_t req, uint16_t value, uint16_t index, void *data, uint16_t size); |
| 35 | int usbdev_sendbulk(void *hndl, void *data, int size); |
| 36 | int usbdev_recvbulk(void *hndl, void *data, int size); |
| 37 | |
| 38 | #endif |
| 39 | |