/
cdc_client.h
67 lines (45 loc) · 1.19 KB
/
cdc_client.h
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
/*
* Phoenix-RTOS
*
* cdc - USB Communication Device Class
*
* Copyright 2019-2021 Phoenix Systems
* Author: Hubert Buczynski, Gerard Swiderski
*
* This file is part of Phoenix-RTOS.
*
* %LICENSE%
*/
#ifndef _CDC_CLIENT_H_
#define _CDC_CLIENT_H_
#include <cdc.h>
enum {
/* CDC Endpoint Types */
CDC_ENDPT_CTRL,
CDC_ENDPT_IRQ,
/* CDC_ACM bulk endpoints are used as IN/OUT pipe communication */
CDC_ENDPT_BULK
};
enum {
/* CDC Event Types */
CDC_EV_DISCONNECT,
CDC_EV_CONNECT,
CDC_EV_RESET,
CDC_EV_INIT,
CDC_EV_LINECODING,
CDC_EV_CARRIER_ACTIVATE,
CDC_EV_CARRIER_DEACTIVATE,
};
/* Initialize CDC device, allocate usb_client resources */
int cdc_init(void (*cbEvent)(int _evType, void *_ctxUser), void *ctxUser);
/* Free CDC device, release usb_client resources */
void cdc_destroy(void);
/* Sends data on an given endpoint */
int cdc_send(int endpt, const void *data, unsigned int len);
/* Receives data on an given endpoint */
int cdc_recv(int endpt, void *data, unsigned int len);
/* Get current Line Coding information */
usb_cdc_line_coding_t cdc_getLineCoding(void);
/* Set Line Coding information */
void cdc_setLineCoding(usb_cdc_line_coding_t lineCoding);
#endif