Open FFBoard
Open source force feedback firmware
cp210x.h
Go to the documentation of this file.
1
/*
2
* The MIT License (MIT)
3
*
4
* Copyright (c) 2023 Ha Thach (thach@tinyusb.org) for Adafruit Industries
5
*
6
* Permission is hereby granted, free of charge, to any person obtaining a copy
7
* of this software and associated documentation files (the "Software"), to deal
8
* in the Software without restriction, including without limitation the rights
9
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
* copies of the Software, and to permit persons to whom the Software is
11
* furnished to do so, subject to the following conditions:
12
*
13
* The above copyright notice and this permission notice shall be included in
14
* all copies or substantial portions of the Software.
15
*
16
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22
* THE SOFTWARE.
23
*/
24
25
#ifndef TUSB_CP210X_H
26
#define TUSB_CP210X_H
27
28
// Protocol details can be found at AN571: CP210x Virtual COM Port Interface
29
// https://www.silabs.com/documents/public/application-notes/AN571.pdf
30
31
#define TU_CP210X_VID 0x10C4
32
33
/* Config request codes */
34
#define CP210X_IFC_ENABLE 0x00
35
#define CP210X_SET_BAUDDIV 0x01
36
#define CP210X_GET_BAUDDIV 0x02
37
#define CP210X_SET_LINE_CTL 0x03
// Set parity, data bits, stop bits
38
#define CP210X_GET_LINE_CTL 0x04
39
#define CP210X_SET_BREAK 0x05
40
#define CP210X_IMM_CHAR 0x06
41
#define CP210X_SET_MHS 0x07
// Set DTR, RTS
42
#define CP210X_GET_MDMSTS 0x08
// Get modem status (DTR, RTS, CTS, DSR, RI, DCD)
43
#define CP210X_SET_XON 0x09
44
#define CP210X_SET_XOFF 0x0A
45
#define CP210X_SET_EVENTMASK 0x0B
46
#define CP210X_GET_EVENTMASK 0x0C
47
#define CP210X_SET_CHAR 0x0D
48
#define CP210X_GET_CHARS 0x0E
49
#define CP210X_GET_PROPS 0x0F
50
#define CP210X_GET_COMM_STATUS 0x10
51
#define CP210X_RESET 0x11
52
#define CP210X_PURGE 0x12
53
#define CP210X_SET_FLOW 0x13
54
#define CP210X_GET_FLOW 0x14
55
#define CP210X_EMBED_EVENTS 0x15
56
#define CP210X_GET_EVENTSTATE 0x16
57
#define CP210X_SET_CHARS 0x19
58
#define CP210X_GET_BAUDRATE 0x1D
59
#define CP210X_SET_BAUDRATE 0x1E
60
#define CP210X_VENDOR_SPECIFIC 0xFF
// GPIO, Recipient must be Device
61
62
#endif
//TUSB_CP210X_H
Firmware
FFBoard
USB
class
cdc
serial
cp210x.h
Generated by
1.9.2