X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=cctools%2Flib%2Fcc-usb.h;fp=cctools%2Flib%2Fcc-usb.h;h=d7acfbd2be1b70a1e59283b2af582e868c0db701;hb=208bc15714c7b4020c017eef19011c4eb9ab51e2;hp=0000000000000000000000000000000000000000;hpb=17d2432a8b9c15963cd3b821f025ad33972ef477;p=fw%2Faltos diff --git a/cctools/lib/cc-usb.h b/cctools/lib/cc-usb.h new file mode 100644 index 00000000..d7acfbd2 --- /dev/null +++ b/cctools/lib/cc-usb.h @@ -0,0 +1,59 @@ +/* + * Copyright © 2009 Keith Packard + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + */ + +#ifndef _CC_USB_H_ +#define _CC_USB_H_ + +#include + +struct cc_usb; + +struct cc_usb * +cc_usb_open(char *tty); + +void +cc_usb_close(struct cc_usb *cc); + +int +cc_usb_send_bytes(struct cc_usb *cc, uint8_t *bytes, int len); + +int +cc_usb_recv_bytes(struct cc_usb *cc, uint8_t *bytes, int len); + +int +cc_usb_write_memory(struct cc_usb *cc, uint16_t addr, uint8_t *bytes, int len); + +int +cc_usb_read_memory(struct cc_usb *cc, uint16_t addr, uint8_t *bytes, int len); + +int +cc_usb_debug_mode(struct cc_usb *cc); + +int +cc_usb_reset(struct cc_usb *cc); + +void +cc_usb_sync(struct cc_usb *cc); + +void +cc_queue_read(struct cc_usb *cc, uint8_t *buf, int len); + +void +cc_usb_printf(struct cc_usb *cc, char *format, ...); + +#endif /* _CC_USB_H_ */