summaryrefslogtreecommitdiff
path: root/ao-tools/lib/cc-usb.h
blob: e08a956b25868747861597bb185ee16c0b066841 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
/*
 * Copyright © 2009 Keith Packard <keithp@keithp.com>
 *
 * 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 <stdint.h>

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);

int
cc_usb_getchar_timeout(struct cc_usb *cc, int timeout);

int
cc_usb_getchar(struct cc_usb *cc);

void
cc_usb_getline(struct cc_usb *cc, char *line, int max);

void
cc_usb_printf(struct cc_usb *cc, char *format, ...);

int
cc_usb_write(struct cc_usb *cc, void *buf, int c);

void
cc_usb_open_remote(struct cc_usb *cc, int freq, char *call);

void
cc_usb_close_remote(struct cc_usb *cc);

#endif /* _CC_USB_H_ */