]> git.sur5r.net Git - freertos/blob - FreeRTOS-Labs/Source/FreeRTOS-Plus-Trace/streamports/ARM_ITM/include/trcStreamingPort.h
Add the Labs projects provided in the V10.2.1_191129 zip file.
[freertos] / FreeRTOS-Labs / Source / FreeRTOS-Plus-Trace / streamports / ARM_ITM / 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 ARM ITM as streaming channel.\r
9  *\r
10  * Terms of Use\r
11  * This file is part of the trace recorder library (RECORDER), which is the \r
12  * intellectual property of Percepio AB (PERCEPIO) and provided under a\r
13  * license as follows.\r
14  * The RECORDER may be used free of charge for the purpose of recording data\r
15  * intended for analysis in PERCEPIO products. It may not be used or modified\r
16  * for other purposes without explicit permission from PERCEPIO.\r
17  * You may distribute the RECORDER in its original source code form, assuming\r
18  * this text (terms of use, disclaimer, copyright notice) is unchanged. You are\r
19  * allowed to distribute the RECORDER with minor modifications intended for\r
20  * configuration or porting of the RECORDER, e.g., to allow using it on a \r
21  * specific processor, processor family or with a specific communication\r
22  * interface. Any such modifications should be documented directly below\r
23  * this comment block.  \r
24  *\r
25  * Disclaimer\r
26  * The RECORDER is being delivered to you AS IS and PERCEPIO makes no warranty\r
27  * as to its use or performance. PERCEPIO does not and cannot warrant the \r
28  * performance or results you may obtain by using the RECORDER or documentation.\r
29  * PERCEPIO make no warranties, express or implied, as to noninfringement of\r
30  * third party rights, merchantability, or fitness for any particular purpose.\r
31  * In no event will PERCEPIO, its technology partners, or distributors be liable\r
32  * to you for any consequential, incidental or special damages, including any\r
33  * lost profits or lost savings, even if a representative of PERCEPIO has been\r
34  * advised of the possibility of such damages, or for any claim by any third\r
35  * party. Some jurisdictions do not allow the exclusion or limitation of\r
36  * incidental, consequential or special damages, or the exclusion of implied\r
37  * warranties or limitations on how long an implied warranty may last, so the\r
38  * above limitations may not apply to you.\r
39  *\r
40  * Tabs are used for indent in this file (1 tab = 4 spaces)\r
41  *\r
42  * Copyright Percepio AB, 2018.\r
43  * www.percepio.com\r
44  ******************************************************************************/\r
45 \r
46 #ifndef TRC_STREAMING_PORT_H\r
47 #define TRC_STREAMING_PORT_H\r
48 \r
49 #ifdef __cplusplus\r
50 extern "C" {\r
51 #endif\r
52 \r
53 \r
54 int32_t itm_write(void* ptrData, uint32_t size, int32_t* ptrBytesWritten);\r
55 int32_t read_from_host(void* ptrData, uint32_t size, int32_t* ptrBytesRead);\r
56 \r
57 /*******************************************************************************\r
58  * TRC_CFG_ITM_PORT\r
59  *\r
60  * Possible values: 0 - 31\r
61  *\r
62  * What ITM port to use for the ITM software events. Make sure the IDE is\r
63  * configured for the same channel.\r
64  *\r
65  * Default: 1 (0 is typically terminal output and 31 is used by Keil)\r
66  *\r
67  ******************************************************************************/\r
68 #define TRC_CFG_ITM_PORT 1\r
69 \r
70 #if (TRC_CFG_ITM_PORT < 0) || (TRC_CFG_ITM_PORT > 31)\r
71 #error "Bad ITM port selected."\r
72 #endif\r
73 \r
74 // Not used for ITM - no RAM buffer...\r
75 #define TRC_STREAM_PORT_ALLOCATE_FIELDS()\r
76 \r
77 // Not used for ITM - assume the IDE configures the ITM setup\r
78 #define TRC_STREAM_PORT_INIT()\r
79 \r
80 /* Important for the ITM port - no RAM buffer, direct writes. In most other ports this can be skipped (default is 1) */\r
81 #define TRC_STREAM_PORT_USE_INTERNAL_BUFFER 0\r
82   \r
83 #define TRC_STREAM_PORT_WRITE_DATA(_ptrData, _size, _ptrBytesWritten) itm_write(_ptrData, _size, _ptrBytesWritten)\r
84 \r
85 #define TRC_STREAM_PORT_READ_DATA(_ptrData, _size, _ptrBytesRead) read_from_host(_ptrData, _size, _ptrBytesRead)\r
86 \r
87 #ifdef __cplusplus\r
88 }\r
89 #endif\r
90 \r
91 #endif /* TRC_STREAMING_PORT_H */\r