CDCRequests.h
Go to the documentation of this file.
1 /* ---------------------------------------------------------------------------- */
2 /* Atmel Microcontroller Software Support */
3 /* SAM Software Package License */
4 /* ---------------------------------------------------------------------------- */
5 /* Copyright (c) 2015, Atmel Corporation */
6 /* */
7 /* All rights reserved. */
8 /* */
9 /* Redistribution and use in source and binary forms, with or without */
10 /* modification, are permitted provided that the following condition is met: */
11 /* */
12 /* - Redistributions of source code must retain the above copyright notice, */
13 /* this list of conditions and the disclaimer below. */
14 /* */
15 /* Atmel's name may not be used to endorse or promote products derived from */
16 /* this software without specific prior written permission. */
17 /* */
18 /* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */
19 /* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */
20 /* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */
21 /* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, */
22 /* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */
23 /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */
24 /* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF */
25 /* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */
26 /* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */
27 /* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
28 /* ---------------------------------------------------------------------------- */
29 
45 #ifndef _CDCREQUESTS_H_
46 #define _CDCREQUESTS_H_
47 
51 /*----------------------------------------------------------------------------
52  * Includes
53  *----------------------------------------------------------------------------*/
54 
55 #include <stdint.h>
56 #include <USBRequests.h>
57 
58 /*----------------------------------------------------------------------------
59  * Definitions
60  *----------------------------------------------------------------------------*/
61 
71 #define CDCGenericRequest_SETLINECODING 0x20
72 
73 #define CDCGenericRequest_GETLINECODING 0x21
74 
75 #define CDCGenericRequest_SETCONTROLLINESTATE 0x22
76 
85 #define CDCControlLineState_DTE_PRESENT (1 << 0)
86 
87 #define CDCControlLineState_DTR (1 << 0)
88 
89 #define CDCControlLineState_CARRIER_ON (1 << 1)
90 
91 #define CDCControlLineState_RTS (1 << 1)
92 
102 #define CDCLineCoding_ONESTOPBIT 0
103 
104 #define CDCLineCoding_ONE5STOPBIT 1
105 
106 #define CDCLineCoding_TWOSTOPBITS 2
107 
119 #define CDCLineCoding_NOPARITY 0
120 
121 #define CDCLineCoding_ODDPARITY 1
122 
123 #define CDCLineCoding_EVENPARITY 2
124 
125 #define CDCLineCoding_MARKPARITY 3
126 
127 #define CDCLineCoding_SPACEPARITY 4
128 
130 /*----------------------------------------------------------------------------
131  * Types
132  *----------------------------------------------------------------------------*/
133 #pragma pack(1)
134 #if defined ( __CC_ARM ) /* Keil ¦̀Vision 4 */
135 #elif defined ( __ICCARM__ ) /* IAR Ewarm */
136 #define __attribute__(...)
137 #define __packed__ packed
138 #elif defined ( __GNUC__ ) /* GCC CS3 */
139 #define __packed__ aligned(1)
140 #endif
141 
146 typedef struct _CDCLineCoding {
147 
149  uint32_t dwDTERate;
152  uint8_t bCharFormat;
155  uint8_t bParityType;
157  uint8_t bDataBits;
158 
159 } __attribute__ ((__packed__)) CDCLineCoding; /* GCC */
160 
161 #pragma pack()
162 
163 /*----------------------------------------------------------------------------
164  * Functions
165  *----------------------------------------------------------------------------*/
166 
168  const USBGenericRequest *request);
169 
171  const USBGenericRequest *request);
172 
173 extern void CDCLineCoding_Initialize(CDCLineCoding *lineCoding,
174  uint32_t bitrate,
175  uint8_t stopbits,
176  uint8_t parity,
177  uint8_t databits);
178 
179 
181 #endif /* #define _CDCREQUESTS_H_ */
182 
void CDCLineCoding_Initialize(CDCLineCoding *lineCoding, uint32_t bitrate, uint8_t stopbits, uint8_t parity, uint8_t databits)
Definition: CDCLineCoding.c:58
uint8_t CDCSetControlLineStateRequest_ActivateCarrier(const USBGenericRequest *request)
uint32_t dwDTERate
Definition: CDCRequests.h:149
uint8_t bDataBits
Definition: CDCRequests.h:157
uint8_t bParityType
Definition: CDCRequests.h:155
static CDCLineCoding lineCoding
typedef __attribute__
USB Device LPM Descriptor structure.
Definition: d_usartDMA.c:1064
uint8_t CDCSetControlLineStateRequest_IsDtePresent(const USBGenericRequest *request)
uint8_t bCharFormat
Definition: CDCRequests.h:152


inertial_sense_ros
Author(s):
autogenerated on Sun Feb 28 2021 03:17:57