]> begriffs open source - freertos/blob - FreeRTOS-Plus/Source/FreeRTOS-Plus-Trace/streamports/USB_CDC/include/trcStreamingPort.h
Update trace recorder code to the latest.
[freertos] / FreeRTOS-Plus / Source / FreeRTOS-Plus-Trace / streamports / USB_CDC / include / trcStreamingPort.h
1 /*******************************************************************************\r
2  * Trace Recorder Library for Tracealyzer v4.1.5\r
3  * Percepio AB, www.percepio.com\r
4  *\r
5  * trcStreamingPort.h\r
6  *\r
7  * The interface definitions for trace streaming ("stream ports").\r
8  * This "stream port" sets up the recorder to use USB CDC as streaming channel.\r
9  * The example is for STM32 using STM32Cube.\r
10  *\r
11  * Terms of Use\r
12  * This file is part of the trace recorder library (RECORDER), which is the \r
13  * intellectual property of Percepio AB (PERCEPIO) and provided under a\r
14  * license as follows.\r
15  * The RECORDER may be used free of charge for the purpose of recording data\r
16  * intended for analysis in PERCEPIO products. It may not be used or modified\r
17  * for other purposes without explicit permission from PERCEPIO.\r
18  * You may distribute the RECORDER in its original source code form, assuming\r
19  * this text (terms of use, disclaimer, copyright notice) is unchanged. You are\r
20  * allowed to distribute the RECORDER with minor modifications intended for\r
21  * configuration or porting of the RECORDER, e.g., to allow using it on a \r
22  * specific processor, processor family or with a specific communication\r
23  * interface. Any such modifications should be documented directly below\r
24  * this comment block.  \r
25  *\r
26  * Disclaimer\r
27  * The RECORDER is being delivered to you AS IS and PERCEPIO makes no warranty\r
28  * as to its use or performance. PERCEPIO does not and cannot warrant the \r
29  * performance or results you may obtain by using the RECORDER or documentation.\r
30  * PERCEPIO make no warranties, express or implied, as to noninfringement of\r
31  * third party rights, merchantability, or fitness for any particular purpose.\r
32  * In no event will PERCEPIO, its technology partners, or distributors be liable\r
33  * to you for any consequential, incidental or special damages, including any\r
34  * lost profits or lost savings, even if a representative of PERCEPIO has been\r
35  * advised of the possibility of such damages, or for any claim by any third\r
36  * party. Some jurisdictions do not allow the exclusion or limitation of\r
37  * incidental, consequential or special damages, or the exclusion of implied\r
38  * warranties or limitations on how long an implied warranty may last, so the\r
39  * above limitations may not apply to you.\r
40  *\r
41  * Tabs are used for indent in this file (1 tab = 4 spaces)\r
42  *\r
43  * Copyright Percepio AB, 2018.\r
44  * www.percepio.com\r
45  ******************************************************************************/\r
46 \r
47 #ifndef TRC_STREAMING_PORT_H\r
48 #define TRC_STREAMING_PORT_H\r
49 \r
50 #ifdef __cplusplus\r
51 extern "C" {\r
52 #endif\r
53 \r
54 /* Include files as needed, in this case it is files from STM32Cube FW_F7 V1.4.1 */\r
55 #include "usb_device.h"\r
56 #include "usbd_cdc.h"\r
57 #include "usbd_CDC_if.h"\r
58 #include "usb_device.h"\r
59 \r
60 /* Tested on STM32 devices using Keil/CMSIS USB stack */\r
61 \r
62 extern USBD_CDC_ItfTypeDef  USBD_Interface_fops_FS;\r
63 \r
64 uint8_t CDC_Transmit_FS(uint8_t* Buf, uint16_t Len);\r
65 \r
66 int32_t trcCDCReceive(void *data, uint32_t size, int32_t* NumBytes);\r
67 \r
68 int32_t trcCDCTransmit(void* data, uint32_t size, int32_t * noOfBytesSent );\r
69 \r
70 #define TRC_STREAM_PORT_INIT() \\r
71         MX_USB_DEVICE_Init(); \\r
72         TRC_STREAM_PORT_MALLOC(); /*Dynamic allocation or empty if static */\r
73 \r
74 #define TRC_STREAM_PORT_READ_DATA(_ptrData, _size, _ptrBytesRead) trcCDCReceive(_ptrData, _size, _ptrBytesRead)\r
75 \r
76 #define TRC_STREAM_PORT_WRITE_DATA(_ptrData, _size, _ptrBytesSent) trcCDCTransmit(_ptrData, _size, _ptrBytesSent)\r
77 \r
78 \r
79 #ifdef __cplusplus\r
80 }\r
81 #endif\r
82 \r
83 #endif /* TRC_STREAMING_PORT_H */\r