1 /*******************************************************************************
\r
2 * Trace Recorder Library for Tracealyzer v4.1.5
\r
3 * Percepio AB, www.percepio.com
\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
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
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
40 * Tabs are used for indent in this file (1 tab = 4 spaces)
\r
42 * Copyright Percepio AB, 2018.
\r
44 ******************************************************************************/
\r
46 #ifndef TRC_STREAMING_PORT_H
\r
47 #define TRC_STREAMING_PORT_H
\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
57 /*******************************************************************************
\r
60 * Possible values: 0 - 31
\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
65 * Default: 1 (0 is typically terminal output and 31 is used by Keil)
\r
67 ******************************************************************************/
\r
68 #define TRC_CFG_ITM_PORT 1
\r
70 #if (TRC_CFG_ITM_PORT < 0) || (TRC_CFG_ITM_PORT > 31)
\r
71 #error "Bad ITM port selected."
\r
74 // Not used for ITM - no RAM buffer...
\r
75 #define TRC_STREAM_PORT_ALLOCATE_FIELDS()
\r
77 // Not used for ITM - assume the IDE configures the ITM setup
\r
78 #define TRC_STREAM_PORT_INIT()
\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
83 #define TRC_STREAM_PORT_WRITE_DATA(_ptrData, _size, _ptrBytesWritten) itm_write(_ptrData, _size, _ptrBytesWritten)
\r
85 #define TRC_STREAM_PORT_READ_DATA(_ptrData, _size, _ptrBytesRead) read_from_host(_ptrData, _size, _ptrBytesRead)
\r
91 #endif /* TRC_STREAMING_PORT_H */
\r