ITM Library
|
#include <stdint.h>
Go to the source code of this file.
Macros | |
#define | ITMLIB_MAJOR_VERSION (0x1) |
#define | ITMLIB_MINOR_VERSION (0x0) |
#define | ITM_NUM_PORTS 32 |
Typedefs | |
typedef unsigned | ITM_port_t |
Enumerations | |
enum | eITM_Error { eITM_Success = 0, eITM_Error_PortInvalidForOp = -1, eITM_Error_FIFOBusy = -2, eITM_Error_MaxStringExceeded = -3 } |
Functions | |
eITM_Error | ITM_getFirstError (void) |
eITM_Error | ITM_put_string (const char *data) |
eITM_Error | ITM_put_32 (ITM_port_t port, uint32_t data) |
eITM_Error | ITM_put_16 (ITM_port_t port, uint16_t data) |
eITM_Error | ITM_put_8 (ITM_port_t port, uint8_t data) |
ITM Library Function Prototypes
#define ITMLIB_MAJOR_VERSION (0x1) |
Major version number - Incremented for API changes
#define ITMLIB_MINOR_VERSION (0x0) |
Minor version number - Incremented for bug fixes
#define ITM_NUM_PORTS 32 |
typedef unsigned ITM_port_t |
Note: Port 0 is reserved for string data, while binary values can be exported over ports 1 to 31.
enum eITM_Error |
eITM_Error ITM_getFirstError | ( | void | ) |
Get the first error to occur since the last time ITM_getFirstError was called.
For every transport function (ITM_put_n), the first error that occurs is saved. When ITM_getFirstError is called the saved error is returned, and then cleared allowing the next error to be saved. If no errors have occurred eITM_Success is returned. This allows the user to make a series of ITM transport calls and then check for errors once, after the series is complete.
eITM_Error ITM_put_string | ( | const char * | data | ) |
Transport a string.
[in] | data | Const char pointer to a NULL terminated string to be transported. |
Each byte of the string is transported over ITM port 0. A string may contain sub-strings, each of which is terminated with a newline. Each substring will get a time-stamp. If the string length exceeds 256 characters, the string is terminated and the function returns eITM_Error_MaxStringExceeded.
Note: ITM_getFirstError() may also be used to check for errors after a series of ITM_put calls, rather than checking the error returned from every call to ITM_put_string.
eITM_Error ITM_put_32 | ( | ITM_port_t | port, |
uint32_t | data | ||
) |
Transport a 32-bit value.
[in] | port | An ITM port in the range of 1 to 31 (port 0 reserved for strings) |
[in] | data | 32-bit value to be transported. |
The 32-bit data value is transported over the selected ITM port.
Note: ITM_getFirstError() may also be used to check for errors after a series of ITM_put calls, rather than checking the error returned from every call to ITM_put_32.
eITM_Error ITM_put_16 | ( | ITM_port_t | port, |
uint16_t | data | ||
) |
Transport a 16-bit value.
[in] | port | An ITM port in the range of 1 to 31 (port 0 reserved for strings) |
[in] | data | 16-bit value to be transported. |
The 16-bit data value is transported over the selected ITM port.
Note: ITM_getFirstError() may also be used to check for errors after a series of ITM_put calls, rather than checking the error returned from every call to ITM_put_16.
eITM_Error ITM_put_8 | ( | ITM_port_t | port, |
uint8_t | data | ||
) |
Transport a 8-bit value.
[in] | port | An ITM port in the range of 1 to 31 (port 0 reserved for strings) |
[in] | data | 8-bit value to be transported. |
The 8-bit data value is transported over the selected ITM port.
Note: ITM_getFirstError() may also be used to check for errors after a series of ITM_put calls, rather than checking the error returned from every call to ITM_put_8.