diff --git a/README.md b/README.md index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..8898a8b7986a0ce3523caa6a7c5e110db42d4245 100644 --- a/README.md +++ b/README.md @@ -0,0 +1,13 @@ += XMC & UCOS3 + +This project holds the template and various applications using the XMC4500 RelaxKit along with uCOS3. The setup consists of the following folders/layers: + +.... +APP_XXX/ ...... UCOS3 configuration files and application code +APP_XXX/BSP/ .. application specific board support packages for UCOS3 +UCOS3/ ........ the RTOS (Micrium) +XMCLIB/ ....... the low-level library for the XMC controller family (Infineon) +CMSIS/ ........ the Cortex-M4 Support packages (ARM) and the XMC register files (Infineon) +.... + +Copy an application APP_XXX - rename the copy and make it your active build project. \ No newline at end of file diff --git a/XMC_UCOS3/.cproject b/XMC_UCOS3/.cproject new file mode 100644 index 0000000000000000000000000000000000000000..1217ba8d524e7ced90843a2dd7501a48835554e4 --- /dev/null +++ b/XMC_UCOS3/.cproject @@ -0,0 +1,56 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/XMC_UCOS3/.project b/XMC_UCOS3/.project new file mode 100644 index 0000000000000000000000000000000000000000..8035dc3cc6b0f3875ae5f084692973fb8e329eb3 --- /dev/null +++ b/XMC_UCOS3/.project @@ -0,0 +1,27 @@ + + + BEL4_EZB_Template + + + + + + org.eclipse.cdt.managedbuilder.core.genmakebuilder + clean,full,incremental, + + + + + org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder + full,incremental, + + + + + + org.eclipse.cdt.core.cnature + org.eclipse.cdt.managedbuilder.core.managedBuildNature + org.eclipse.cdt.managedbuilder.core.ScannerConfigNature + org.eclipse.cdt.core.ccnature + + diff --git a/XMC_UCOS3/.settings/ilg.gnuarmeclipse.managedbuild.cross.prefs b/XMC_UCOS3/.settings/ilg.gnuarmeclipse.managedbuild.cross.prefs new file mode 100644 index 0000000000000000000000000000000000000000..e4a064aa3f1aa38578cd1b76ce42fe2edfb34562 --- /dev/null +++ b/XMC_UCOS3/.settings/ilg.gnuarmeclipse.managedbuild.cross.prefs @@ -0,0 +1,2 @@ +buildTools.path=/home/nfranz/bin/gcc-arm-none-eabi-4_9-2015q2/bin +eclipse.preferences.version=1 diff --git a/XMC_UCOS3/.settings/language.settings.xml b/XMC_UCOS3/.settings/language.settings.xml new file mode 100644 index 0000000000000000000000000000000000000000..015afbda64c55bcaebc227810b0ff5494c99accf --- /dev/null +++ b/XMC_UCOS3/.settings/language.settings.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/XMC_UCOS3/APP_UART1_ECHO/BSP/RTT_Syscalls_GCC.c b/XMC_UCOS3/APP_UART1_ECHO/BSP/RTT_Syscalls_GCC.c new file mode 100644 index 0000000000000000000000000000000000000000..8b63a9eed0c3a323a16e86319e6ebd995046718f --- /dev/null +++ b/XMC_UCOS3/APP_UART1_ECHO/BSP/RTT_Syscalls_GCC.c @@ -0,0 +1,55 @@ +/********************************************************************* +* SEGGER MICROCONTROLLER GmbH & Co KG * +* Solutions for real time microcontroller applications * +********************************************************************** +* * +* (c) 2014 SEGGER Microcontroller GmbH & Co KG * +* * +* www.segger.com Support: support@segger.com * +* * +********************************************************************** + +---------------------------------------------------------------------- +File : RTT_Syscalls.c +Purpose : Low-level functions for using printf() via RTT in GCC +-------- END-OF-HEADER --------------------------------------------- +*/ +#include + +#if JLINK_RTT + +/********************************************************************* +* +* Function prototypes +* +********************************************************************** +*/ +int _write (int file, char *ptr, int len); + +/********************************************************************* +* +* Global functions +* +********************************************************************** +*/ + +/********************************************************************* +* +* _write() +* +* Function description +* Low-level write function. +* libc subroutines will use this system routine for output to all files, +* including stdout. +* Write data via RTT. +*/ +int _write (int file, char *ptr, int len) +{ + (void) file; /* Not used, avoid warning */ + SEGGER_RTT_Write (0, ptr, len); + return len; +} + +#endif + +/*! EOF */ diff --git a/XMC_UCOS3/APP_UART1_ECHO/BSP/SEGGER_RTT.c b/XMC_UCOS3/APP_UART1_ECHO/BSP/SEGGER_RTT.c new file mode 100644 index 0000000000000000000000000000000000000000..9981b43bc3c0cd292afbd4fc99408ea24a802787 --- /dev/null +++ b/XMC_UCOS3/APP_UART1_ECHO/BSP/SEGGER_RTT.c @@ -0,0 +1,655 @@ +/********************************************************************* +* SEGGER MICROCONTROLLER GmbH & Co. KG * +* Solutions for real time microcontroller applications * +********************************************************************** +* * +* (c) 2014-2014 SEGGER Microcontroller GmbH & Co. KG * +* * +* Internet: www.segger.com Support: support@segger.com * +* * +********************************************************************** +---------------------------------------------------------------------- +File : SEGGER_RTT.c +Date : 17 Dec 2014 +Purpose : Implementation of SEGGER real-time terminal (RTT) which allows + real-time terminal communication on targets which support + debugger memory accesses while the CPU is running. + + Type "int" is assumed to be 32-bits in size + H->T Host to target communication + T->H Target to host communication + + RTT channel 0 is always present and reserved for Terminal usage. + Name is fixed to "Terminal" + +---------------------------END-OF-HEADER------------------------------ +*/ + +#include +#include + +#include // for memcpy + +#if JLINK_RTT + +/********************************************************************* +* +* Defines, configurable +* +********************************************************************** +*/ + +#ifndef BUFFER_SIZE_UP +// Size of the buffer for terminal output of target, up to host +#define BUFFER_SIZE_UP (1024) +#endif + +#ifndef BUFFER_SIZE_DOWN +// Size of the buffer for terminal input to target from host (Usually +// keyboard input) + +#define BUFFER_SIZE_DOWN (16) +#endif + +#ifndef SEGGER_RTT_MAX_NUM_UP_BUFFERS +// Number of up-buffers (T->H) available on this target +#define SEGGER_RTT_MAX_NUM_UP_BUFFERS (1) +#endif + +#ifndef SEGGER_RTT_MAX_NUM_DOWN_BUFFERS +// Number of down-buffers (H->T) available on this target +#define SEGGER_RTT_MAX_NUM_DOWN_BUFFERS (1) +#endif + +#ifndef SEGGER_RTT_LOCK +#define SEGGER_RTT_LOCK() +#endif + +#ifndef SEGGER_RTT_UNLOCK +#define SEGGER_RTT_UNLOCK() +#endif + +#ifndef SEGGER_RTT_IN_RAM +#define SEGGER_RTT_IN_RAM (0) +#endif + +/********************************************************************* +* +* Defines, fixed +* +********************************************************************** +*/ + +#define MIN(a, b) (((a) < (b)) ? (a) : (b)) +#define MAX(a, b) (((a) > (b)) ? (a) : (b)) + +#define MEMCPY(a, b, c) memcpy((a),(b),(c)) + +// For some environments, NULL may not be defined until certain headers +// are included. +#ifndef NULL +#define NULL 0 +#endif + +/********************************************************************* +* +* Types +* +********************************************************************** +*/ + +// +// Description for a circular buffer (also called "ring buffer") +// which is used as up- (T->H) or down-buffer (H->T) +// +typedef struct { +// Optional name. Standard names so far are: "Terminal", "VCom" + const char* sName; +// Pointer to start of buffer + char* pBuffer; +// Buffer size in bytes. Note that one byte is lost, as this +// implementation does not fill up the buffer in order to avoid the +// problem of being unable to distinguish between full and empty. + int SizeOfBuffer; +// Position of next item to be written by either host (down-buffer) +// or target (up-buffer). Must be volatile since it may be modified +// by host (down-buffer) + volatile int WrOff; +// Position of next item to be read by target (down-buffer) or host +// (up-buffer). Must be volatile since it may be modified by host +// (up-buffer) + volatile int RdOff; +// Contains configuration flags + int Flags; +} RING_BUFFER; + + +// RTT control block which describes the number of buffers available +// as well as the configuration for each buffer +typedef struct { +// Initialized to "SEGGER RTT" + char acID[16]; +// Initialized to SEGGER_RTT_MAX_NUM_UP_BUFFERS (type. 2) + int MaxNumUpBuffers; +// Initialized to SEGGER_RTT_MAX_NUM_DOWN_BUFFERS (type. 2) + int MaxNumDownBuffers; +// Up buffers, transferring information up from target via debug probe to host + RING_BUFFER aUp[SEGGER_RTT_MAX_NUM_UP_BUFFERS]; +// Down buffers, transferring information down from host via debug probe +// to target + RING_BUFFER aDown[SEGGER_RTT_MAX_NUM_DOWN_BUFFERS]; +} SEGGER_RTT_CB; + +/********************************************************************* +* +* Static data +* +********************************************************************** +*/ +// +// Allocate buffers for channel 0 +// +static char _acUpBuffer [BUFFER_SIZE_UP]; +static char _acDownBuffer[BUFFER_SIZE_DOWN]; +// +// Initialize SEGGER Real-time-Terminal control block (CB) +// +static SEGGER_RTT_CB _SEGGER_RTT = { +#if SEGGER_RTT_IN_RAM + "SEGGER RTTI", +#else + "SEGGER RTT", +#endif + SEGGER_RTT_MAX_NUM_UP_BUFFERS, + SEGGER_RTT_MAX_NUM_DOWN_BUFFERS, + {{ "Terminal", &_acUpBuffer[0], + sizeof (_acUpBuffer), 0, 0, + SEGGER_RTT_MODE_NO_BLOCK_SKIP }}, + {{ "Terminal", &_acDownBuffer[0], + sizeof (_acDownBuffer), 0, 0, + SEGGER_RTT_MODE_NO_BLOCK_SKIP }}, +}; + +static char _ActiveTerminal; + +/********************************************************************* +* +* Static code +* +********************************************************************** +*/ + +/********************************************************************* +* +* _strlen +* +* Function description +* ANSI compatible function to determine the length of a string +* +* Return value +* Length of string in bytes. +* +* Parameters +* s Pointer to \0 terminated string. +* +* Notes +* (1) s needs to point to an \0 terminated string. Otherwise proper +* functionality of this function is not guaranteed. +*/ +static int _strlen (const char* s) +{ + int Len; + + Len = 0; + if (s == NULL) { + return 0; + } + do { + if (*s == 0) { + break; + } + Len++; + s++; + } while (1); + return Len; +} + +/********************************************************************* +* +* _Init +* +* Function description +* In case SEGGER_RTT_IN_RAM is defined, +* _Init() modifies the ID of the RTT CB to allow identifying the +* RTT Control Block Structure in the data segment. +*/ +static void _Init (void) +{ +#if SEGGER_RTT_IN_RAM + if (_SEGGER_RTT.acID[10] == 'I') { + _SEGGER_RTT.acID[10] = '\0'; + } +#endif +} + +/********************************************************************* +* +* Public code +* +********************************************************************** +*/ +/********************************************************************* +* +* SEGGER_RTT_Read +* +* Function description +* Reads characters from SEGGER real-time-terminal control block +* which have been previously stored by the host. +* +* Parameters +* BufferIndex Index of Down-buffer to be used. (e.g. 0 for "Terminal") +* pBuffer Pointer to buffer provided by target application, to copy +* characters from RTT-down-buffer to. +* BufferSize Size of the target application buffer +* +* Return values +* Number of bytes that have been read +*/ +int SEGGER_RTT_Read (unsigned BufferIndex, char* pBuffer, unsigned BufferSize) +{ + int NumBytesRem; + unsigned NumBytesRead; + int RdOff; + int WrOff; + + SEGGER_RTT_LOCK(); + _Init(); + RdOff = _SEGGER_RTT.aDown[BufferIndex].RdOff; + WrOff = _SEGGER_RTT.aDown[BufferIndex].WrOff; + NumBytesRead = 0; + // + // Read from current read position to wrap-around of buffer, first + // + if (RdOff > WrOff) { + NumBytesRem = _SEGGER_RTT.aDown[BufferIndex].SizeOfBuffer - RdOff; + NumBytesRem = MIN (NumBytesRem, (int) BufferSize); + MEMCPY (pBuffer, _SEGGER_RTT.aDown[BufferIndex].pBuffer + RdOff, + NumBytesRem); + NumBytesRead += NumBytesRem; + pBuffer += NumBytesRem; + BufferSize -= NumBytesRem; + RdOff += NumBytesRem; + // + // Handle wrap-around of buffer + // + if (RdOff == _SEGGER_RTT.aDown[BufferIndex].SizeOfBuffer) { + RdOff = 0; + } + } + // + // Read remaining items of buffer + // + NumBytesRem = WrOff - RdOff; + NumBytesRem = MIN (NumBytesRem, (int) BufferSize); + if (NumBytesRem > 0) { + MEMCPY (pBuffer, _SEGGER_RTT.aDown[BufferIndex].pBuffer + RdOff, + NumBytesRem); + NumBytesRead += NumBytesRem; + pBuffer += NumBytesRem; + BufferSize -= NumBytesRem; + RdOff += NumBytesRem; + } + if (NumBytesRead) { + _SEGGER_RTT.aDown[BufferIndex].RdOff = RdOff; + } + SEGGER_RTT_UNLOCK(); + return NumBytesRead; +} + +/********************************************************************* +* +* SEGGER_RTT_Write +* +* Function description +* Stores a specified number of characters in SEGGER RTT +* control block which is then read by the host. +* +* Parameters +* BufferIndex Index of "Up"-buffer to be used. (e.g. 0 for "Terminal") +* pBuffer Pointer to character array. Does not need to point to a \0 +* terminated string. +* NumBytes Number of bytes to be stored in the SEGGER RTT control block. +* +* Return values +* Number of bytes which have been stored in the "Up"-buffer. +* +* Notes +* (1) If there is not enough space in the "Up"-buffer, remaining characters +* of pBuffer are dropped. +*/ +int SEGGER_RTT_Write (unsigned BufferIndex, const char* pBuffer, + unsigned NumBytes) +{ + int NumBytesToWrite; + unsigned NumBytesWritten; + int RdOff; + + // Target is not allowed to perform other RTT operations while string still + // has not been stored completely. + // Otherwise we would probably end up with a mixed string in the buffer. + // + SEGGER_RTT_LOCK(); + _Init(); + + // In case we are not in blocking mode, + // we need to calculate, how many bytes we can put into the buffer at all. + // + if ( (_SEGGER_RTT.aUp[BufferIndex].Flags & SEGGER_RTT_MODE_MASK) != SEGGER_RTT_MODE_BLOCK_IF_FIFO_FULL) { + RdOff = _SEGGER_RTT.aUp[BufferIndex].RdOff; + NumBytesToWrite = RdOff - _SEGGER_RTT.aUp[BufferIndex].WrOff - 1; + if (NumBytesToWrite < 0) { + NumBytesToWrite += _SEGGER_RTT.aUp[BufferIndex].SizeOfBuffer; + } + + // If the complete data does not fit in the buffer, check if we have to + // skip it completely or trim the data + // + if ( (int) NumBytes > NumBytesToWrite) { + if ( (_SEGGER_RTT.aUp[BufferIndex].Flags & SEGGER_RTT_MODE_MASK) == + SEGGER_RTT_MODE_NO_BLOCK_SKIP) { + SEGGER_RTT_UNLOCK(); + return 0; + } else { + NumBytes = NumBytesToWrite; + } + } + } + + // Early out if nothing is to do + // + if (NumBytes == 0) { + SEGGER_RTT_UNLOCK(); + return 0; + } + + // Write data to buffer and handle wrap-around if necessary + // + NumBytesWritten = 0; + do { + // May be changed by host (debug probe) in the meantime + RdOff = _SEGGER_RTT.aUp[BufferIndex].RdOff; + NumBytesToWrite = RdOff - _SEGGER_RTT.aUp[BufferIndex].WrOff - 1; + if (NumBytesToWrite < 0) { + NumBytesToWrite += _SEGGER_RTT.aUp[BufferIndex].SizeOfBuffer; + } + // Number of bytes that can be written until buffer wrap-around + NumBytesToWrite = MIN (NumBytesToWrite, + (_SEGGER_RTT.aUp[BufferIndex].SizeOfBuffer - + _SEGGER_RTT.aUp[BufferIndex].WrOff)); + NumBytesToWrite = MIN (NumBytesToWrite, (int) NumBytes); + MEMCPY (_SEGGER_RTT.aUp[BufferIndex].pBuffer + + _SEGGER_RTT.aUp[BufferIndex].WrOff, pBuffer, NumBytesToWrite); + NumBytesWritten += NumBytesToWrite; + pBuffer += NumBytesToWrite; + NumBytes -= NumBytesToWrite; + _SEGGER_RTT.aUp[BufferIndex].WrOff += NumBytesToWrite; + if (_SEGGER_RTT.aUp[BufferIndex].WrOff == + _SEGGER_RTT.aUp[BufferIndex].SizeOfBuffer) { + _SEGGER_RTT.aUp[BufferIndex].WrOff = 0; + } + } while (NumBytes); + SEGGER_RTT_UNLOCK(); + return NumBytesWritten; +} + +/********************************************************************* +* +* SEGGER_RTT_WriteString +* +* Function description +* Stores string in SEGGER RTT control block. +* This data is read by the host. +* +* Parameters +* BufferIndex Index of "Up"-buffer to be used. (e.g. 0 for "Terminal") +* s Pointer to string. +* +* Return values +* Number of bytes which have been stored in the "Up"-buffer. +* +* Notes +* (1) If there is not enough space in the "Up"-buffer, depending on +* configuration, remaining characters may be dropped or RTT module +* waits until there is more space in the buffer. +* (2) String passed to this function has to be \0 terminated +* (3) \0 termination character is *not* stored in RTT buffer +*/ +int SEGGER_RTT_WriteString (unsigned BufferIndex, const char* s) +{ + int Len; + + Len = _strlen (s); + return SEGGER_RTT_Write (BufferIndex, s, Len); +} + +/********************************************************************* +* +* SEGGER_RTT_GetKey +* +* Function description +* Reads one character from the SEGGER RTT buffer. +* Host has previously stored data there. +* +* Return values +* < 0 No character available (buffer empty). +* >= 0 Character which has been read. (Possible values: 0 - 255) +* +* Notes +* (1) This function is only specified for accesses to RTT buffer 0. +*/ +int SEGGER_RTT_GetKey (void) +{ + char c; + int r; + + r = SEGGER_RTT_Read (0, &c, 1); + if (r == 1) { + return (int) (unsigned char) c; + } + return -1; +} + +/********************************************************************* +* +* SEGGER_RTT_WaitKey +* +* Function description +* Waits until at least one character is avaible in the SEGGER RTT buffer. +* Once a character is available, it is read and this function returns. +* +* Return values +* >=0 Character which has been read. +* +* Notes +* (1) This function is only specified for accesses to RTT buffer 0 +* (2) This function is blocking if no character is present in RTT buffer +*/ +int SEGGER_RTT_WaitKey (void) +{ + int r; + + do { + r = SEGGER_RTT_GetKey(); + } while (r < 0); + return r; +} + +/********************************************************************* +* +* SEGGER_RTT_HasKey +* +* Function description +* Checks if at least one character for reading is available in the +* SEGGER RTT buffer. +* +* Return values +* 0 No characters are available to read. +* 1 At least one character is available. +* +* Notes +* (1) This function is only specified for accesses to RTT buffer 0 +*/ +int SEGGER_RTT_HasKey (void) +{ + int RdOff; + + _Init(); + RdOff = _SEGGER_RTT.aDown[0].RdOff; + if (RdOff != _SEGGER_RTT.aDown[0].WrOff) { + return 1; + } + return 0; +} + +/********************************************************************* +* +* SEGGER_RTT_ConfigUpBuffer +* +* Function description +* Run-time configuration of a specific up-buffer (T->H). +* Buffer to be configured is specified by index. +* This includes: Buffer address, size, name, flags, ... +* +* Return value +* >= 0 O.K. +* < 0 Error +*/ +int SEGGER_RTT_ConfigUpBuffer (unsigned BufferIndex, const char* sName, + char* pBuffer, int BufferSize, int Flags) +{ + _Init(); + if (BufferIndex < (unsigned) _SEGGER_RTT.MaxNumUpBuffers) { + SEGGER_RTT_LOCK(); + if (BufferIndex > 0) { + _SEGGER_RTT.aUp[BufferIndex].sName = sName; + _SEGGER_RTT.aUp[BufferIndex].pBuffer = pBuffer; + _SEGGER_RTT.aUp[BufferIndex].SizeOfBuffer = BufferSize; + _SEGGER_RTT.aUp[BufferIndex].RdOff = 0; + _SEGGER_RTT.aUp[BufferIndex].WrOff = 0; + } + _SEGGER_RTT.aUp[BufferIndex].Flags = Flags; + SEGGER_RTT_UNLOCK(); + return 0; + } + return -1; +} + +/********************************************************************* +* +* SEGGER_RTT_ConfigDownBuffer +* +* Function description +* Run-time configuration of a specific down-buffer (H->T). +* Buffer to be configured is specified by index. +* This includes: Buffer address, size, name, flags, ... +* +* Return value +* >= 0 O.K. +* < 0 Error +*/ +int SEGGER_RTT_ConfigDownBuffer (unsigned BufferIndex, const char* sName, + char* pBuffer, int BufferSize, int Flags) +{ + _Init(); + if (BufferIndex < (unsigned) _SEGGER_RTT.MaxNumDownBuffers) { + SEGGER_RTT_LOCK(); + if (BufferIndex > 0) { + _SEGGER_RTT.aDown[BufferIndex].sName = sName; + _SEGGER_RTT.aDown[BufferIndex].pBuffer = pBuffer; + _SEGGER_RTT.aDown[BufferIndex].SizeOfBuffer = BufferSize; + _SEGGER_RTT.aDown[BufferIndex].RdOff = 0; + _SEGGER_RTT.aDown[BufferIndex].WrOff = 0; + } + _SEGGER_RTT.aDown[BufferIndex].Flags = Flags; + SEGGER_RTT_UNLOCK(); + return 0; + } + return -1; +} + +/********************************************************************* +* +* SEGGER_RTT_Init +* +* Function description +* Initializes the RTT Control Block. +* Should be used in RAM targets, at start of the application. +* +*/ +void SEGGER_RTT_Init (void) +{ + _Init(); +} + +/********************************************************************* +* +* SEGGER_RTT_SetTerminal +* +* Function description +* Sets the terminal to be used for output on channel 0. +* +*/ +void SEGGER_RTT_SetTerminal (char TerminalId) +{ + char ac[2]; + + ac[0] = 0xFF; + if (TerminalId < 10) { + ac[1] = '0' + TerminalId; + } else if (TerminalId < 16) { + ac[1] = 'A' + (TerminalId - 0x0A); + } else { + // RTT only supports up to 16 virtual terminals. + return; + } + _ActiveTerminal = TerminalId; + SEGGER_RTT_Write (0, ac, 2); +} + +/********************************************************************* +* +* SEGGER_RTT_TerminalOut +* +* Function description: +* Writes a string to the given terminal +* without changing the terminal for channel 0. +* +*/ +int SEGGER_RTT_TerminalOut (char TerminalId, const char* s) +{ + char ac[2]; + int r; + + ac[0] = 0xFF; + if (TerminalId < 10) { + ac[1] = '0' + TerminalId; + } else if (TerminalId < 16) { + ac[1] = 'A' + (TerminalId - 0x0A); + } else { + // RTT only supports up to 16 virtual terminals. + return -1; + } + SEGGER_RTT_Write (0, ac, 2); + r = SEGGER_RTT_WriteString (0, s); + if (TerminalId < 10) { + ac[1] = '0' + _ActiveTerminal; + } else if (TerminalId < 16) { + ac[1] = 'A' + (_ActiveTerminal - 0x0A); + } + SEGGER_RTT_Write (0, ac, 2); + return r; +} + +#endif + +/*! EOF */ diff --git a/XMC_UCOS3/APP_UART1_ECHO/BSP/SEGGER_RTT.h b/XMC_UCOS3/APP_UART1_ECHO/BSP/SEGGER_RTT.h new file mode 100644 index 0000000000000000000000000000000000000000..0ad863faebd272d9c09d5a8284c3a81ec23eb0c7 --- /dev/null +++ b/XMC_UCOS3/APP_UART1_ECHO/BSP/SEGGER_RTT.h @@ -0,0 +1,121 @@ +/********************************************************************* +* SEGGER MICROCONTROLLER SYSTEME GmbH * +* Solutions for real time microcontroller applications * +********************************************************************** +* * +* (c) 1996-2014 SEGGER Microcontroller Systeme GmbH * +* * +* Internet: www.segger.com Support: support@segger.com * +* * +********************************************************************** +---------------------------------------------------------------------- +File : SEGGER_RTT.h +Date : 17 Dec 2014 +Purpose : Implementation of SEGGER real-time terminal which allows + real-time terminal communication on targets which support + debugger memory accesses while the CPU is running. +---------------------------END-OF-HEADER------------------------------ +*/ + +/********************************************************************* +* +* Defines +* +********************************************************************** +*/ + +#include + +#if JLINK_RTT + +#define SEGGER_RTT_MODE_MASK (3 << 0) + +#define SEGGER_RTT_MODE_NO_BLOCK_SKIP (0) +#define SEGGER_RTT_MODE_NO_BLOCK_TRIM (1 << 0) +#define SEGGER_RTT_MODE_BLOCK_IF_FIFO_FULL (1 << 1) + +#define RTT_CTRL_RESET "" + +#define RTT_CTRL_CLEAR "" + +#define RTT_CTRL_TEXT_BLACK "" +#define RTT_CTRL_TEXT_RED "" +#define RTT_CTRL_TEXT_GREEN "" +#define RTT_CTRL_TEXT_YELLOW "" +#define RTT_CTRL_TEXT_BLUE "" +#define RTT_CTRL_TEXT_MAGENTA "" +#define RTT_CTRL_TEXT_CYAN "" +#define RTT_CTRL_TEXT_WHITE "" + +#define RTT_CTRL_TEXT_BRIGHT_BLACK "" +#define RTT_CTRL_TEXT_BRIGHT_RED "" +#define RTT_CTRL_TEXT_BRIGHT_GREEN "" +#define RTT_CTRL_TEXT_BRIGHT_YELLOW "" +#define RTT_CTRL_TEXT_BRIGHT_BLUE "" +#define RTT_CTRL_TEXT_BRIGHT_MAGENTA "" +#define RTT_CTRL_TEXT_BRIGHT_CYAN "" +#define RTT_CTRL_TEXT_BRIGHT_WHITE "" + +#define RTT_CTRL_BG_BLACK "" +#define RTT_CTRL_BG_RED "" +#define RTT_CTRL_BG_GREEN "" +#define RTT_CTRL_BG_YELLOW "" +#define RTT_CTRL_BG_BLUE "" +#define RTT_CTRL_BG_MAGENTA "" +#define RTT_CTRL_BG_CYAN "" +#define RTT_CTRL_BG_WHITE "" + +#define RTT_CTRL_BG_BRIGHT_BLACK "" +#define RTT_CTRL_BG_BRIGHT_RED "" +#define RTT_CTRL_BG_BRIGHT_GREEN "" +#define RTT_CTRL_BG_BRIGHT_YELLOW "" +#define RTT_CTRL_BG_BRIGHT_BLUE "" +#define RTT_CTRL_BG_BRIGHT_MAGENTA "" +#define RTT_CTRL_BG_BRIGHT_CYAN "" +#define RTT_CTRL_BG_BRIGHT_WHITE "" + + +/********************************************************************* +* +* RTT API functions +* +********************************************************************** +*/ + +int SEGGER_RTT_Read (unsigned BufferIndex, char* pBuffer, + unsigned BufferSize); +int SEGGER_RTT_Write (unsigned BufferIndex, const char* pBuffer, + unsigned NumBytes); +int SEGGER_RTT_WriteString (unsigned BufferIndex, const char* s); + +int SEGGER_RTT_GetKey (void); +int SEGGER_RTT_WaitKey (void); +int SEGGER_RTT_HasKey (void); + +int SEGGER_RTT_ConfigUpBuffer (unsigned BufferIndex, const char* sName, + char* pBuffer, int BufferSize, int Flags); +int SEGGER_RTT_ConfigDownBuffer (unsigned BufferIndex, const char* sName, + char* pBuffer, int BufferSize, int Flags); + +void SEGGER_RTT_Init (void); + +/********************************************************************* +* +* RTT "Terminal" API functions +* +********************************************************************** +*/ +void SEGGER_RTT_SetTerminal (char TerminalId); +int SEGGER_RTT_TerminalOut (char TerminalId, const char* s); + +/********************************************************************* +* +* RTT printf functions (require SEGGER_RTT_printf.c) +* +********************************************************************** +*/ +int SEGGER_RTT_printf (unsigned BufferIndex, const char * sFormat, ...); + +#endif + +/*! EOF */ diff --git a/XMC_UCOS3/APP_UART1_ECHO/BSP/SEGGER_RTT_Conf.h b/XMC_UCOS3/APP_UART1_ECHO/BSP/SEGGER_RTT_Conf.h new file mode 100644 index 0000000000000000000000000000000000000000..bb03fab84f17ee408da59713a877ac9f2d6bd85a --- /dev/null +++ b/XMC_UCOS3/APP_UART1_ECHO/BSP/SEGGER_RTT_Conf.h @@ -0,0 +1,67 @@ +/********************************************************************* +* SEGGER MICROCONTROLLER SYSTEME GmbH * +* Solutions for real time microcontroller applications * +********************************************************************** +* * +* (c) 1996-2014 SEGGER Microcontroller Systeme GmbH * +* * +* Internet: www.segger.com Support: support@segger.com * +* * +********************************************************************** +---------------------------------------------------------------------- +File : SEGGER_RTT_Conf.h +Date : 17 Dec 2014 +Purpose : Implementation of SEGGER real-time terminal which allows + real-time terminal communication on targets which support + debugger memory accesses while the CPU is running. +---------------------------END-OF-HEADER------------------------------ +*/ + +/********************************************************************* +* +* Defines, configurable +* +********************************************************************** +*/ + +#include + +#if JLINK_RTT +// Max. number of up-buffers (T->H) available on this target (Default: 2) +#define SEGGER_RTT_MAX_NUM_UP_BUFFERS (2) +// Max. number of down-buffers (H->T) available on this target (Default: 2) +#define SEGGER_RTT_MAX_NUM_DOWN_BUFFERS (2) +// Size of the buffer for terminal output of target, up to host (Default: 1k) +#define BUFFER_SIZE_UP (1024) +// Size of the buffer for terminal input to target from host (Usually +// keyboard input) (Default: 16) +#define BUFFER_SIZE_DOWN (16) +// Size of buffer for RTT printf to bulk-send chars via RTT (Default: 64) +#define SEGGER_RTT_PRINTF_BUFFER_SIZE (64) + +// Target is not allowed to perform other RTT operations while string still +// has not been stored completely. Otherwise we would probably end up with +// a mixed string in the buffer. +// If using RTT from within interrupts, multiple tasks or multi +// processors, define the SEGGER_RTT_LOCK() and SEGGER_RTT_UNLOCK() +// function here. +// +#define SEGGER_RTT_LOCK() +#define SEGGER_RTT_UNLOCK() + +// +// Define SEGGER_RTT_IN_RAM as 1 +// when using RTT in RAM targets (init and data section both in RAM). +// This prevents the host to falsly identify the RTT Callback Structure +// in the init segment as the used Callback Structure. +// +// When defined as 1, the first call to an RTT function will modify the ID +// of the RTT Callback Structure. To speed up identifying on the host, +// especially when RTT functions are not called at the beginning of execution, +// SEGGER_RTT_Init() should be called at the start of the application. +// +#define SEGGER_RTT_IN_RAM (0) + +#endif + +/*! EOF */ diff --git a/XMC_UCOS3/APP_UART1_ECHO/BSP/SEGGER_RTT_printf.c b/XMC_UCOS3/APP_UART1_ECHO/BSP/SEGGER_RTT_printf.c new file mode 100644 index 0000000000000000000000000000000000000000..ff7fb44227168a7315f2bdddf2af3e87518b8c91 --- /dev/null +++ b/XMC_UCOS3/APP_UART1_ECHO/BSP/SEGGER_RTT_printf.c @@ -0,0 +1,481 @@ +/********************************************************************* +* SEGGER MICROCONTROLLER GmbH & Co. KG * +* Solutions for real time microcontroller applications * +********************************************************************** +* * +* (c) 2014-2014 SEGGER Microcontroller GmbH & Co. KG * +* * +* Internet: www.segger.com Support: support@segger.com * +* * +********************************************************************** +---------------------------------------------------------------------- +File : SEGGER_RTT_printf.c +Date : 17 Dec 2014 +Purpose : Replacement for printf to write formatted data via RTT +---------------------------END-OF-HEADER------------------------------ +*/ +#include +#include + +#if JLINK_RTT + +/********************************************************************* +* +* Defines, configurable +* +********************************************************************** +*/ + +#ifndef SEGGER_RTT_PRINTF_BUFFER_SIZE +#define SEGGER_RTT_PRINTF_BUFFER_SIZE (64) +#endif + +#include +#include + + +#define FORMAT_FLAG_LEFT_JUSTIFY (1 << 0) +#define FORMAT_FLAG_PAD_ZERO (1 << 1) +#define FORMAT_FLAG_PRINT_SIGN (1 << 2) +#define FORMAT_FLAG_ALTERNATE (1 << 3) + +/********************************************************************* +* +* Types +* +********************************************************************** +*/ + +typedef struct { + char* pBuffer; + int BufferSize; + int Cnt; + + int ReturnValue; + + unsigned RTTBufferIndex; +} SEGGER_RTT_PRINTF_DESC; + +/********************************************************************* +* +* Function prototypes +* +********************************************************************** +*/ +int SEGGER_RTT_vprintf (unsigned BufferIndex, const char * sFormat, + va_list * pParamList); + +/********************************************************************* +* +* Static code +* +********************************************************************** +*/ +/********************************************************************* +* +* _StoreChar +*/ +static void _StoreChar (SEGGER_RTT_PRINTF_DESC * p, char c) +{ + int Cnt; + + Cnt = p->Cnt; + if ( (Cnt + 1) <= p->BufferSize) { + * (p->pBuffer + Cnt) = c; + p->Cnt = Cnt + 1; + p->ReturnValue++; + } + // + // Write part of string, when the buffer is full + // + if (p->Cnt == p->BufferSize) { + if (SEGGER_RTT_Write (p->RTTBufferIndex, p->pBuffer, p->Cnt) != p->Cnt) { + p->ReturnValue = -1; + } else { + p->Cnt = 0; + } + } +} + +/********************************************************************* +* +* _PrintUnsigned +*/ +static void _PrintUnsigned (SEGGER_RTT_PRINTF_DESC * pBufferDesc, unsigned v, + unsigned Base, int NumDigits, unsigned FieldWidth, + unsigned FormatFlags) +{ + static const char _aV2C[16] = {'0', '1', '2', '3', '4', '5', '6', '7', '8', + '9', 'A', 'B', 'C', 'D', 'E', 'F' }; + unsigned Div; + unsigned Digit = 1; + unsigned Number; + unsigned Width; + char c; + + Number = v; + + // + // Get actual field width + // + Width = 1; + while (Number >= Base) { + Number = (Number / Base); + Width++; + } + if ( (unsigned) NumDigits > Width) { + Width = NumDigits; + } + // + // Print leading chars if necessary + // + if ( (FormatFlags & FORMAT_FLAG_LEFT_JUSTIFY) == 0) { + if (FieldWidth != 0) { + if ( ( (FormatFlags & FORMAT_FLAG_PAD_ZERO) == FORMAT_FLAG_PAD_ZERO) && + (NumDigits == 0)) { + c = '0'; + } else { + c = ' '; + } + while ( (FieldWidth != 0) && (Width < FieldWidth--)) { + _StoreChar (pBufferDesc, c); + if (pBufferDesc->ReturnValue < 0) { + return; + } + } + } + } + // + // Count how many digits are required by precision + // + while ( ( (v / Digit) >= Base) | (NumDigits-- > 1)) { + Digit *= Base; + } + // + // Output digits + // + do { + Div = v / Digit; + v -= Div * Digit; + _StoreChar (pBufferDesc, _aV2C[Div]); + if (pBufferDesc->ReturnValue < 0) { + break; + } + Digit /= Base; + } while (Digit); + // + // Print trailing spaces if necessary + // + if ( (FormatFlags & FORMAT_FLAG_LEFT_JUSTIFY) == FORMAT_FLAG_LEFT_JUSTIFY) { + if (FieldWidth != 0) { + while ( (FieldWidth != 0) && (Width < FieldWidth--)) { + _StoreChar (pBufferDesc, ' '); + if (pBufferDesc->ReturnValue < 0) { + return; + } + } + } + } +} + +/********************************************************************* +* +* _PrintInt +*/ +static void _PrintInt (SEGGER_RTT_PRINTF_DESC * pBufferDesc, int v, + unsigned Base, unsigned NumDigits, unsigned FieldWidth, + unsigned FormatFlags) +{ + unsigned Width; + unsigned Number; + + Number = (v < 0) ? -v : v; + + // + // Get actual field width + // + Width = 1; + while (Number >= Base) { + Number = (Number / Base); + Width++; + } + if (NumDigits > Width) { + Width = NumDigits; + } + if ( (FieldWidth > 0) && ( (v < 0) || + ( (FormatFlags & FORMAT_FLAG_PRINT_SIGN) == FORMAT_FLAG_PRINT_SIGN))) { + FieldWidth--; + } + + // + // Print leading spaces if necessary + // + if ( ( ( (FormatFlags & FORMAT_FLAG_PAD_ZERO) == 0) || (NumDigits != 0)) && + ( (FormatFlags & FORMAT_FLAG_LEFT_JUSTIFY) == 0)) { + if (FieldWidth != 0) { + while ( (FieldWidth != 0) && (Width < FieldWidth--)) { + _StoreChar (pBufferDesc, ' '); + if (pBufferDesc->ReturnValue < 0) { + return; + } + } + } + } + // + // Print sign if necessary + // + if (v < 0) { + v = -v; + _StoreChar (pBufferDesc, '-'); + if (pBufferDesc->ReturnValue < 0) { + return; + } + } else if ( (FormatFlags & FORMAT_FLAG_PRINT_SIGN) == + FORMAT_FLAG_PRINT_SIGN) { + _StoreChar (pBufferDesc, '+'); + if (pBufferDesc->ReturnValue < 0) { + return; + } + } + // + // Print leading zeros if necessary + // + if ( ( (FormatFlags & FORMAT_FLAG_PAD_ZERO) == FORMAT_FLAG_PAD_ZERO) && + ( (FormatFlags & FORMAT_FLAG_LEFT_JUSTIFY) == 0) && (NumDigits == 0)) { + if (FieldWidth != 0) { + while ( (FieldWidth != 0) && (Width < FieldWidth--)) { + _StoreChar (pBufferDesc, '0'); + if (pBufferDesc->ReturnValue < 0) { + return; + } + } + } + } + + // + // Print number without sign + // + _PrintUnsigned (pBufferDesc, v, Base, NumDigits, FieldWidth, FormatFlags); +} + +/********************************************************************* +* +* Public code +* +********************************************************************** +*/ +/********************************************************************* +* +* SEGGER_RTT_vprintf +* +* Function description +* Stores a formatted string in SEGGER RTT control block. +* This data is read by the host. +* +* Parameters +* BufferIndex Index of "Up"-buffer to be used. (e.g. 0 for "Terminal") +* sFormat Pointer to format string +* pParamList Pointer to the list of arguments for the format string +* +* Return values +* >= 0: Number of bytes which have been stored in the "Up"-buffer. +* < 0: Error +*/ +int SEGGER_RTT_vprintf (unsigned BufferIndex, const char * sFormat, + va_list * pParamList) +{ + char c; + SEGGER_RTT_PRINTF_DESC BufferDesc; + int v; + unsigned NumDigits; + unsigned FormatFlags; + unsigned FieldWidth; + char acBuffer[SEGGER_RTT_PRINTF_BUFFER_SIZE]; + + BufferDesc.pBuffer = acBuffer; + BufferDesc.BufferSize = SEGGER_RTT_PRINTF_BUFFER_SIZE; + BufferDesc.Cnt = 0; + BufferDesc.RTTBufferIndex = BufferIndex; + BufferDesc.ReturnValue = 0; + + do { + c = *sFormat++; + if (c == 0) { + break; + } + if (c == '%') { + // + // Filter out flags + // + FormatFlags = 0; + do { + c = *sFormat; + switch (c) { + case '-': + FormatFlags |= FORMAT_FLAG_LEFT_JUSTIFY; + sFormat++; + break; + case '0': + FormatFlags |= FORMAT_FLAG_PAD_ZERO; + sFormat++; + break; + case '+': + FormatFlags |= FORMAT_FLAG_PRINT_SIGN; + sFormat++; + break; + case '#': + FormatFlags |= FORMAT_FLAG_ALTERNATE; + sFormat++; + break; + default: + goto FilterFieldWidth; + break; + } + } while (1); + // + // filter out field with + // + FilterFieldWidth: + FieldWidth = 0; + do { + c = *sFormat; + if (c < '0' || c > '9') { + break; + } + sFormat++; + FieldWidth = FieldWidth * 10 + (c - '0'); + } while (1); + + // + // Filter out precision (number of digits to display) + // + NumDigits = 0; + c = *sFormat; + if (c == '.') { + sFormat++; + do { + c = *sFormat; + if (c < '0' || c > '9') { + break; + } + sFormat++; + NumDigits = NumDigits * 10 + (c - '0'); + } while (1); + } + // + // Filter out length modifier + // + c = *sFormat; + do { + if (c == 'l' || c == 'h') { + c = *sFormat++; + continue; + } + break; + } while (1); + // + // Handle specifiers + // + switch (c) { + case 'c': { + char c0; + v = va_arg (*pParamList, int); + c0 = (char) v; + _StoreChar (&BufferDesc, c0); + break; + } + case 'd': + v = va_arg (*pParamList, int); + _PrintInt (&BufferDesc, v, 10, NumDigits, FieldWidth, FormatFlags); + break; + case 'u': + v = va_arg (*pParamList, int); + _PrintUnsigned (&BufferDesc, v, 10, NumDigits, FieldWidth, FormatFlags); + break; + case 'x': + case 'X': + v = va_arg (*pParamList, int); + _PrintUnsigned (&BufferDesc, v, 16, NumDigits, FieldWidth, FormatFlags); + break; + case 's': { + const char * s = va_arg (*pParamList, const char *); + do { + c = *s++; + if (c == 0) { + break; + } + _StoreChar (&BufferDesc, c); + } while (BufferDesc.ReturnValue >= 0); + } + break; + case 'p': + v = va_arg (*pParamList, int); + _PrintUnsigned (&BufferDesc, v, 16, 8, 8, 0); + break; + case '%': + _StoreChar (&BufferDesc, '%'); + break; + } + sFormat++; + } else { + _StoreChar (&BufferDesc, c); + } + } while (BufferDesc.ReturnValue >= 0); + + if (BufferDesc.ReturnValue > 0) { + // + // Write remaining data, if any + // + if (BufferDesc.Cnt != 0) { + SEGGER_RTT_Write (BufferIndex, acBuffer, BufferDesc.Cnt); + } + BufferDesc.ReturnValue += BufferDesc.Cnt; + } + return BufferDesc.ReturnValue; +} + +/********************************************************************* +* +* SEGGER_RTT_printf +* +* Function description +* Stores a formatted string in SEGGER RTT control block. +* This data is read by the host. +* +* Parameters +* BufferIndex Index of "Up"-buffer to be used. (e.g. 0 for "Terminal") +* sFormat Pointer to format string, followed by the arguments for +* conversion +* +* Return values +* >= 0: Number of bytes which have been stored in the "Up"-buffer. +* < 0: Error +* +* Notes +* (1) Conversion specifications have following syntax: +* %[flags][FieldWidth][.Precision]ConversionSpecifier +* (2) Supported flags: +* -: Left justify within the field width +* +: Always print sign extension for signed conversions +* 0: Pad with 0 instead of spaces. Ignored when using '-'-flag +* or precision +* Supported conversion specifiers: +* c: Print the argument as one char +* d: Print the argument as a signed integer +* u: Print the argument as an unsigned integer +* x: Print the argument as an hexadecimal integer +* s: Print the string pointed to by the argument +* p: Print the argument as an 8-digit hexadecimal integer. +* (Argument shall be a pointer to void.) +*/ +int SEGGER_RTT_printf (unsigned BufferIndex, const char * sFormat, ...) +{ + va_list ParamList; + + va_start (ParamList, sFormat); + return SEGGER_RTT_vprintf (BufferIndex, sFormat, &ParamList); +} + +#endif + +/*! EOF */ diff --git a/XMC_UCOS3/APP_UART1_ECHO/BSP/bsp.c b/XMC_UCOS3/APP_UART1_ECHO/BSP/bsp.c new file mode 100644 index 0000000000000000000000000000000000000000..7dba3a094a7ce1ebbe06a3b87dfbcd7a0c5f19de --- /dev/null +++ b/XMC_UCOS3/APP_UART1_ECHO/BSP/bsp.c @@ -0,0 +1,38 @@ +/** + * @file bsp.c + * @brief Main board support package for uCOS-III targeting the RelaxKit board. + * + * @author Martin Horauer, UAS Technikum Wien + * @revision 0.1 + * @date 02-2015 + */ + +/******************************************************************* INCLUDES */ +#include +#include +#include +#include + +/********************************************************* FILE LOCAL DEFINES */ + +/******************************************************* FILE LOCAL CONSTANTS */ + +/*********************************************************** FILE LOCAL TYPES */ + +/********************************************************* FILE LOCAL GLOBALS */ + +/****************************************************** FILE LOCAL PROTOTYPES */ + +/****************************************************************** FUNCTIONS */ +/** + * @function BSP_Init() + * @params none + * @returns none + * @brief Initialization of the board support. + */ +void BSP_Init (void) +{ + BSP_IntInit(); + BSP_UART_Init(); +} +/** EOF */ diff --git a/XMC_UCOS3/APP_UART1_ECHO/BSP/bsp.h b/XMC_UCOS3/APP_UART1_ECHO/BSP/bsp.h new file mode 100644 index 0000000000000000000000000000000000000000..5334c03d3359284f7a5d3221f35963ec36af94b7 --- /dev/null +++ b/XMC_UCOS3/APP_UART1_ECHO/BSP/bsp.h @@ -0,0 +1,44 @@ +/** + * @file bsp.h + * @brief Main board support package for uCOS-III targeting the RelaxKit board. + * + * @author Martin Horauer, UAS Technikum Wien + * @revision 0.1 + * @date 02-2015 + */ + +#ifndef BSP_H_ +#define BSP_H_ + +#ifdef BSP_MODULE +#define BSP_EXT +#else +#define BSP_EXT extern +#endif + + +/******************************************************************* INCLUDES */ +#include +#include + +#include +#include + +#include +#include + +/****************************************************************** CONSTANTS */ + +/*********************************************************** REGISTER DEFINES */ + +/***************************************************************** DATA TYPES */ + +/************************************************************* EXPORT GLOBALS */ + +/******************************************************************** MACRO'S */ + +/******************************************************** FUNCTION PROTOTYPES */ +void BSP_Init (void); + +#endif +/*! EOF */ diff --git a/XMC_UCOS3/APP_UART1_ECHO/BSP/bsp_int.c b/XMC_UCOS3/APP_UART1_ECHO/BSP/bsp_int.c new file mode 100644 index 0000000000000000000000000000000000000000..c49df0140524e4c33db7e017f57be1660b78c5cd --- /dev/null +++ b/XMC_UCOS3/APP_UART1_ECHO/BSP/bsp_int.c @@ -0,0 +1,639 @@ +/** + * @file bsp_int.c + * @brief board support to manage interrupts + */ + +/******************************************************************* INCLUDES */ +#define BSP_INT_MODULE + +#include +#include +#include +#include +#include +#include + +#include +#include + +/********************************************************* FILE LOCAL DEFINES */ + +/******************************************************* FILE LOCAL CONSTANTS */ + +/*********************************************************** FILE LOCAL TYPES */ + +/********************************************************* FILE LOCAL GLOBALS */ +static CPU_FNCT_VOID BSP_IntVectTbl[BSP_INT_ID_MAX]; + +/* defines for UART communication */ +static uint8_t Start_of_Packet = '#'; /* in ASCII '#' */ +static uint8_t End_of_Packet = '$'; /* in ASCII '$' */ + +/****************************************************** FILE LOCAL PROTOTYPES */ +static void BSP_IntHandler (CPU_DATA int_id); +static void BSP_IntHandler_Uart_Recive (void); + +// Message Queues +extern OS_Q UART_ISR; +// Memory Block +extern OS_MEM Mem_Partition; + +/****************************************************************** FUNCTIONS */ +/** + * \function BSP_IntClr() + * \params int_id ... interrupt to clear + * \returns none + * + * \note An interrupt does not need to be cleared within the interrupt + * controller. + */ +void BSP_IntClr (CPU_DATA int_id) +{ + +} + +/** + * \function BSP_IntDis() + * \params int_id ... interrupt to disable + * \returns none + */ +void BSP_IntDis (CPU_DATA int_id) +{ + if (int_id < BSP_INT_ID_MAX) { + CPU_IntSrcDis (int_id + 16); + } +} + +/** + * \function BSP_IntDisAll() + * \params none + * \returns none + * \brief disable all interrupts + */ +void BSP_IntDisAll (void) +{ + CPU_IntDis(); +} + +/** + * \function BSP_intEn() + * \params int_id ... interrupt to enable + * \returns none + * \brief enable interrupt + */ +void BSP_IntEn (CPU_DATA int_id) +{ + if (int_id < BSP_INT_ID_MAX) { + CPU_IntSrcEn (int_id + 16); + } +} + +/** + * \function BSP_IntVectSet() + * \params int_id ... interrupt for which vector will be set + * isr ...... handler to assign + * \returns none + * \brief assign ISR handler + */ +void BSP_IntVectSet (CPU_DATA int_id, CPU_FNCT_VOID isr) +{ + CPU_SR_ALLOC(); + + if (int_id < BSP_INT_ID_MAX) { + CPU_CRITICAL_ENTER(); + BSP_IntVectTbl[int_id] = isr; + CPU_CRITICAL_EXIT(); + } +} + +/** + * \function BSP_IntPrioSet() + * \params int_id ... interrupt for which vector will be set + * prio ..... priority to assign + * \returns none + * \brief assign ISR priority + */ +void BSP_IntPrioSet (CPU_DATA int_id, CPU_INT08U prio) +{ + CPU_SR_ALLOC(); + + + if (int_id < BSP_INT_ID_MAX) { + CPU_CRITICAL_ENTER(); + CPU_IntSrcPrioSet (int_id + 16, prio); + CPU_CRITICAL_EXIT(); + } +} + +/** + * \function BSP_IntInit() + * \params none + * \returns none + * \brief initialize interrupts + */ +void BSP_IntInit (void) +{ + BSP_IntVectSet (USIC1_1_IRQn, BSP_IntHandler_Uart_Recive); //** + BSP_IntVectSet (USIC1_0_IRQn, BSP_IntHandler_Uart_Recive); //** +} + +/** + * \function BSP_IntHandler_Uart_Recive() + * \params none + * \returns none + * \brief UART interrupt handler + * https://doc.micrium.com/display/osiiidoc/Keeping+the+Data+in+Scope + */ +static void BSP_IntHandler_Uart_Recive (void) +{ + OS_ERR err; + CPU_CHAR RxData; + static CPU_CHAR *RxDataPtr = NULL ; + static CPU_INT32U RxDataCtr = 0; + static CPU_CHAR msg_receiving = 0; + + // receive byte + RxData = XMC_UART_CH_GetReceivedData (XMC_UART1_CH1); // <1> + + // is the character a "start of packet" character? // <2> + if ( ( (int) RxData == Start_of_Packet) && msg_receiving == 0) { + // allocate a memory block + RxDataPtr = (CPU_CHAR *) OSMemGet (&Mem_Partition, &err); + if (err != OS_ERR_NONE) + APP_TRACE_DBG ("Error OSMemGet: BSP_IntHandler_Uart_Recive\n"); + else + msg_receiving = 1; + } + + // receive characters and put them into the memory partition // <3> + // until we detect and "end of packet character" + // NOTE: the message itself may also contain a "start of packet character" + // but no "end of packet character" + if ( ( (int) RxData != Start_of_Packet) && ( (int) RxData != End_of_Packet) + && msg_receiving == 1) { + // put byte into the memory partition at the respective address + *RxDataPtr = RxData; + // increment the address to point to the next location + RxDataPtr++; + // increment the receive counter + RxDataCtr++; + } + + // is the character a "end of packet" character? // <4> + if ( ( (int) RxData == End_of_Packet) && msg_receiving == 1) { + // send the message to the application task - to that end put a pointer to + // the memory block into the queue to the application task + OSQPost ( (OS_Q *) &UART_ISR, + (void *) (RxDataPtr - RxDataCtr), + (OS_MSG_SIZE) RxDataCtr + 1, + (OS_OPT) OS_OPT_POST_FIFO, + (OS_ERR *) &err); + if (err != OS_ERR_NONE) + APP_TRACE_DBG ("Error OSQPost: BSP_IntHandler_Uart_Recive\n"); + + // clear the receive pointer and counter // <5> + RxDataPtr = NULL; + RxDataCtr = 0; + // ready for a next message + msg_receiving = 0; + } +} + +/** + * \function BSP_IntHandler####() + * \params none + * \returns none + * \brief handle an interrupt + */ +void BSP_IntHandlerSCU (void) +{ + BSP_IntHandler (BSP_INT_ID_SCU); +} +void BSP_IntHandlerERU0_00 (void) +{ + BSP_IntHandler (BSP_INT_ID_ERU0_00); +} +void BSP_IntHandlerERU0_01 (void) +{ + BSP_IntHandler (BSP_INT_ID_ERU0_01); +} +void BSP_IntHandlerERU0_02 (void) +{ + BSP_IntHandler (BSP_INT_ID_ERU0_02); +} +void BSP_IntHandlerERU0_03 (void) +{ + BSP_IntHandler (BSP_INT_ID_ERU0_03); +} +void BSP_IntHandlerERU1_00 (void) +{ + BSP_IntHandler (BSP_INT_ID_ERU1_00); +} +void BSP_IntHandlerERU1_01 (void) +{ + BSP_IntHandler (BSP_INT_ID_ERU1_01); +} +void BSP_IntHandlerERU1_02 (void) +{ + BSP_IntHandler (BSP_INT_ID_ERU1_02); +} +void BSP_IntHandlerERU1_03 (void) +{ + BSP_IntHandler (BSP_INT_ID_ERU1_03); +} +void BSP_IntHandlerPMU0_00 (void) +{ + BSP_IntHandler (BSP_INT_ID_PMU0_00); +} +void BSP_IntHandlerVADC0_C0_00 (void) +{ + BSP_IntHandler (BSP_INT_ID_VADC0_C0_00); +} +void BSP_IntHandlerVADC0_C0_01 (void) +{ + BSP_IntHandler (BSP_INT_ID_VADC0_C0_01); +} +void BSP_IntHandlerVADC0_C0_02 (void) +{ + BSP_IntHandler (BSP_INT_ID_VADC0_C0_02); +} +void BSP_IntHandlerVADC0_C0_03 (void) +{ + BSP_IntHandler (BSP_INT_ID_VADC0_C0_03); +} +void BSP_IntHandlerVADC0_G0_00 (void) +{ + BSP_IntHandler (BSP_INT_ID_VADC0_G0_00); +} +void BSP_IntHandlerVADC0_G0_01 (void) +{ + BSP_IntHandler (BSP_INT_ID_VADC0_G0_01); +} +void BSP_IntHandlerVADC0_G0_02 (void) +{ + BSP_IntHandler (BSP_INT_ID_VADC0_G0_02); +} +void BSP_IntHandlerVADC0_G0_03 (void) +{ + BSP_IntHandler (BSP_INT_ID_VADC0_G0_03); +} +void BSP_IntHandlerVADC0_G1_00 (void) +{ + BSP_IntHandler (BSP_INT_ID_VADC0_G1_00); +} +void BSP_IntHandlerVADC0_G1_01 (void) +{ + BSP_IntHandler (BSP_INT_ID_VADC0_G1_01); +} +void BSP_IntHandlerVADC0_G1_02 (void) +{ + BSP_IntHandler (BSP_INT_ID_VADC0_G1_02); +} +void BSP_IntHandlerVADC0_G1_03 (void) +{ + BSP_IntHandler (BSP_INT_ID_VADC0_G1_03); +} +void BSP_IntHandlerVADC0_G2_00 (void) +{ + BSP_IntHandler (BSP_INT_ID_VADC0_G2_00); +} +void BSP_IntHandlerVADC0_G2_01 (void) +{ + BSP_IntHandler (BSP_INT_ID_VADC0_G2_01); +} +void BSP_IntHandlerVADC0_G2_02 (void) +{ + BSP_IntHandler (BSP_INT_ID_VADC0_G2_02); +} +void BSP_IntHandlerVADC0_G2_03 (void) +{ + BSP_IntHandler (BSP_INT_ID_VADC0_G2_03); +} +void BSP_IntHandlerVADC0_G3_00 (void) +{ + BSP_IntHandler (BSP_INT_ID_VADC0_G3_00); +} +void BSP_IntHandlerVADC0_G3_01 (void) +{ + BSP_IntHandler (BSP_INT_ID_VADC0_G3_01); +} +void BSP_IntHandlerVADC0_G3_02 (void) +{ + BSP_IntHandler (BSP_INT_ID_VADC0_G3_02); +} +void BSP_IntHandlerVADC0_G3_03 (void) +{ + BSP_IntHandler (BSP_INT_ID_VADC0_G3_03); +} +void BSP_IntHandlerDSD0_00 (void) +{ + BSP_IntHandler (BSP_INT_ID_DSD0_00); +} +void BSP_IntHandlerDSD0_01 (void) +{ + BSP_IntHandler (BSP_INT_ID_DSD0_01); +} +void BSP_IntHandlerDSD0_02 (void) +{ + BSP_IntHandler (BSP_INT_ID_DSD0_02); +} +void BSP_IntHandlerDSD0_03 (void) +{ + BSP_IntHandler (BSP_INT_ID_DSD0_03); +} +void BSP_IntHandlerDSD0_04 (void) +{ + BSP_IntHandler (BSP_INT_ID_DSD0_04); +} +void BSP_IntHandlerDSD0_05 (void) +{ + BSP_IntHandler (BSP_INT_ID_DSD0_05); +} +void BSP_IntHandlerDSD0_06 (void) +{ + BSP_IntHandler (BSP_INT_ID_DSD0_06); +} +void BSP_IntHandlerDSD0_07 (void) +{ + BSP_IntHandler (BSP_INT_ID_DSD0_07); +} +void BSP_IntHandlerDAC0_00 (void) +{ + BSP_IntHandler (BSP_INT_ID_DAC0_00); +} +void BSP_IntHandlerDAC0_01 (void) +{ + BSP_IntHandler (BSP_INT_ID_DAC0_01); +} +void BSP_IntHandlerCCU40_00 (void) +{ + BSP_IntHandler (BSP_INT_ID_CCU40_00); +} +void BSP_IntHandlerCCU40_01 (void) +{ + BSP_IntHandler (BSP_INT_ID_CCU40_01); +} +void BSP_IntHandlerCCU40_02 (void) +{ + BSP_IntHandler (BSP_INT_ID_CCU40_02); +} +void BSP_IntHandlerCCU40_03 (void) +{ + BSP_IntHandler (BSP_INT_ID_CCU40_03); +} +void BSP_IntHandlerCCU41_00 (void) +{ + BSP_IntHandler (BSP_INT_ID_CCU41_00); +} +void BSP_IntHandlerCCU41_01 (void) +{ + BSP_IntHandler (BSP_INT_ID_CCU41_01); +} +void BSP_IntHandlerCCU41_02 (void) +{ + BSP_IntHandler (BSP_INT_ID_CCU41_02); +} +void BSP_IntHandlerCCU41_03 (void) +{ + BSP_IntHandler (BSP_INT_ID_CCU41_03); +} +void BSP_IntHandlerCCU42_00 (void) +{ + BSP_IntHandler (BSP_INT_ID_CCU42_00); +} +void BSP_IntHandlerCCU42_01 (void) +{ + BSP_IntHandler (BSP_INT_ID_CCU42_01); +} +void BSP_IntHandlerCCU42_02 (void) +{ + BSP_IntHandler (BSP_INT_ID_CCU42_02); +} +void BSP_IntHandlerCCU42_03 (void) +{ + BSP_IntHandler (BSP_INT_ID_CCU42_03); +} +void BSP_IntHandlerCCU43_00 (void) +{ + BSP_IntHandler (BSP_INT_ID_CCU43_00); +} +void BSP_IntHandlerCCU43_01 (void) +{ + BSP_IntHandler (BSP_INT_ID_CCU43_01); +} +void BSP_IntHandlerCCU43_02 (void) +{ + BSP_IntHandler (BSP_INT_ID_CCU43_02); +} +void BSP_IntHandlerCCU43_03 (void) +{ + BSP_IntHandler (BSP_INT_ID_CCU43_03); +} +void BSP_IntHandlerCCU80_00 (void) +{ + BSP_IntHandler (BSP_INT_ID_CCU80_00); +} +void BSP_IntHandlerCCU80_01 (void) +{ + BSP_IntHandler (BSP_INT_ID_CCU80_01); +} +void BSP_IntHandlerCCU80_02 (void) +{ + BSP_IntHandler (BSP_INT_ID_CCU80_02); +} +void BSP_IntHandlerCCU80_03 (void) +{ + BSP_IntHandler (BSP_INT_ID_CCU80_03); +} +void BSP_IntHandlerCCU81_00 (void) +{ + BSP_IntHandler (BSP_INT_ID_CCU81_00); +} +void BSP_IntHandlerCCU81_01 (void) +{ + BSP_IntHandler (BSP_INT_ID_CCU81_01); +} +void BSP_IntHandlerCCU81_02 (void) +{ + BSP_IntHandler (BSP_INT_ID_CCU81_02); +} +void BSP_IntHandlerCCU81_03 (void) +{ + BSP_IntHandler (BSP_INT_ID_CCU81_03); +} +void BSP_IntHandlerPOSIF0_00 (void) +{ + BSP_IntHandler (BSP_INT_ID_POSIF0_00); +} +void BSP_IntHandlerPOSIF0_01 (void) +{ + BSP_IntHandler (BSP_INT_ID_POSIF0_01); +} +void BSP_IntHandlerPOSIF1_00 (void) +{ + BSP_IntHandler (BSP_INT_ID_POSIF1_00); +} +void BSP_IntHandlerPOSIF1_01 (void) +{ + BSP_IntHandler (BSP_INT_ID_POSIF1_01); +} +void BSP_IntHandlerCAN0_00 (void) +{ + BSP_IntHandler (BSP_INT_ID_CAN0_00); +} +void BSP_IntHandlerCAN0_01 (void) +{ + BSP_IntHandler (BSP_INT_ID_CAN0_01); +} +void BSP_IntHandlerCAN0_02 (void) +{ + BSP_IntHandler (BSP_INT_ID_CAN0_02); +} +void BSP_IntHandlerCAN0_03 (void) +{ + BSP_IntHandler (BSP_INT_ID_CAN0_03); +} +void BSP_IntHandlerCAN0_04 (void) +{ + BSP_IntHandler (BSP_INT_ID_CAN0_04); +} +void BSP_IntHandlerCAN0_05 (void) +{ + BSP_IntHandler (BSP_INT_ID_CAN0_05); +} +void BSP_IntHandlerCAN0_06 (void) +{ + BSP_IntHandler (BSP_INT_ID_CAN0_06); +} +void BSP_IntHandlerCAN0_07 (void) +{ + BSP_IntHandler (BSP_INT_ID_CAN0_07); +} +void BSP_IntHandlerUSIC0_00 (void) +{ + BSP_IntHandler (BSP_INT_ID_USIC0_00); +} +void BSP_IntHandlerUSIC0_01 (void) +{ + BSP_IntHandler (BSP_INT_ID_USIC0_01); +} +void BSP_IntHandlerUSIC0_02 (void) +{ + BSP_IntHandler (BSP_INT_ID_USIC0_02); +} +void BSP_IntHandlerUSIC0_03 (void) +{ + BSP_IntHandler (BSP_INT_ID_USIC0_03); +} +void BSP_IntHandlerUSIC0_04 (void) +{ + BSP_IntHandler (BSP_INT_ID_USIC0_04); +} +void BSP_IntHandlerUSIC0_05 (void) +{ + BSP_IntHandler (BSP_INT_ID_USIC0_05); +} +void BSP_IntHandlerUSIC1_00 (void) +{ + BSP_IntHandler (BSP_INT_ID_USIC1_00); +} +void BSP_IntHandlerUSIC1_01 (void) +{ + BSP_IntHandler (BSP_INT_ID_USIC1_01); +} +void BSP_IntHandlerUSIC1_02 (void) +{ + BSP_IntHandler (BSP_INT_ID_USIC1_02); +} +void BSP_IntHandlerUSIC1_03 (void) +{ + BSP_IntHandler (BSP_INT_ID_USIC1_03); +} +void BSP_IntHandlerUSIC1_04 (void) +{ + BSP_IntHandler (BSP_INT_ID_USIC1_04); +} +void BSP_IntHandlerUSIC1_05 (void) +{ + BSP_IntHandler (BSP_INT_ID_USIC1_05); +} +void BSP_IntHandlerUSIC2_00 (void) +{ + BSP_IntHandler (BSP_INT_ID_USIC2_00); +} +void BSP_IntHandlerUSIC2_01 (void) +{ + BSP_IntHandler (BSP_INT_ID_USIC2_01); +} +void BSP_IntHandlerUSIC2_02 (void) +{ + BSP_IntHandler (BSP_INT_ID_USIC2_02); +} +void BSP_IntHandlerUSIC2_03 (void) +{ + BSP_IntHandler (BSP_INT_ID_USIC2_03); +} +void BSP_IntHandlerUSIC2_04 (void) +{ + BSP_IntHandler (BSP_INT_ID_USIC2_04); +} +void BSP_IntHandlerUSIC2_05 (void) +{ + BSP_IntHandler (BSP_INT_ID_USIC2_05); +} +void BSP_IntHandlerLEDTS0_00 (void) +{ + BSP_IntHandler (BSP_INT_ID_LEDTS0_00); +} +void BSP_IntHandlerFCE0_00 (void) +{ + BSP_IntHandler (BSP_INT_ID_FCE0_00); +} +void BSP_IntHandlerGPDMA0_00 (void) +{ + BSP_IntHandler (BSP_INT_ID_GPDMA0_00); +} +void BSP_IntHandlerSDMMC0_00 (void) +{ + BSP_IntHandler (BSP_INT_ID_SDMMC0_00); +} +void BSP_IntHandlerUSB0_00 (void) +{ + BSP_IntHandler (BSP_INT_ID_USB0_00); +} +void BSP_IntHandlerETH0_00 (void) +{ + BSP_IntHandler (BSP_INT_ID_ETH0_00); +} +void BSP_IntHandlerGPDMA1_00 (void) +{ + BSP_IntHandler (BSP_INT_ID_GPDMA1_00); +} + +/** + * \function BSP_IntHandler####() + * \params int_id interrupt that will be handled + * \returns none + * \brief central interrupt handler + */ +static void BSP_IntHandler (CPU_DATA int_id) +{ + CPU_FNCT_VOID isr; + CPU_SR_ALLOC(); + + /* tell the OS that we are starting an ISR */ + CPU_CRITICAL_ENTER(); + OSIntEnter(); + CPU_CRITICAL_EXIT(); + + if (int_id < BSP_INT_ID_MAX) { + isr = BSP_IntVectTbl[int_id]; + if (isr != (CPU_FNCT_VOID) 0) { + isr(); + } + } + /* tell the OS that we are leaving an ISR */ + OSIntExit(); +} + +/*! EOF */ diff --git a/XMC_UCOS3/APP_UART1_ECHO/BSP/bsp_int.h b/XMC_UCOS3/APP_UART1_ECHO/BSP/bsp_int.h new file mode 100644 index 0000000000000000000000000000000000000000..e79b91fdca378bef46324f7708bd4d1d7217badb --- /dev/null +++ b/XMC_UCOS3/APP_UART1_ECHO/BSP/bsp_int.h @@ -0,0 +1,261 @@ +/** + * @file bsp_int.h + * @brief board support to manage interrupts + */ +#ifndef BSP_INT_PRESENT +#define BSP_INT_PRESENT + +#ifdef BSP_INT_MODULE +#define BSP_INT_EXT +#else +#define BSP_INT_EXT extern +#endif + +/******************************************************************** DEFINES */ +/* INTERRUPT PRIORITY DEFINES */ +#define BSP_INT_PRIO_LEVEL_MASK DEF_BIT_MASK(7, 0) +#define BSP_INT_PRIO_LEVEL_00 0u +#define BSP_INT_PRIO_LEVEL_01 1u +#define BSP_INT_PRIO_LEVEL_02 2u +#define BSP_INT_PRIO_LEVEL_03 3u + +/******************************************************************** DEFINES */ +#define BSP_INT_ID_SCU 0u +#define BSP_INT_ID_ERU0_00 1u +#define BSP_INT_ID_ERU0_01 2u +#define BSP_INT_ID_ERU0_02 3u +#define BSP_INT_ID_ERU0_03 4u +#define BSP_INT_ID_ERU1_00 5u +#define BSP_INT_ID_ERU1_01 6u +#define BSP_INT_ID_ERU1_02 7u +#define BSP_INT_ID_ERU1_03 8u + +#define BSP_INT_ID_RSVD_00 9u +#define BSP_INT_ID_RSVD_01 10u +#define BSP_INT_ID_RSVD_02 11u +#define BSP_INT_ID_PMU0_00 12u +#define BSP_INT_ID_RSVD_03 13u + +#define BSP_INT_ID_VADC0_C0_00 14u +#define BSP_INT_ID_VADC0_C0_01 15u +#define BSP_INT_ID_VADC0_C0_02 16u +#define BSP_INT_ID_VADC0_C0_03 17u + +#define BSP_INT_ID_VADC0_G0_00 18u +#define BSP_INT_ID_VADC0_G0_01 19u +#define BSP_INT_ID_VADC0_G0_02 20u +#define BSP_INT_ID_VADC0_G0_03 21u +#define BSP_INT_ID_VADC0_G1_00 22u +#define BSP_INT_ID_VADC0_G1_01 23u +#define BSP_INT_ID_VADC0_G1_02 24u +#define BSP_INT_ID_VADC0_G1_03 25u +#define BSP_INT_ID_VADC0_G2_00 26u +#define BSP_INT_ID_VADC0_G2_01 27u +#define BSP_INT_ID_VADC0_G2_02 28u +#define BSP_INT_ID_VADC0_G2_03 29u +#define BSP_INT_ID_VADC0_G3_00 30u +#define BSP_INT_ID_VADC0_G3_01 31u +#define BSP_INT_ID_VADC0_G3_02 32u +#define BSP_INT_ID_VADC0_G3_03 33u + +#define BSP_INT_ID_DSD0_00 34u +#define BSP_INT_ID_DSD0_01 35u +#define BSP_INT_ID_DSD0_02 36u +#define BSP_INT_ID_DSD0_03 37u +#define BSP_INT_ID_DSD0_04 38u +#define BSP_INT_ID_DSD0_05 39u +#define BSP_INT_ID_DSD0_06 40u +#define BSP_INT_ID_DSD0_07 41u + +#define BSP_INT_ID_DAC0_00 42u +#define BSP_INT_ID_DAC0_01 43u + +#define BSP_INT_ID_CCU40_00 44u +#define BSP_INT_ID_CCU40_01 45u +#define BSP_INT_ID_CCU40_02 46u +#define BSP_INT_ID_CCU40_03 47u +#define BSP_INT_ID_CCU41_00 48u +#define BSP_INT_ID_CCU41_01 49u +#define BSP_INT_ID_CCU41_02 50u +#define BSP_INT_ID_CCU41_03 51u +#define BSP_INT_ID_CCU42_00 52u +#define BSP_INT_ID_CCU42_01 53u +#define BSP_INT_ID_CCU42_02 54u +#define BSP_INT_ID_CCU42_03 55u +#define BSP_INT_ID_CCU43_00 56u +#define BSP_INT_ID_CCU43_01 57u +#define BSP_INT_ID_CCU43_02 58u +#define BSP_INT_ID_CCU43_03 59u + +#define BSP_INT_ID_CCU80_00 60u +#define BSP_INT_ID_CCU80_01 61u +#define BSP_INT_ID_CCU80_02 62u +#define BSP_INT_ID_CCU80_03 63u +#define BSP_INT_ID_CCU81_00 64u +#define BSP_INT_ID_CCU81_01 65u +#define BSP_INT_ID_CCU81_02 66u +#define BSP_INT_ID_CCU81_03 67u + +#define BSP_INT_ID_POSIF0_00 68u +#define BSP_INT_ID_POSIF0_01 69u +#define BSP_INT_ID_POSIF1_00 70u +#define BSP_INT_ID_POSIF1_01 71u + +#define BSP_INT_ID_RSVD_04 72u +#define BSP_INT_ID_RSVD_05 73u +#define BSP_INT_ID_RSVD_06 74u +#define BSP_INT_ID_RSVD_07 75u + +#define BSP_INT_ID_CAN0_00 76u +#define BSP_INT_ID_CAN0_01 77u +#define BSP_INT_ID_CAN0_02 78u +#define BSP_INT_ID_CAN0_03 79u +#define BSP_INT_ID_CAN0_04 80u +#define BSP_INT_ID_CAN0_05 81u +#define BSP_INT_ID_CAN0_06 82u +#define BSP_INT_ID_CAN0_07 83u +#define BSP_INT_ID_USIC0_00 84u +#define BSP_INT_ID_USIC0_01 85u +#define BSP_INT_ID_USIC0_02 86u +#define BSP_INT_ID_USIC0_03 87u +#define BSP_INT_ID_USIC0_04 88u +#define BSP_INT_ID_USIC0_05 89u +#define BSP_INT_ID_USIC1_00 90u +#define BSP_INT_ID_USIC1_01 91u +#define BSP_INT_ID_USIC1_02 92u +#define BSP_INT_ID_USIC1_03 93u +#define BSP_INT_ID_USIC1_04 94u +#define BSP_INT_ID_USIC1_05 95u +#define BSP_INT_ID_USIC2_00 96u +#define BSP_INT_ID_USIC2_01 97u +#define BSP_INT_ID_USIC2_02 98u +#define BSP_INT_ID_USIC2_03 99u +#define BSP_INT_ID_USIC2_04 100u +#define BSP_INT_ID_USIC2_05 101u + +#define BSP_INT_ID_LEDTS0_00 102u +#define BSP_INT_ID_RSVD_08 103u +#define BSP_INT_ID_FCE0_00 104u +#define BSP_INT_ID_GPDMA0_00 105u +#define BSP_INT_ID_SDMMC0_00 106u +#define BSP_INT_ID_USB0_00 107u +#define BSP_INT_ID_ETH0_00 108u +#define BSP_INT_ID_RSVD_09 109u +#define BSP_INT_ID_GPDMA1_00 110u +#define BSP_INT_ID_RSVD_10 111u + +#define BSP_INT_ID_MAX 112u + +/***************************************************************** PROTOTYPES */ +void BSP_IntInit (void); +void BSP_IntEn (CPU_DATA int_id); +void BSP_IntDis (CPU_DATA int_id); +void BSP_IntDisAll (void); +void BSP_IntClr (CPU_DATA int_id); +void BSP_IntVectSet (CPU_DATA int_id, CPU_FNCT_VOID isr); +void BSP_IntPrioSet (CPU_DATA int_id, CPU_INT08U prio); + +void BSP_IntHandlerSCU (void); +void BSP_IntHandlerERU0_00 (void); +void BSP_IntHandlerERU0_01 (void); +void BSP_IntHandlerERU0_02 (void); +void BSP_IntHandlerERU0_03 (void); +void BSP_IntHandlerERU1_00 (void); +void BSP_IntHandlerERU1_01 (void); +void BSP_IntHandlerERU1_02 (void); +void BSP_IntHandlerERU1_03 (void); +void BSP_IntHandlerPMU0_00 (void); +void BSP_IntHandlerVADC0_C0_00 (void); +void BSP_IntHandlerVADC0_C0_01 (void); +void BSP_IntHandlerVADC0_C0_02 (void); +void BSP_IntHandlerVADC0_C0_03 (void); +void BSP_IntHandlerVADC0_G0_00 (void); +void BSP_IntHandlerVADC0_G0_01 (void); +void BSP_IntHandlerVADC0_G0_02 (void); +void BSP_IntHandlerVADC0_G0_03 (void); +void BSP_IntHandlerVADC0_G1_00 (void); +void BSP_IntHandlerVADC0_G1_01 (void); +void BSP_IntHandlerVADC0_G1_02 (void); +void BSP_IntHandlerVADC0_G1_03 (void); +void BSP_IntHandlerVADC0_G2_00 (void); +void BSP_IntHandlerVADC0_G2_01 (void); +void BSP_IntHandlerVADC0_G2_02 (void); +void BSP_IntHandlerVADC0_G2_03 (void); +void BSP_IntHandlerVADC0_G3_00 (void); +void BSP_IntHandlerVADC0_G3_01 (void); +void BSP_IntHandlerVADC0_G3_02 (void); +void BSP_IntHandlerVADC0_G3_03 (void); +void BSP_IntHandlerDSD0_00 (void); +void BSP_IntHandlerDSD0_01 (void); +void BSP_IntHandlerDSD0_02 (void); +void BSP_IntHandlerDSD0_03 (void); +void BSP_IntHandlerDSD0_04 (void); +void BSP_IntHandlerDSD0_05 (void); +void BSP_IntHandlerDSD0_06 (void); +void BSP_IntHandlerDSD0_07 (void); +void BSP_IntHandlerDAC0_00 (void); +void BSP_IntHandlerDAC0_01 (void); +void BSP_IntHandlerCCU40_00 (void); +void BSP_IntHandlerCCU40_01 (void); +void BSP_IntHandlerCCU40_02 (void); +void BSP_IntHandlerCCU40_03 (void); +void BSP_IntHandlerCCU41_00 (void); +void BSP_IntHandlerCCU41_01 (void); +void BSP_IntHandlerCCU41_02 (void); +void BSP_IntHandlerCCU41_03 (void); +void BSP_IntHandlerCCU42_00 (void); +void BSP_IntHandlerCCU42_01 (void); +void BSP_IntHandlerCCU42_02 (void); +void BSP_IntHandlerCCU42_03 (void); +void BSP_IntHandlerCCU43_00 (void); +void BSP_IntHandlerCCU43_01 (void); +void BSP_IntHandlerCCU43_02 (void); +void BSP_IntHandlerCCU43_03 (void); +void BSP_IntHandlerCCU80_00 (void); +void BSP_IntHandlerCCU80_01 (void); +void BSP_IntHandlerCCU80_02 (void); +void BSP_IntHandlerCCU80_03 (void); +void BSP_IntHandlerCCU81_00 (void); +void BSP_IntHandlerCCU81_01 (void); +void BSP_IntHandlerCCU81_02 (void); +void BSP_IntHandlerCCU81_03 (void); +void BSP_IntHandlerPOSIF0_00 (void); +void BSP_IntHandlerPOSIF0_01 (void); +void BSP_IntHandlerPOSIF1_00 (void); +void BSP_IntHandlerPOSIF1_01 (void); +void BSP_IntHandlerCAN0_00 (void); +void BSP_IntHandlerCAN0_01 (void); +void BSP_IntHandlerCAN0_02 (void); +void BSP_IntHandlerCAN0_03 (void); +void BSP_IntHandlerCAN0_04 (void); +void BSP_IntHandlerCAN0_05 (void); +void BSP_IntHandlerCAN0_06 (void); +void BSP_IntHandlerCAN0_07 (void); +void BSP_IntHandlerUSIC0_00 (void); +void BSP_IntHandlerUSIC0_01 (void); +void BSP_IntHandlerUSIC0_02 (void); +void BSP_IntHandlerUSIC0_03 (void); +void BSP_IntHandlerUSIC0_04 (void); +void BSP_IntHandlerUSIC0_05 (void); +void BSP_IntHandlerUSIC1_00 (void); +void BSP_IntHandlerUSIC1_01 (void); +void BSP_IntHandlerUSIC1_02 (void); +void BSP_IntHandlerUSIC1_03 (void); +void BSP_IntHandlerUSIC1_04 (void); +void BSP_IntHandlerUSIC1_05 (void); +void BSP_IntHandlerUSIC2_00 (void); +void BSP_IntHandlerUSIC2_01 (void); +void BSP_IntHandlerUSIC2_02 (void); +void BSP_IntHandlerUSIC2_03 (void); +void BSP_IntHandlerUSIC2_04 (void); +void BSP_IntHandlerUSIC2_05 (void); +void BSP_IntHandlerLEDTS0_00 (void); +void BSP_IntHandlerFCE0_00 (void); +void BSP_IntHandlerGPDMA0_00 (void); +void BSP_IntHandlerSDMMC0_00 (void); +void BSP_IntHandlerUSB0_00 (void); +void BSP_IntHandlerETH0_00 (void); +void BSP_IntHandlerGPDMA1_00 (void); + +#endif +/*! EOF */ diff --git a/XMC_UCOS3/APP_UART1_ECHO/BSP/bsp_sys.c b/XMC_UCOS3/APP_UART1_ECHO/BSP/bsp_sys.c new file mode 100644 index 0000000000000000000000000000000000000000..d04a2ed5a53bc2eb2b37ce4079b304baa196fb53 --- /dev/null +++ b/XMC_UCOS3/APP_UART1_ECHO/BSP/bsp_sys.c @@ -0,0 +1,232 @@ +/** + * @file bsp_sys.c + * + * @brief Board Support Functions to initialize the CPU (PLL, Clock, etc.) + */ + +/******************************************************************* INCLUDES */ +#include +#include +#include + +/********************************************************* FILE LOCAL DEFINES */ +#define BSP_REG_VAL_TO 0x7FFFF + +#define BSP_PLLCON1_K1DIV 1 +#define BSP_PLLCON1_NDIV 40 +#define BSP_PLLCON1_PDIV 1 +#define BSP_PLLCON1_K2DIV_STEP1 20 +#define BSP_PLLCON1_K2DIV_STEP2 8 +#define BSP_PLLCON1_K2DIV_STEP3 5 +#define BSP_PLLCON1_K2DIV_FINAL 4 +#define BSP_PLLCON1_K2DIV_MASK DEF_BIT_FIELD(7u, 16u) + + +/******************************************************* FILE LOCAL CONSTANTS */ + +/*********************************************************** FILE LOCAL TYPES */ + +/********************************************************* FILE LOCAL GLOBALS */ + +/****************************************************** FILE LOCAL PROTOTYPES */ + +/****************************************************************** FUNCTIONS */ + + +/** + * @function BSP_LowLevelInit() + * @params none + * @returns none + * + * @brief Board Support Package Low Level Initialization + * + * @note Problems with Branch prediction if accessing the flash via the cached + * memory interface. In this silicon(step A11), branch prediction has to + * be switched off by setting PCON.PBS = 1. + */ +void BSP_LowLevelInit (void) +{ + CPU_INT32U reg_val; + + /* Disable Watchdog timer */ + DEF_BIT_CLR (BSP_REG_WDT_CTR, BSP_BIT_WDT_CTR_ENB); + DEF_BIT_SET (BSP_REG_PREF_PCON, BSP_BIT_PREF_PCON_PBS); + + reg_val = BSP_REG_FLASH0_FCON; + reg_val = 0x3; + BSP_REG_FLASH0_FCON = reg_val; + + BSP_SysInit(); +} + +/** + * @function BSP_SysInit() + * @params none + * @returns none + * + * @brief This function should be called early in the BSP initialization process + * + * @note Once the Normal Mode is entered, then the intended PLL output target + * frequency can be configured by changing only the K2-Divider. This can + * result in multiple changes of the K2-Divider to avoid big frequency + * changes. Between the update of two K2-divider values 6 cycles of fpll + * should be waited. + */ +void BSP_SysInit (void) +{ + CPU_INT32U reg_to; + CPU_INT32U reg; + + /* Set VCO and PLL power saving mode to normal behavior */ + DEF_BIT_CLR (BSP_REG_SCU_PLLCON0, (BSP_BIT_PLLCON0_VCOPWD | + BSP_BIT_PLLCON0_PLLPWD)); + + reg = BSP_REG_SCU_OSCHPCTRL; + /* Set Ext. Crystal mod; osc power saving isn't entered */ + DEF_BIT_CLR (reg, (BSP_BIT_OSCHPCTRL_MODE_MASK | + BSP_BIT_OSCHPCTRL_OSCVAL_MASK)); + /* Cfg. foscref = fosc / (OSCVAL + 1) */ + DEF_BIT_SET (reg, BSP_BIT_OSCHPCTRL_OSCVAL); + BSP_REG_SCU_OSCHPCTRL = reg; + + /* Set ext. osc as PLL input */ + DEF_BIT_CLR (BSP_REG_SCU_PLLCON2, BSP_BIT_PLLCON2_PINSEL); + /* Restart osc watchdog of the PLL */ + DEF_BIT_CLR (BSP_REG_SCU_PLLCON0, BSP_BIT_PLLCON0_OSCRES); + /* Wait for stable OSC frequency */ + reg_to = BSP_REG_VAL_TO; + while ( (DEF_BIT_IS_CLR (BSP_REG_SCU_PLLSTAT, (BSP_BIT_PLLSTAT_PLLLV | + BSP_BIT_PLLSTAT_PLLHV | + BSP_BIT_PLLSTAT_PLLSP))) & + (reg_to > 0u)) { + reg_to--; + } + if (reg_to == 0u) { + while (DEF_TRUE); + } + /* ---------------- PLL CONFIGURATION ----------------- */ + /* Select OSC_FI as system clk */ + BSP_REG_SCU_SYSCLKCR = BSP_BIT_SYSCLKCR_OSC_FI; + /* PLL is bypassed */ + DEF_BIT_SET (BSP_REG_SCU_PLLCON0, BSP_BIT_PLLCON0_VCOBYP); + /* Disconnect OSC_HP from PLL */ + DEF_BIT_SET (BSP_REG_SCU_PLLCON0, BSP_BIT_PLLCON0_FINDIS); + + /* fpll = (NDIV * fosc) / (PDIV * K2DIV)) */ + /* = (40 * 12MHz) / (1 * 20)) = 24MHz */ + BSP_REG_SCU_PLLCON1 = ( ( (BSP_PLLCON1_K1DIV - 1u) << 0u) + | ( (BSP_PLLCON1_NDIV - 1u) << 8u) + | ( (BSP_PLLCON1_K2DIV_STEP1 - 1u) << 16u) + | ( (BSP_PLLCON1_PDIV - 1u) << 24u)); + + /* Keeps OSC clk conn. to VCO in case of Loss-of-lock */ + BSP_REG_SCU_PLLCON0 |= BSP_BIT_PLLCON0_OSCDISCDIS; + /* Connect OSC_HP to PLL */ + DEF_BIT_CLR (BSP_REG_SCU_PLLCON0, BSP_BIT_PLLCON0_FINDIS); + /* Restart PLL lock detection */ + DEF_BIT_SET (BSP_REG_SCU_PLLCON0, BSP_BIT_PLLCON0_RESLD); + + /* Wait for PLL Lock */ + reg_to = BSP_REG_VAL_TO; + while ( (DEF_BIT_IS_CLR (BSP_REG_SCU_PLLSTAT, BSP_BIT_PLLSTAT_VCOLOCK)) & + (reg_to > 0u)) { + reg_to--; + } + if (reg_to == 0u) { + while (DEF_TRUE); + } + + /* Normal opertaion, PLL is not bypassed */ + DEF_BIT_CLR (BSP_REG_SCU_PLLCON0, BSP_BIT_PLLCON0_VCOBYP); + /* Enable MMC clock */ + DEF_BIT_SET (BSP_REG_SCU_CLKSET, BSP_BIT_CLKSET_MMCEN); + /* fcpu = fsys */ + DEF_BIT_CLR (BSP_REG_SCU_CPUCLKCR, BSP_BIT_CPUCLKCR_CPUDIV); + /* fpb = fsys */ + DEF_BIT_CLR (BSP_REG_SCU_PBCLKCR, BSP_BIT_PBCLKCR_PBDIV); + /* fccu = fsys */ + DEF_BIT_CLR (BSP_REG_SCU_CCUCLKCR, BSP_BIT_CCUCLKCR_CCUDIV); + /* Select PLL clock as system clk */ + BSP_REG_SCU_SYSCLKCR |= BSP_BIT_SYSCLKCR_PLL_CLK; + /* Wait between K2 divider updates */ + reg_to = BSP_REG_VAL_TO; + while (reg_to > 0u) { + reg_to--; + } + /* fpll = (NDIV * fosc) / (PDIV * K2DIV)) */ + /* = (40 * 12MHz) / (1 * 8)) = 60MHz */ + reg = (BSP_REG_SCU_PLLCON1 & ~BSP_PLLCON1_K2DIV_MASK); + reg |= ( (BSP_PLLCON1_K2DIV_STEP2 - 1u) << 16); + BSP_REG_SCU_PLLCON1 = reg; + /* Wait between K2 divider updates */ + reg_to = BSP_REG_VAL_TO; + while (reg_to > 0u) { + reg_to--; + } + + /* fpll = (NDIV * fosc) / (PDIV * K2DIV)) */ + /* = (40 * 12MHz) / (1 * 5)) = 96MHz */ + reg = (BSP_REG_SCU_PLLCON1 & ~BSP_PLLCON1_K2DIV_MASK); + reg |= ( (BSP_PLLCON1_K2DIV_STEP3 - 1u) << 16); + BSP_REG_SCU_PLLCON1 = reg; + /* Wait between K2 divider updates */ + reg_to = BSP_REG_VAL_TO; + while (reg_to > 0u) { + reg_to--; + } + /* fpll = (NDIV * fosc) / (PDIV * K2DIV)) */ + /* = (40 * 12MHz) / (1 * 4)) = 120MHz */ + reg = (BSP_REG_SCU_PLLCON1 & ~BSP_PLLCON1_K2DIV_MASK); + reg |= ( (BSP_PLLCON1_K2DIV_FINAL - 1u) << 16); + BSP_REG_SCU_PLLCON1 = reg; +} + +/** + * @function BSP_SysClkFreqGet() + * @params none + * @returns System clock frequency in cycles + * + * @brief This function is used to retrieve system or CPU clock frequency + * + */ +CPU_INT32U BSP_SysClkFreqGet (void) +{ + CPU_INT08U sysclk_src; + CPU_INT16U sysclk_div; + CPU_INT08U pll_n; + CPU_INT08U pll_p; + CPU_INT08U pll_k2; + CPU_INT32U cpu_freq; + + + sysclk_src = (BSP_REG_SCU_SYSCLKCR & DEF_BIT_FIELD (2u, 16u)) >> 16u; + sysclk_div = (BSP_REG_SCU_SYSCLKCR & DEF_BIT_FIELD (8u, 0u)) + 1u; + + switch (sysclk_src) { + case 0: + /* Fast Internal Oscillator selected as system clk */ + cpu_freq = BSP_CFG_SYS_INT_OSC_FI_FREQ_HZ; + break; + + case 1: + /* PLL clock is selected as system clk */ + cpu_freq = BSP_CFG_SYS_XTAL_OSC_FREQ_HZ; + pll_n = (BSP_REG_SCU_PLLCON1 >> 8u) + 1u; + pll_p = (BSP_REG_SCU_PLLCON1 >> 24u) + 1u; + pll_k2 = (BSP_REG_SCU_PLLCON1 >> 16u) + 1u; + cpu_freq = ( (cpu_freq / pll_p) * pll_n) / pll_k2; + break; + + case 2: + case 3: + default: + return ( (CPU_INT32U) 0u); + } + cpu_freq /= sysclk_div; + if (DEF_BIT_IS_SET (BSP_REG_SCU_CPUCLKCR, BSP_BIT_CPUCLKCR_CPUDIV)) { + cpu_freq /= 2u; + } + return (cpu_freq); +} + +/*! EOF */ diff --git a/XMC_UCOS3/APP_UART1_ECHO/BSP/bsp_sys.h b/XMC_UCOS3/APP_UART1_ECHO/BSP/bsp_sys.h new file mode 100644 index 0000000000000000000000000000000000000000..2ca1f3431f7eed5325fcb1809c03a8da7d2228f5 --- /dev/null +++ b/XMC_UCOS3/APP_UART1_ECHO/BSP/bsp_sys.h @@ -0,0 +1,86 @@ +/** + * @file bsp_sys.h + * + * @brief Board Support Functions to initialize the CPU (PLL, Clock, etc.) + */ +#ifndef _BSP_SYS_H_ +#define _BSP_SYS_H_ + +#include + +/****************************************************************** REGISTERS */ + +/* ----------------- FLASH REGISTERS ------------------ */ +#define BSP_FLASH0_BASE_ADDR ((CPU_INT32U)(0x58001000u)) +#define BSP_REG_FLASH0_FCON (*(CPU_REG32 *)(BSP_FLASH0_BASE_ADDR + 0x1014u)) + +/* -------------- WINDOWS WATCHDOG TIMER -------------- */ +#define BSP_WDT_BASE_ADDR ((CPU_INT32U)(0x50008000u)) +#define BSP_REG_WDT_CTR (*(CPU_REG32 *)(BSP_WDT_BASE_ADDR + 0x004u)) + +/* ----------------- PREFETCH MODULE ------------------ */ +#define BSP_PREF_BASE_ADDR ((CPU_INT32U)(0x58004000u)) +#define BSP_REG_PREF_PCON (*(CPU_REG32 *)(BSP_PREF_BASE_ADDR + 0x000u)) + +/* ------------ SYSTEM CONTROL UNIT MODULE ------------ */ +#define BSP_SCU_BASE_ADDR ((CPU_INT32U)(0x50004000u)) +#define BSP_REG_SCU_TRAPCLR (*(CPU_REG32 *)(BSP_SCU_BASE_ADDR + 0x16Cu)) +#define BSP_REG_SCU_SYSCLKCR (*(CPU_REG32 *)(BSP_SCU_BASE_ADDR + 0x60Cu)) +#define BSP_REG_SCU_CPUCLKCR (*(CPU_REG32 *)(BSP_SCU_BASE_ADDR + 0x610u)) +#define BSP_REG_SCU_PBCLKCR (*(CPU_REG32 *)(BSP_SCU_BASE_ADDR + 0x614u)) +#define BSP_REG_SCU_CCUCLKCR (*(CPU_REG32 *)(BSP_SCU_BASE_ADDR + 0x620u)) +#define BSP_REG_SCU_CLKSET (*(CPU_REG32 *)(BSP_SCU_BASE_ADDR + 0x604u)) +#define BSP_REG_SCU_OSCHPCTRL (*(CPU_REG32 *)(BSP_SCU_BASE_ADDR + 0x704u)) +#define BSP_REG_SCU_PLLCON0 (*(CPU_REG32 *)(BSP_SCU_BASE_ADDR + 0x714u)) +#define BSP_REG_SCU_PLLCON1 (*(CPU_REG32 *)(BSP_SCU_BASE_ADDR + 0x718u)) +#define BSP_REG_SCU_PLLCON2 (*(CPU_REG32 *)(BSP_SCU_BASE_ADDR + 0x71Cu)) +#define BSP_REG_SCU_PLLSTAT (*(CPU_REG32 *)(BSP_SCU_BASE_ADDR + 0x710u)) + +/************************************************************** REGISTER BITS */ +#define BSP_BIT_SYSCLKCR_OSC_FI DEF_BIT_NONE +#define BSP_BIT_SYSCLKCR_PLL_CLK DEF_BIT_MASK(1u, 16u) +#define BSP_BIT_SYSCLKCR_STANDBY_CLK DEF_BIT_MASK(2u, 16u) +#define BSP_BIT_SYSCLKCR_SYSSEL_MASK DEF_BIT_FIELD(2u, 16u) +#define BSP_BIT_SYSCLKCR_SYSDIV_MASK DEF_BIT_FIELD(8u, 0u) + +#define BSP_BIT_PLLCON0_VCOBYP DEF_BIT_00 +#define BSP_BIT_PLLCON0_VCOPWD DEF_BIT_01 +#define BSP_BIT_PLLCON0_FINDIS DEF_BIT_04 +#define BSP_BIT_PLLCON0_OSCDISCDIS DEF_BIT_06 +#define BSP_BIT_PLLCON0_PLLPWD DEF_BIT_16 +#define BSP_BIT_PLLCON0_OSCRES DEF_BIT_17 +#define BSP_BIT_PLLCON0_RESLD DEF_BIT_18 + +#define BSP_BIT_PLLCON2_PINSEL DEF_BIT_00 +#define BSP_BIT_PLLCON2_K1INSEL DEF_BIT_08 + +#define BSP_BIT_PLLSTAT_VCOLOCK DEF_BIT_02 +#define BSP_BIT_PLLSTAT_PLLLV DEF_BIT_07 +#define BSP_BIT_PLLSTAT_PLLHV DEF_BIT_08 +#define BSP_BIT_PLLSTAT_PLLSP DEF_BIT_09 + +#define BSP_BIT_OSCHPCTRL_MODE_EXT_CRYS 0x0 +#define BSP_BIT_OSCHPCTRL_MODE_OSC_DIS 0x1 +#define BSP_BIT_OSCHPCTRL_MODE_PWR_SAVE 0x2 +#define BSP_BIT_OSCHPCTRL_MODE_MASK DEF_BIT_FIELD(2u, 4u) +#define BSP_BIT_OSCHPCTRL_OSCVAL DEF_BIT_MASK(2u, 16u) +#define BSP_BIT_OSCHPCTRL_OSCVAL_MASK DEF_BIT_FIELD(5u, 16u) + +#define BSP_BIT_WDT_CTR_ENB DEF_BIT_00 + +#define BSP_BIT_PREF_PCON_PBS DEF_BIT_16 + +#define BSP_BIT_CPUCLKCR_CPUDIV DEF_BIT_00 +#define BSP_BIT_PBCLKCR_PBDIV DEF_BIT_00 +#define BSP_BIT_CCUCLKCR_CCUDIV DEF_BIT_00 + +#define BSP_BIT_CLKSET_MMCEN DEF_BIT_01 + +/***************************************************************** PROTOTYPES */ +void BSP_LowLevelInit (void); +void BSP_SysInit (void); +CPU_INT32U BSP_SysClkFreqGet (void); + +#endif + +/*! EOF */ diff --git a/XMC_UCOS3/APP_UART1_ECHO/BSP/bsp_uart.c b/XMC_UCOS3/APP_UART1_ECHO/BSP/bsp_uart.c new file mode 100644 index 0000000000000000000000000000000000000000..4d1f0307ee37d5476b39a886a5973ee629818d32 --- /dev/null +++ b/XMC_UCOS3/APP_UART1_ECHO/BSP/bsp_uart.c @@ -0,0 +1,44 @@ +/* + * @file bsp_uart.c + * + * @date: 02-2015 + * @author: Beneder Roman + * @revision: 0.2, 02-2018, M. Horauer + */ + +#include + +XMC_UART_CH_CONFIG_t uart_config = { + .data_bits = 8U, + .stop_bits = 1U, + .baudrate = 9600U +}; + +/** + * @brief Initialize UART1 CH1 - Tx=P0.1, Rx=P0.0, 9600-8N1 + * @return true on success, false otherwise + */ +_Bool BSP_UART_Init (void) +{ + + XMC_UART_CH_Init (XMC_UART1_CH1, &uart_config); + XMC_UART_CH_Init (XMC_UART1_CH0, &uart_config); + XMC_UART_CH_SetInputSource (XMC_UART1_CH1, XMC_UART_CH_INPUT_RXD, + USIC1_C1_DX0_P0_0); + + XMC_UART_CH_SetInterruptNodePointer (XMC_UART1_CH1, 0) ; + XMC_UART_CH_EnableEvent (XMC_UART1_CH1, XMC_UART_CH_EVENT_STANDARD_RECEIVE); + XMC_UART_CH_EnableEvent (XMC_UART1_CH1, + XMC_UART_CH_EVENT_ALTERNATIVE_RECEIVE); + NVIC_EnableIRQ (USIC1_0_IRQn); + + XMC_UART_CH_Start (XMC_UART1_CH1); + XMC_UART_CH_Start (XMC_UART1_CH0); + + XMC_GPIO_SetMode (UART_TX, XMC_GPIO_MODE_OUTPUT_PUSH_PULL_ALT2); + XMC_GPIO_SetMode (UART_RX, XMC_GPIO_MODE_INPUT_TRISTATE); + + return true; +} + +/*! EOF */ diff --git a/XMC_UCOS3/APP_UART1_ECHO/BSP/bsp_uart.h b/XMC_UCOS3/APP_UART1_ECHO/BSP/bsp_uart.h new file mode 100644 index 0000000000000000000000000000000000000000..82d4ee5fbed5a4470a4c35a5170ae9c699c9d988 --- /dev/null +++ b/XMC_UCOS3/APP_UART1_ECHO/BSP/bsp_uart.h @@ -0,0 +1,23 @@ +/* + * @file bsp_uart.h + * + * @date 02-2016 + * @author: Beneder Roman + */ + +#ifndef SRC_BSP_BSP_UART_H_ +#define SRC_BSP_BSP_UART_H_ + +#define UART_TX P0_1 +#define UART_RX P0_0 + +#include +#include +#include + +_Bool BSP_UART_Init (void) ; + +#endif + +/*! EOF */ + diff --git a/XMC_UCOS3/APP_UART1_ECHO/BSP/cpu_bsp.c b/XMC_UCOS3/APP_UART1_ECHO/BSP/cpu_bsp.c new file mode 100644 index 0000000000000000000000000000000000000000..954cd47164e50396f1d8f4b1b088028a96d93fa1 --- /dev/null +++ b/XMC_UCOS3/APP_UART1_ECHO/BSP/cpu_bsp.c @@ -0,0 +1,236 @@ +/** + * @file cpu_bsp.c + * + * @brief CPU board support package + */ + +/******************************************************************* INCLUDES */ +#define CPU_BSP_MODULE +#include +#include + +/********************************************************* FILE LOCAL DEFINES */ +#define CPU_BSP_REG_DEMCR (*(CPU_REG32 *)0xE000EDFC) +#define CPU_BSP_REG_DWT_CR (*(CPU_REG32 *)0xE0001000) +#define CPU_BSP_REG_DWT_CYCCNT (*(CPU_REG32 *)0xE0001004) + +/** + * @function CPU_TS_TmrInit() + * @params none + * @returns none + * + * @caller CPU_TS_Init() + * @brief This function is an INTERNAL CPU module function & MUST be implemented + * by application/BSP function(s) but MUST NOT be called by application + * function(s). + * + * @note (1) CPU_TS_TmrInit() is an application/BSP function that MUST be + * defined by the developer if either of the following CPU features + * is enabled: + * (a) CPU timestamps + * (b) CPU interrupts disabled time measurements + * See also cpu_cfg.h + * (2) (a) Timer count values MUST be returned via word-size-configurable + * CPU_TS_TMR data type. + * - If timer has more bits, truncate timer values' higher-order + * bits greater than the configured CPU_TS_TMR timestamp timer + * data type word size. + * - Since the timer MUST NOT have less bits than the configured + * CPU_TS_TMR timestamp timer data type word size; + * CPU_CFG_TS_TMR_SIZE MUST be configured so that ALL bits in + * CPU_TS_TMR data type are significant. + * + * In other words, if timer size is not a binary-multiple of + * 8-bit octets (e.g., 20-bits or even 24-bits), then the next + * lower, binary-multiple octet word size SHOULD be configured + * (e.g., to 16-bits). However, the minimum supported word size + * for CPU timestamp timers is 8-bits. + * + * See also cpu_cfg.h and cpu_core.h + * + * (b) Timer SHOULD be an 'up' counter whose values increase with each + * time count. + * + * (c) When applicable, timer period SHOULD be less than the typical + * measured time but MUST be less than the maximum measured time; + * otherwise, timer resolution inadequate to measure desired times. + * + * See also CPU_TS_TmrRd() + */ +#if (CPU_CFG_TS_TMR_EN == DEF_ENABLED) +void CPU_TS_TmrInit (void) +{ + CPU_INT32U fclk_freq; + + fclk_freq = BSP_SysClkFreqGet(); + + CPU_BSP_REG_DEMCR |= DEF_BIT_24; + CPU_BSP_REG_DWT_CR |= DEF_BIT_00; + + CPU_TS_TmrFreqSet ( (CPU_TS_TMR_FREQ) fclk_freq); +} +#endif + +/** + * @function CPU_TS_TmrRd() + * @params none + * @returns timestamp timer count + * + * @caller CPU_TS_Init(), CPU_TS_Get32(), CPU_TS_Get64(), CPU_IntDisMeasStart(), + * CPU_IntDisMeasStop(). + * + * @brief This function is an INTERNAL CPU module function & MUST be implemented + * by application/BSP function(s) but SHOULD NOT be called by + * application function(s). + * + * (1) CPU_TS_TmrRd() is an application/BSP function that MUST be defined by the + * developer if either of the following CPU features is enabled : + * + * (a) CPU timestamps + * (b) CPU interrupts disabled time measurements + * + * See also cpu_cfg.h + * + * (2) (a) Timer count values MUST be returned via word-size-configurable + * CPU_TS_TMR data type. + * + * (1) If timer has more bits, truncate timer values' higher-order bits + * greater than the configured 'CPU_TS_TMR' timestamp timer data + * type word size. + * + * (2) Since the timer MUST NOT have less bits than the configured + * CPU_TS_TMR timestamp timer data type word size; + * CPU_CFG_TS_TMR_SIZE MUST be configured so that ALL bits in + * CPU_TS_TMR data type are significant. + * + * In other words, if timer size is not a binary-multiple of 8-bit + * octets (e.g., 20-bits or even 24-bits), then the next lower, + * binary-multiple octet word size SHOULD be configured + * (e.g., to 16-bits). However, the minimum supported word size for + * CPU timestamp timers is 8-bits. + * + * See also cpu_cfg.h & cpu_core.h + * + * (b) Timer SHOULD be an 'up' counter whose values increase with each time + * count. + * + * (1) If timer is a 'down' counter whose values decrease with each time + * count, then the returned timer value MUST be ones-complemented. + * + * (c) (1) When applicable, the amount of time measured by CPU timestamps is + * calculated by either of the following equations : + * + * (A) Time measured = Number timer counts * Timer period + * + * where + * + * Number timer counts Number of timer counts measured + * Timer period ....... Timer's period in some units of + * (fractional) seconds + * Time measured ..... Amount of time measured, in same + * units of (fractional) seconds + * as the Timer period + * + * Number timer counts + * (B) Time measured = --------------------- + * Timer frequency + * + * where + * + * Number timer counts Number of timer counts measured + * Timer frequency .... Timer's frequency in some units + * of counts per second + * Time measured ...... Amount of time measured, in sec + * + * (2) Timer period SHOULD be less than the typical measured time but + * MUST be less than the maximum measured time; otherwise, timer + * resolution inadequate to measure desired times. + * + */ +#if (CPU_CFG_TS_TMR_EN == DEF_ENABLED) +CPU_TS_TMR CPU_TS_TmrRd (void) +{ + CPU_TS_TMR ts_tmr_cnts; + + + ts_tmr_cnts = (CPU_TS_TMR) CPU_BSP_REG_DWT_CYCCNT; + + return (ts_tmr_cnts); +} +#endif + + +/** + * @function + * @params ts_cnts ... CPU timestamp + * @returns converted CPU timestamp in us + * + * @caller application + * @brief This function is an (optional) CPU module application interface (API) + * function which MAY be implemented by application/BSP function(s) & + * MAY be called by application function(s). + * + * @note (1) CPU_TS32_to_uSec()/CPU_TS64_to_uSec() are application/BSP functions + * that MAY be optionally defined by the developer when either of the + * following CPU features is enabled: + * (a) CPU timestamps + * (b) CPU interrupts disabled time measurements + * See also cpu_cfg.h + * + * (2) (a) The amount of time measured by CPU timestamps is calculated by either + * ofthe following equations: + * + * 10^6 microseconds + * Time measured = Number timer counts * ------------------- * Timer period + * 1 second + * + * Number timer counts 10^6 microseconds + * Time measured = --------------------- * ------------------- + * Timer frequency 1 second + * + * where + * + * (A) Number timer counts Number of timer counts measured + * (B) Timer frequency Timer's frequency in some units + * of counts per second + * (C) Timer period Timer's period in some units of + * (fractional) seconds + * (D) Time measured Amount of time measured, + * in microseconds + * + * (b) Timer period SHOULD be less than the typical measured time but MUST + * be less than the maximum measured time; otherwise, timer resolution + * inadequate to measure desired times. + * + * (c) Specific implementations may convert any number of CPU_TS32 or + * CPU_TS64 bits -- up to 32 or 64, respectively -- into microseconds. + */ +#if (CPU_CFG_TS_32_EN == DEF_ENABLED) +CPU_INT64U CPU_TS32_to_uSec (CPU_TS32 ts_cnts) +{ + CPU_INT64U ts_us; + CPU_INT64U fclk_freq; + + + fclk_freq = BSP_SysClkFreqGet(); + ts_us = ts_cnts / (fclk_freq / DEF_TIME_NBR_uS_PER_SEC); + + return (ts_us); +} +#endif + +#if (CPU_CFG_TS_64_EN == DEF_ENABLED) +CPU_INT64U CPU_TS64_to_uSec (CPU_TS64 ts_cnts) +{ + CPU_INT64U ts_us; + CPU_INT64U fclk_freq; + + + fclk_freq = BSP_SysClkFreqGet(); + ts_us = ts_cnts / (fclk_freq / DEF_TIME_NBR_uS_PER_SEC); + + return (ts_us); +} +#endif + +/*! EOF */ diff --git a/XMC_UCOS3/APP_UART1_ECHO/BSP/debug_lib.c b/XMC_UCOS3/APP_UART1_ECHO/BSP/debug_lib.c new file mode 100644 index 0000000000000000000000000000000000000000..9e56e2ad3229cda710ac75533c081806e9f3ea83 --- /dev/null +++ b/XMC_UCOS3/APP_UART1_ECHO/BSP/debug_lib.c @@ -0,0 +1,143 @@ +/** + * @file debug_lib.c + * @version V0.1 + * @date Oct 2014 + * @author M. Horauer + * + * @brief This library retargets the printf() function to + * generate output via the SWD DEBUG interface. + * + */ + +#include + +#if SEMI_HOSTING + +/******************************************************************** globals */ +volatile int32_t ITM_RxBuffer = ITM_RXBUFFER_EMPTY; + + +FILE __stdout; +FILE __stdin; + + +/*! + * @brief Initialize the SWD/TPI/ITM debug modules to output debug messages + * via the Debug interface. This will enable the outputz of printf() + * and fputc() like messages. + * \par + * In order to enable the output add the following command at the GDB + * prompt (not needed when using the GNU ARM Plugin from within Eclipse) + * + * (gdb) monitor SWO EnableTarget 16000000 0 1 0 + * + * Open up a separate terminal and connect to the TERMINAL OUTPUT + * CHANNEL of the Segger JLink. + * + * $ telnet localhost 2333 + * + * @param - + * @return - + * @note Checkout: + * (1) CMSIS Core Documentation found along the CMSIS sources: + * CMSIS-Core > Reference > Debug Access + * (2) ARM Cortex-M4 Processor Technical Reference Manual + * (3) ARMv7-M Architecture Reference Manual + */ +void initRetargetSwo (void) +{ + // P2.1: After a system reset, this pin selects HWO0 (DB.TDO/DB.TRACESWO) + // PORT2->HWSEL ... clear bits [3:2] + PORT2->HWSEL &= ~PORT2_HWSEL_HW1_Msk; + // PORT2->HWSEL ... set bit [2] -> HWO0 + PORT2->HWSEL |= 0x01UL << PORT2_HWSEL_HW1_Pos; + + // Enable trace systems + // Source: ARMv7-M Architecture Reference Manual + // DEMCR = Debug Exception and Monitor Control Register + // TRCENA ... global enable for DWT and ITM blocks + CoreDebug->DEMCR |= CoreDebug_DEMCR_TRCENA_Msk; + // SWO baud rate prescaler value + // ACPR = Asynchronous Clock Prescaler Register + // fSWO = fCPU / (SWOSCALAR + 1) + // fSWO = 1MHz (maximum speed JLINK Lite CortexM) + // fCPU = 120MHz + TPI->ACPR = 119UL; + // Asynchronous SWO, using NRZ encoding + // Source: ARMv7-M Architecture Reference Manual + // SPPR = Selected Pin Control Register + // 0x0 ... Synchronous Trace Port Mode + // 0x1 ... Asynchronous Serial Wire Output (Manchester) + // 0x2 ... Asynchronous Serial Wire Output (NRZ) + TPI->SPPR = 0x2UL; + // Source: ARM Cortex-M4 Processor Technical Reference Manual + // Source: infineonforums -> 358-ITM-printf-style-debugging-not-working + // FFCR = Formatter and Flash Control Register + // 0x0 ... continuous formatting disabled + // 0x1 ... continuous formatting enabled + TPI->FFCR &= ~TPI_FFCR_EnFCont_Msk; + + // Unlock ITM + // Source: infineonforums -> 358-ITM-printf-style-debugging-not-working + ITM->LAR = 0xC5ACCE55; + // Source: ARMv7-M Architecture Reference Manual, Sec. C1-7 + // TCR = Trace Control Register + // ITMENA ... enable ITM + ITM->TCR |= ITM_TCR_ITMENA_Msk; + // Source: ARMv7-M Architecture Reference Manual, Sec. C1-7 + // TER = Trace Enable Register + // STIMENA ... Stimulus Port #N is enabled when bit STIMENA[N] + ITM->TER = 0xFFFFFFFF; +} + +/*! + * @brief Retarget the printf() function to output via the ITM Debug module. + * This function relies on ITM_SendChar() defined in core_cm4.h of the + * CMSIS library. + */ +int _write (int file, char *buf, int nbytes) +{ + int i; + + for (i = 0; i < nbytes; i++) { + ITM_SendChar ( (*buf++)); + } + return nbytes; +} + +/*! + * @brief Output a single charcter via the ITM Debug module. + */ +int fputc (int ch, FILE *f) +{ + return (ITM_SendChar (ch)); +} + +/*! + * @brief Read a single character via the ITM module. + * + * @note Doesn't seem to work on the XMC board so far! + */ +int fgetc (FILE *f) +{ + while (ITM_CheckChar() != 1); + return (ITM_ReceiveChar()); +} + + +/*! + * @brief Debug Error output via the ITM module. + * + * @note Not implemented so far ... + */ +#if DEBUG +int ferror (FILE *f) +{ + /* Your implementation of ferror */ + return EOF; +} +#endif + +#endif + +/*! EOF */ diff --git a/XMC_UCOS3/APP_UART1_ECHO/BSP/debug_lib.h b/XMC_UCOS3/APP_UART1_ECHO/BSP/debug_lib.h new file mode 100644 index 0000000000000000000000000000000000000000..3ec4551599f87f2c80072823f321e7321bcb9b45 --- /dev/null +++ b/XMC_UCOS3/APP_UART1_ECHO/BSP/debug_lib.h @@ -0,0 +1,36 @@ +/** + * @file debug_lib.h + * @version V0.1 + * @date Oct 2014 + * @author M. Horauer + * + * @brief This library retargets the printf() function to + * generate output via the SWD DEBUG interface. + * + */ +#ifndef DEBUG_LIB_H_ +#define DEBUG_LIB_H_ + +#include + +#if SEMI_HOSTING + +#include +#include +#include +#include + +struct __FILE { + int handle; +}; + +/******************************************************** FUNCTION PROTOTYPES */ +void initRetargetSwo (void); +int fgetc (FILE *f); +int fputc (int ch, FILE *f); + +#endif + +#endif + +/*! EOF */ diff --git a/XMC_UCOS3/APP_UART1_ECHO/BSP/startup.asm b/XMC_UCOS3/APP_UART1_ECHO/BSP/startup.asm new file mode 100644 index 0000000000000000000000000000000000000000..9f8f5cc57a79024561fe84a7348cb64c8c892b53 --- /dev/null +++ b/XMC_UCOS3/APP_UART1_ECHO/BSP/startup.asm @@ -0,0 +1,456 @@ +@* +@******************************************************************************************************** +@ EXCEPTION VECTORS & STARTUP CODE +@ +@ File : cstartup.s +@ For : ARMv7M Cortex-M4 +@ Mode : Thumb2 +@ Toolchain : Atollic TrueSTUDIO(R) +@******************************************************************************************************** +@ + + +@******************************************************************************************************** +@ CODE GENERATION DIRECTIVES +@******************************************************************************************************** + .syntax unified + .cpu cortex-m4 + .fpu softvfp + .thumb + + +@******************************************************************************************************** +@ PUBLIC FUNCTIONS +@******************************************************************************************************** + + .global g_pfnVectors + .global Default_Handler + + +@******************************************************************************************************** +@ LINKER SCRIPT DEFINITIONS +@******************************************************************************************************** + + .word _sidata @ start addr for the init values of the .data section. + .word _sdata @ start addr for the .data section. + .word _edata @ end address for the .data section. + .word _sbss @ start address for the .bss section. + .word _ebss @ end address for the .bss section. + + +@******************************************************************************************************** +@ EQUATES +@******************************************************************************************************** + +.equ PREF_PCON, 0x58004000 +.equ SCU_GCU_PEEN, 0x5000413C +.equ SCU_GCU_PEFLAG, 0x50004150 + + +@PAGE +@******************************************************************************************************** +@ void Reset_Handler (void) +@ +@ Note(s) : 1) This code gets called after a reset event. +@ +@ 2) Reset_Handler() MUST: +@ a) Copy .data section from ROM to RAM. +@ b) Clear .bss section (Zero init). +@ c) Call low level initialzation routine. +@ d) Run static constructors. +@ e) Enter main. +@ f) Loop forever if returning from main. +@******************************************************************************************************** + + .section .text.Reset_Handler + .weak Reset_Handler + .type Reset_Handler, %function +Reset_Handler: + @ Disable Branch prediction. + ldr r0,=PREF_PCON + ldr r1,[r0] + orr r1,r1,#0x00010000 + str r1,[r0] + + @ Clear existing parity errors if any. + ldr r0,=SCU_GCU_PEFLAG + ldr r1,=0xFFFFFFFF + str r1,[r0] + + @ Disable parity. + ldr r0,=SCU_GCU_PEEN + mov r1,#0 + str r1,[R0] + +#if (defined(__VFP_FP__) && !defined(__SOFTFP__)) + @ Enable Floating Point Support at reset for FPU + LDR.W R0, =0xE000ED88 @ Load address of CPACR register + LDR R1, [R0] @ Read value at CPACR + ORR R1, R1, #(0xF <<20) @ Set bits 20-23 to enable CP10 and CP11 coprocessors + @ Write back the modified CPACR value + STR R1, [R0] @ Wait for store to complete + DSB + + @ Disable automatic FP register content + @ Disable lazy context switch + LDR.W R0, =0xE000EF34 @ Load address to FPCCR register + LDR R1, [R0] + AND R1, R1, #(0x3FFFFFFF) @ Clear the LSPEN and ASPEN bits + STR R1, [R0] + ISB @ Reset pipeline now the FPU is enabled +#endif + + LDR R1, =0xE000ED14 @ Load address to CCR register + LDR.W R0, [R1, #0x0] + BIC R0, R0, #0x8 @ Enable unaligned memory access + STR.W R0, [R1, #0x0] + + ldr sp, =_estack @ set stack pointer. + + @ a) copy .data section (Copy from ROM to RAM). + movs r1, #0 + b LoopCopyDataInit + +CopyDataInit: + ldr r3, =_sidata + ldr r3, [r3, r1] + str r3, [r0, r1] + adds r1, r1, #4 + +LoopCopyDataInit: + ldr r0, =_sdata + ldr r3, =_edata + adds r2, r0, r1 + cmp r2, r3 + bcc CopyDataInit + ldr r2, =_sbss + b LoopFillZerobss + + @ b) Clear .bss section (Zero init). +FillZerobss: + movs r3, #0 + str r3, [r2], #4 + +LoopFillZerobss: + ldr r3, = _ebss + cmp r2, r3 + bcc FillZerobss + + bl BSP_LowLevelInit @ c) Call system initialzation routine. + + bl __libc_init_array @ d) Run static constructors. + + bl main @ e) Enter main. + + @ f) Loop forever if returning from main. +LoopForever: + b LoopForever + + +.size Reset_Handler, .-Reset_Handler + + +@******************************************************************************************************** +@ EXCEPTION & INTERRUPT VECTORS +@******************************************************************************************************** + + .section .isr_vector,"a",%progbits + .type g_pfnVectors, %object + .size g_pfnVectors, .-g_pfnVectors + + .extern BSP_IntHandlerSCU + .extern BSP_IntHandlerERU0_00 + .extern BSP_IntHandlerERU0_01 + .extern BSP_IntHandlerERU0_02 + .extern BSP_IntHandlerERU0_03 + .extern BSP_IntHandlerERU1_00 + .extern BSP_IntHandlerERU1_01 + .extern BSP_IntHandlerERU1_02 + .extern BSP_IntHandlerERU1_03 + .extern BSP_IntHandlerWDT_00 + .extern BSP_IntHandlerPMU0_00 + .extern BSP_IntHandlerPMU0_01 + .extern BSP_IntHandlerVADC0_C0_00 + .extern BSP_IntHandlerVADC0_C0_01 + .extern BSP_IntHandlerVADC0_C0_02 + .extern BSP_IntHandlerVADC0_C0_03 + .extern BSP_IntHandlerVADC0_G0_00 + .extern BSP_IntHandlerVADC0_G0_01 + .extern BSP_IntHandlerVADC0_G0_02 + .extern BSP_IntHandlerVADC0_G0_03 + .extern BSP_IntHandlerVADC0_G1_00 + .extern BSP_IntHandlerVADC0_G1_01 + .extern BSP_IntHandlerVADC0_G1_02 + .extern BSP_IntHandlerVADC0_G1_03 + .extern BSP_IntHandlerVADC0_G2_00 + .extern BSP_IntHandlerVADC0_G2_01 + .extern BSP_IntHandlerVADC0_G2_02 + .extern BSP_IntHandlerVADC0_G2_03 + .extern BSP_IntHandlerVADC0_G3_00 + .extern BSP_IntHandlerVADC0_G3_01 + .extern BSP_IntHandlerVADC0_G3_02 + .extern BSP_IntHandlerVADC0_G3_03 + .extern BSP_IntHandlerDSD0_00 + .extern BSP_IntHandlerDSD0_01 + .extern BSP_IntHandlerDSD0_02 + .extern BSP_IntHandlerDSD0_03 + .extern BSP_IntHandlerDSD0_04 + .extern BSP_IntHandlerDSD0_05 + .extern BSP_IntHandlerDSD0_06 + .extern BSP_IntHandlerDSD0_07 + .extern BSP_IntHandlerDAC0_00 + .extern BSP_IntHandlerDAC0_01 + .extern BSP_IntHandlerCCU40_00 + .extern BSP_IntHandlerCCU40_01 + .extern BSP_IntHandlerCCU40_02 + .extern BSP_IntHandlerCCU40_03 + .extern BSP_IntHandlerCCU41_00 + .extern BSP_IntHandlerCCU41_01 + .extern BSP_IntHandlerCCU41_02 + .extern BSP_IntHandlerCCU41_03 + .extern BSP_IntHandlerCCU42_00 + .extern BSP_IntHandlerCCU42_01 + .extern BSP_IntHandlerCCU42_02 + .extern BSP_IntHandlerCCU42_03 + .extern BSP_IntHandlerCCU43_00 + .extern BSP_IntHandlerCCU43_01 + .extern BSP_IntHandlerCCU43_02 + .extern BSP_IntHandlerCCU43_03 + .extern BSP_IntHandlerCCU80_00 + .extern BSP_IntHandlerCCU80_01 + .extern BSP_IntHandlerCCU80_02 + .extern BSP_IntHandlerCCU80_03 + .extern BSP_IntHandlerCCU81_00 + .extern BSP_IntHandlerCCU81_01 + .extern BSP_IntHandlerCCU81_02 + .extern BSP_IntHandlerCCU81_03 + .extern BSP_IntHandlerPOSIF0_00 + .extern BSP_IntHandlerPOSIF0_01 + .extern BSP_IntHandlerPOSIF1_00 + .extern BSP_IntHandlerPOSIF1_01 + + .extern BSP_IntHandlerCAN0_00 + .extern BSP_IntHandlerCAN0_01 + .extern BSP_IntHandlerCAN0_02 + .extern BSP_IntHandlerCAN0_03 + .extern BSP_IntHandlerCAN0_04 + .extern BSP_IntHandlerCAN0_05 + .extern BSP_IntHandlerCAN0_06 + .extern BSP_IntHandlerCAN0_07 + .extern BSP_IntHandlerUSIC0_00 + .extern BSP_IntHandlerUSIC0_01 + .extern BSP_IntHandlerUSIC0_02 + .extern BSP_IntHandlerUSIC0_03 + .extern BSP_IntHandlerUSIC0_04 + .extern BSP_IntHandlerUSIC0_05 + .extern BSP_IntHandlerUSIC1_00 + .extern BSP_IntHandlerUSIC1_01 + .extern BSP_IntHandlerUSIC1_02 + .extern BSP_IntHandlerUSIC1_03 + .extern BSP_IntHandlerUSIC1_04 + .extern BSP_IntHandlerUSIC1_05 + .extern BSP_IntHandlerUSIC2_00 + .extern BSP_IntHandlerUSIC2_01 + .extern BSP_IntHandlerUSIC2_02 + .extern BSP_IntHandlerUSIC2_03 + .extern BSP_IntHandlerUSIC2_04 + .extern BSP_IntHandlerUSIC2_05 + .extern BSP_IntHandlerLEDTS0_00 + .extern BSP_IntHandlerFCE0_00 + .extern BSP_IntHandlerGPDMA0_00 + .extern BSP_IntHandlerSDMMC0_00 + .extern BSP_IntHandlerUSB0_00 + .extern BSP_IntHandlerETH0_00 + .extern BSP_IntHandlerGPDMA1_00 + + .extern OS_CPU_PendSVHandler + .extern OS_CPU_SysTickHandler + + +g_pfnVectors: + @ Processor exception vectors + .word _estack @ Top of Stack + .word Reset_Handler @ Reset Handler + .word App_NMI_ISR @ NMI Handler + .word App_Fault_ISR @ Hard Fault Handler + .word App_MemFault_ISR @ MPU Fault Handler + .word App_BusFault_ISR @ Bus Fault Handler + .word App_UsageFault_ISR @ Usage Fault Handler + .word App_Spurious_ISR @ Reserved + .word App_Spurious_ISR @ Reserved + .word App_Spurious_ISR @ Reserved + .word App_Spurious_ISR @ Reserved + .word App_Spurious_ISR @ SVCall Handler + .word App_Spurious_ISR @ Debug Monitor Handler + .word App_Spurious_ISR @ Reserved + .word OS_CPU_PendSVHandler @ PendSV Handler + .word OS_CPU_SysTickHandler @ SysTick Handler + + @ External Interrupts + .word BSP_IntHandlerSCU @ 16, INTISR[ 0] SCU Interrupt. + .word BSP_IntHandlerERU0_00 @ 17, INTISR[ 1] ERU0 SR0 Interrupt. + .word BSP_IntHandlerERU0_01 @ 18, INTISR[ 2] ERU0 SR0 Interrupt. + .word BSP_IntHandlerERU0_02 @ 19, INTISR[ 3] ERU0 SR0 Interrupt. + .word BSP_IntHandlerERU0_03 @ 20, INTISR[ 4] ERU0 SR0 Interrupt. + .word BSP_IntHandlerERU1_00 @ 21, INTISR[ 5] ERU1 SR0 Interrupt. + .word BSP_IntHandlerERU1_01 @ 22, INTISR[ 6] ERU1 SR1 Interrupt. + .word BSP_IntHandlerERU1_02 @ 23, INTISR[ 7] ERU1 SR2 Interrupt. + .word BSP_IntHandlerERU1_03 @ 24, INTISR[ 8] ERU1 SR3 Interrupt. + + .word App_Spurious_ISR @ 25, INTISR[ 9] Reserved. + .word App_Spurious_ISR @ 26, INTISR[ 10] Reserved. + .word App_Spurious_ISR @ 27, INTISR[ 11] Reserved. + .word BSP_IntHandlerPMU0_00 @ 28, INTISR[ 12] Program Management Unit SR0 Interrupt. + .word App_Spurious_ISR @ 29, INTISR[ 13] Reserved. + + .word BSP_IntHandlerVADC0_C0_00 @ 30, INTISR[ 14] Analog to digital converter common block 0 SR0 Int. + .word BSP_IntHandlerVADC0_C0_01 @ 31, INTISR[ 15] Analog to digital converter common block 0 SR1 Int. + .word BSP_IntHandlerVADC0_C0_02 @ 32, INTISR[ 16] Analog to digital converter common block 0 SR2 Int. + .word BSP_IntHandlerVADC0_C0_03 @ 33, INTISR[ 17] Analog to digital converter common block 0 SR3 Int. + + .word BSP_IntHandlerVADC0_G0_00 @ 34, INTISR[ 18] Analog to digital converter group 0 SR0 Interrupt. + .word BSP_IntHandlerVADC0_G0_01 @ 35, INTISR[ 19] Analog to digital converter group 0 SR1 Interrupt. + .word BSP_IntHandlerVADC0_G0_02 @ 36, INTISR[ 20] Analog to digital converter group 0 SR2 Interrupt. + .word BSP_IntHandlerVADC0_G0_03 @ 37, INTISR[ 21] Analog to digital converter group 0 SR3 Interrupt. + .word BSP_IntHandlerVADC0_G1_00 @ 38, INTISR[ 22] Analog to digital converter group 1 SR0 Interrupt. + .word BSP_IntHandlerVADC0_G1_01 @ 39, INTISR[ 23] Analog to digital converter group 1 SR1 Interrupt. + .word BSP_IntHandlerVADC0_G1_02 @ 40, INTISR[ 24] Analog to digital converter group 1 SR2 Interrupt. + .word BSP_IntHandlerVADC0_G1_03 @ 41, INTISR[ 25] Analog to digital converter group 1 SR3 Interrupt. + .word BSP_IntHandlerVADC0_G2_00 @ 42, INTISR[ 26] Analog to digital converter group 2 SR0 Interrupt. + .word BSP_IntHandlerVADC0_G2_01 @ 43, INTISR[ 27] Analog to digital converter group 2 SR1 Interrupt. + .word BSP_IntHandlerVADC0_G2_02 @ 44, INTISR[ 28] Analog to digital converter group 2 SR2 Interrupt. + .word BSP_IntHandlerVADC0_G2_03 @ 45, INTISR[ 29] Analog to digital converter group 2 SR3 Interrupt. + .word BSP_IntHandlerVADC0_G3_00 @ 46, INTISR[ 30] Analog to digital converter group 3 SR0 Interrupt. + .word BSP_IntHandlerVADC0_G3_01 @ 47, INTISR[ 31] Analog to digital converter group 3 SR1 Interrupt. + .word BSP_IntHandlerVADC0_G3_02 @ 48, INTISR[ 32] Analog to digital converter group 3 SR2 Interrupt. + .word BSP_IntHandlerVADC0_G3_03 @ 49, INTISR[ 33] Analog to digital converter group 3 SR3 Interrupt. + + .word BSP_IntHandlerDSD0_00 @ 50, INTISR[ 34] Delta Sigma Demodulator SR0 Interrupt. + .word BSP_IntHandlerDSD0_01 @ 51, INTISR[ 35] Delta Sigma Demodulator SR1 Interrupt. + .word BSP_IntHandlerDSD0_02 @ 52, INTISR[ 36] Delta Sigma Demodulator SR2 Interrupt. + .word BSP_IntHandlerDSD0_03 @ 53, INTISR[ 37] Delta Sigma Demodulator SR3 Interrupt. + .word BSP_IntHandlerDSD0_04 @ 54, INTISR[ 38] Delta Sigma Demodulator SR4 Interrupt. + .word BSP_IntHandlerDSD0_05 @ 55, INTISR[ 39] Delta Sigma Demodulator SR5 Interrupt. + .word BSP_IntHandlerDSD0_06 @ 56, INTISR[ 40] Delta Sigma Demodulator SR6 Interrupt. + .word BSP_IntHandlerDSD0_07 @ 57, INTISR[ 41] Delta Sigma Demodulator SR7 Interrupt. + + .word BSP_IntHandlerDAC0_00 @ 58, INTISR[ 42] Digital to anolog converter SR0 Interrupt. + .word BSP_IntHandlerDAC0_01 @ 59, INTISR[ 43] Digital to anolog converter SR1 Interrupt. + + .word BSP_IntHandlerCCU40_00 @ 60, INTISR[ 44] Capture compare Unit 4 (Module 0) SR 0 Interrupt. + .word BSP_IntHandlerCCU40_01 @ 61, INTISR[ 45] Capture compare Unit 4 (Module 0) SR 1 Interrupt. + .word BSP_IntHandlerCCU40_02 @ 62, INTISR[ 46] Capture compare Unit 4 (Module 0) SR 2 Interrupt. + .word BSP_IntHandlerCCU40_03 @ 63, INTISR[ 47] Capture compare Unit 4 (Module 0) SR 3 Interrupt. + .word BSP_IntHandlerCCU41_00 @ 64, INTISR[ 48] Capture compare Unit 4 (Module 1) SR 0 Interrupt. + .word BSP_IntHandlerCCU41_01 @ 65, INTISR[ 49] Capture compare Unit 4 (Module 1) SR 1 Interrupt. + .word BSP_IntHandlerCCU41_02 @ 66, INTISR[ 50] Capture compare Unit 4 (Module 1) SR 2 Interrupt. + .word BSP_IntHandlerCCU41_03 @ 67, INTISR[ 51] Capture compare Unit 4 (Module 1) SR 3 Interrupt. + .word BSP_IntHandlerCCU42_00 @ 68, INTISR[ 52] Capture compare Unit 4 (Module 2) SR 0 Interrupt. + .word BSP_IntHandlerCCU42_01 @ 69, INTISR[ 53] Capture compare Unit 4 (Module 2) SR 1 Interrupt. + .word BSP_IntHandlerCCU42_02 @ 70, INTISR[ 54] Capture compare Unit 4 (Module 2) SR 2 Interrupt. + .word BSP_IntHandlerCCU42_03 @ 71, INTISR[ 55] Capture compare Unit 4 (Module 2) SR 3 Interrupt. + .word BSP_IntHandlerCCU43_00 @ 72, INTISR[ 56] Capture compare Unit 4 (Module 3) SR 0 Interrupt. + .word BSP_IntHandlerCCU43_01 @ 73, INTISR[ 57] Capture compare Unit 4 (Module 3) SR 1 Interrupt. + .word BSP_IntHandlerCCU43_02 @ 74, INTISR[ 58] Capture compare Unit 4 (Module 3) SR 2 Interrupt. + .word BSP_IntHandlerCCU43_03 @ 75, INTISR[ 59] Capture compare Unit 4 (Module 3) SR 3 Interrupt. + + .word BSP_IntHandlerCCU80_00 @ 76, INTISR[ 60] Capture compare Unit 8 (Module 0) SR 0 Interrupt. + .word BSP_IntHandlerCCU80_01 @ 77, INTISR[ 61] Capture compare Unit 8 (Module 0) SR 1 Interrupt. + .word BSP_IntHandlerCCU80_02 @ 78, INTISR[ 62] Capture compare Unit 8 (Module 0) SR 2 Interrupt. + .word BSP_IntHandlerCCU80_03 @ 79, INTISR[ 63] Capture compare Unit 8 (Module 0) SR 3 Interrupt. + .word BSP_IntHandlerCCU81_00 @ 80, INTISR[ 64] Capture compare Unit 8 (Module 1) SR 0 Interrupt. + .word BSP_IntHandlerCCU81_01 @ 81, INTISR[ 65] Capture compare Unit 8 (Module 1) SR 1 Interrupt. + .word BSP_IntHandlerCCU81_02 @ 82, INTISR[ 66] Capture compare Unit 8 (Module 1) SR 2 Interrupt. + .word BSP_IntHandlerCCU81_03 @ 83, INTISR[ 67] Capture compare Unit 8 (Module 1) SR 3 Interrupt. + + .word BSP_IntHandlerPOSIF0_00 @ 84, INTISR[ 68] Position interface (Module 0) SR0 Interrupt. + .word BSP_IntHandlerPOSIF0_01 @ 85, INTISR[ 69] Position interface (Module 0) SR1 Interrupt. + .word BSP_IntHandlerPOSIF1_00 @ 86, INTISR[ 70] Position interface (Module 1) SR0 Interrupt. + .word BSP_IntHandlerPOSIF1_01 @ 87, INTISR[ 71] Position interface (Module 1) SR1 Interrupt. + .word App_Spurious_ISR @ 88, INTISR[ 72] Reserved. + .word App_Spurious_ISR @ 89, INTISR[ 73] Reserved. + .word App_Spurious_ISR @ 90, INTISR[ 74] Reserved. + .word App_Spurious_ISR @ 91, INTISR[ 75] Reserved. + + .word BSP_IntHandlerCAN0_00 @ 92, INTISR[ 76] MultiCAN SR0 Interrupt. + .word BSP_IntHandlerCAN0_01 @ 93, INTISR[ 77] MultiCAN SR1 Interrupt. + .word BSP_IntHandlerCAN0_02 @ 94, INTISR[ 78] MultiCAN SR2 Interrupt. + .word BSP_IntHandlerCAN0_03 @ 95, INTISR[ 79] MultiCAN SR3 Interrupt. + .word BSP_IntHandlerCAN0_04 @ 96, INTISR[ 80] MultiCAN SR4 Interrupt. + .word BSP_IntHandlerCAN0_05 @ 97, INTISR[ 81] MultiCAN SR5 Interrupt. + .word BSP_IntHandlerCAN0_06 @ 98, INTISR[ 82] MultiCAN SR6 Interrupt. + .word BSP_IntHandlerCAN0_07 @ 99, INTISR[ 83] MultiCAN SR7 Interrupt. + .word BSP_IntHandlerUSIC0_00 @ 100, INTISR[ 84] Universal serial interface channel(Module 0) SR0 Int. + .word BSP_IntHandlerUSIC0_01 @ 101, INTISR[ 85] Universal serial interface channel(Module 0) SR1 Int. + .word BSP_IntHandlerUSIC0_02 @ 102, INTISR[ 86] Universal serial interface channel(Module 0) SR2 Int. + .word BSP_IntHandlerUSIC0_03 @ 103, INTISR[ 87] Universal serial interface channel(Module 0) SR3 Int. + .word BSP_IntHandlerUSIC0_04 @ 104, INTISR[ 88] Universal serial interface channel(Module 0) SR4 Int. + .word BSP_IntHandlerUSIC0_05 @ 105, INTISR[ 89] Universal serial interface channel(Module 0) SR5 Int. + .word BSP_IntHandlerUSIC1_00 @ 106, INTISR[ 90] Universal serial interface channel(Module 1) SR0 Int. + .word BSP_IntHandlerUSIC1_01 @ 107, INTISR[ 91] Universal serial interface channel(Module 1) SR1 Int. + .word BSP_IntHandlerUSIC1_02 @ 108, INTISR[ 92] Universal serial interface channel(Module 1) SR2 Int. + .word BSP_IntHandlerUSIC1_03 @ 109, INTISR[ 93] Universal serial interface channel(Module 1) SR3 Int. + .word BSP_IntHandlerUSIC1_04 @ 110, INTISR[ 94] Universal serial interface channel(Module 1) SR4 Int. + .word BSP_IntHandlerUSIC1_05 @ 111, INTISR[ 95] Universal serial interface channel(Module 1) SR5 Int. + .word BSP_IntHandlerUSIC2_00 @ 112, INTISR[ 96] Universal serial interface channel(Module 2) SR0 Int. + .word BSP_IntHandlerUSIC2_01 @ 113, INTISR[ 97] Universal serial interface channel(Module 2) SR1 Int. + .word BSP_IntHandlerUSIC2_02 @ 114, INTISR[ 98] Universal serial interface channel(Module 2) SR2 Int. + .word BSP_IntHandlerUSIC2_03 @ 115, INTISR[ 99] Universal serial interface channel(Module 2) SR3 Int. + .word BSP_IntHandlerUSIC2_04 @ 116, INTISR[100] Universal serial interface channel(Module 2) SR4 Int. + .word BSP_IntHandlerUSIC2_05 @ 117, INTISR[101] Universal serial interface channel(Module 2) SR5 Int. + + .word BSP_IntHandlerLEDTS0_00 @ 118, INTISR[102] LED and touch sense control unit (Module 0) SR0 Int. + .word App_Spurious_ISR @ 119, INTISR[103] Reserved. + .word BSP_IntHandlerFCE0_00 @ 120, INTISR[104] Flexible CRC Engine SR0 Interrupt. + .word BSP_IntHandlerGPDMA0_00 @ 121, INTISR[105] General purpose DMA unit 0 SR0 Interrupt. + .word BSP_IntHandlerSDMMC0_00 @ 122, INTISR[106] Secure Digital/MultiMediaCard interface SR0 Int. + .word BSP_IntHandlerUSB0_00 @ 123, INTISR[107] EUSB SR0 Interrupt. + .word BSP_IntHandlerETH0_00 @ 124, INTISR[108] Ethernet (Module 0) SR0 Interrupt. + .word App_Spurious_ISR @ 125, INTISR[109] Reserved. + .word BSP_IntHandlerGPDMA1_00 @ 126, INTISR[110] General purpose DMA unit 1 SR0 Interrupt. + .word App_Spurious_ISR @ 127, INTISR[111] Reserved. + + +@ Dummy Exception Handlers (infinite loops which can be modified) + + .section .text.App_NMI_ISR +App_NMI_ISR: + b App_NMI_ISR + .size App_NMI_ISR, .-App_NMI_ISR + + + .section .text.App_Fault_ISR +App_Fault_ISR: + b App_Fault_ISR + .size App_Fault_ISR, .-App_Fault_ISR + + + .section .text.App_MemFault_ISR +App_MemFault_ISR: + b App_MemFault_ISR + .size App_MemFault_ISR, .-App_MemFault_ISR + + + .section .text.App_BusFault_ISR +App_BusFault_ISR: + b App_BusFault_ISR + .size App_BusFault_ISR, .-App_BusFault_ISR + + + .section .text.App_UsageFault_ISR +App_UsageFault_ISR: + b App_UsageFault_ISR + .size App_UsageFault_ISR, .-App_UsageFault_ISR + + .section .text.App_Spurious_ISR +App_Spurious_ISR: + b App_Spurious_ISR + .size App_Spurious_ISR, .-App_Spurious_ISR + + + .section .text.App_Reserved_ISR +App_Reserved_ISR: + b App_Reserved_ISR + .size App_Reserved_ISR, .-App_Reserved_ISR + +.end diff --git a/XMC_UCOS3/APP_UART1_ECHO/Makefile b/XMC_UCOS3/APP_UART1_ECHO/Makefile new file mode 100644 index 0000000000000000000000000000000000000000..7f18cd1cadb40421f3762d07f03ce750073f6c6b --- /dev/null +++ b/XMC_UCOS3/APP_UART1_ECHO/Makefile @@ -0,0 +1,262 @@ +################################################################################ +# Makefile for XMC4500 RelaxKit using uCOS-III +# v1, 02/2015 +# Martin Horauer, UAS Technikum Wien +# +# Supported: Windows, Linux, OSX +# Requirements: +# * GCC ARM https://launchpad.net/gcc-arm-embedded/+download +# * SEGGER JLINK https://www.segger.com/jlink-software.html +# * DOXYGEN http://www.stack.nl/~dimitri/doxygen/ + +################################################################################ +# USAGE +# ----- +# make .... build the program image +# make debug .... build the program image and invoke gdb +# make flash .... build an flash the application +# make erase .... erase the target device +# make doc .... run doxygen - output will be in > doc +# make clean .... remove intermediate and generated files + +################################################################################ +# define the name of the generated output file +# +TARGET = main + +################################################################################ +# below only edit with care +# +VENDOR = Infineon + +################################################################################ +# define the following symbol -D JLINK_RTT to enable JLINK_RTT tracing +# -D SEMI_HOSTING to enable semi hosted tracing +# comment the line to disable tracing +TRACE = -D SEMI_HOSTING + +################################################################################ +# DIRECTORIES +SRCDIR = . +BIN = ./bin +DOC = ./doc +SYS = ../CMSIS +XMCLIB = ../XMCLIB +OS = ../UCOS3 +BSP = $(SRCDIR)/BSP +CMSIS = $(SYS)/CMSIS +CMSIS_INCDIR = $(CMSIS)/Include +CMSIS_LIBDIR = $(CMSIS)/Lib/GCC +INF_INCDIR = $(CMSIS)/$(VENDOR)/Include +INF_LIBDIR = $(CMSIS)/$(VENDOR)/Lib +XMC_INCDIR = $(CMSIS)/$(VENDOR)/$(UC)_series/Include +XMC_LIBDIR = $(CMSIS)/$(VENDOR)/$(UC)_series/Lib +XMC_SRCDIR = $(CMSIS)/$(VENDOR)/$(UC)_series/Source +XMC_GCCDIR = $(CMSIS)/$(VENDOR)/$(UC)_series/Source/GCC +XMC_LIBINCDIR = $(XMCLIB)/inc +XMC_LIBSRCDIR = $(XMCLIB)/src +XMC_USBINCDIR = $(XMCLIB)/inc/USB +XMC_USBLIBDIR = $(XMCLIB)/src/USB + +################################################################################ +# TOOLS & ARGS +# +TERMINAL = gnome-terminal +TOOLCHAIN = arm-none-eabi +AS = $(TOOLCHAIN)-as +CC = $(TOOLCHAIN)-gcc +CP = $(TOOLCHAIN)-objcopy +OD = $(TOOLCHAIN)-objdump +GDB = $(TOOLCHAIN)-gdb +SIZE = $(TOOLCHAIN)-size +# DETERMINE OS +ifdef SystemRoot + RM = del /Q + FixPath = $(subst /,\,$1) +else + RM = rm -rf + FixPath = $1 +endif + +UC = XMC4500 +UC_ID = 4503 +CPU = cortex-m4 +FPU = fpv4-sp-d16 +FABI = softfp #soft, softfp, hard +LIBS = -larm_cortexM4_mathL_2 +LIBS += -lxmclibcstubs +LIBS += -lm +GDB_ARGS = -ex "target remote :2331" +GDB_ARGS += -ex "monitor reset" +GDB_ARGS += -ex "load" +GDB_ARGS += -ex "monitor reset" + +################################################################################ +# SEMI_HOSTED DEBUGGING +GDB_ARGS += -ex "monitor SWO EnableTarget 16000000 0 1 0" + +# RTT OPTION +#GDB_ARGS += -ex "monitor exec SetRTTAddr 0x20000000" +#GDB_ARGS += -ex "monitor exec SetRTTSearchRanges 0x20000000 0x1000" + +################################################################################ +# OS Source +SRC = $(wildcard *.c) +SRC += $(OS)/uC-CPU/cpu_core.c +SRC += $(OS)/uC-CPU/ARM-Cortex-M4/GNU/cpu_c.c +SRC += $(wildcard $(OS)/uC-LIB/*.c) +SRC += $(wildcard $(OS)/uCOS-III/Source/*.c) +SRC += $(OS)/uCOS-III/Ports/ARM-Cortex-M4/Generic/GNU/os_cpu_c.c +SRC += $(wildcard $(BSP)/*.c) + +################################################################################ +# SYSTEM SOURCES +SRC += $(INF_LIBDIR)/System_LibcStubs.c +SRC += $(XMC_SRCDIR)/System_XMC4500.c +SRC += $(wildcard $(XMC_LIBSRCDIR)/*.c) +SRC += $(wildcard $(XMC_USBLIBDIR)/*.c) + +################################################################################ +# ASSEMBLER SOURCES +SRCASM = $(BSP)/startup.asm +SRCASM += $(OS)/uCOS-III/Ports/ARM-Cortex-M4/Generic/GNU/os_cpu_a.asm +SRCASM += $(OS)/uC-CPU/ARM-Cortex-M4/GNU/cpu_a.asm +SRCASM += $(OS)/uC-LIB/Ports/ARM-Cortex-M4/GNU/lib_mem_a.asm +SRCASM += $(XMC_GCCDIR)/startup_XMC4500.asm + +################################################################################ +# LINKER_FILE +LINKER_FILE = $(XMC_GCCDIR)/xmc4500_ucos.ld + +################################################################################ +# INCLUDE DIRECTORIES +OS_INCDIR += -I$(OS) +OS_INCDIR += -I$(OS)/uC-CPU +OS_INCDIR += -I$(OS)/uC-CPU/ARM-Cortex-M4/GNU +OS_INCDIR += -I$(OS)/uC-LIB +OS_INCDIR += -I$(OS)/uCOS-III/Source +OS_INCDIR += -I$(OS)/uCOS-III/Ports/ARM-Cortex-M4/Generic/GNU +OS_INCDIR += -I$(BSP) + +INC_DIR = -I$(SRCDIR) +INC_DIR+= -I$(SYS) +INC_DIR+= -I$(CMSIS_INCDIR) +INC_DIR+= -I$(INF_INCDIR) +INC_DIR+= -I$(XMC_INCDIR) +INC_DIR+= -I$(OS_INCDIR) +INC_DIR+= -I$(XMC_LIBINCDIR) +INC_DIR+= -I$(XMC_USBINCDIR) + +################################################################################ +# LIBRARY DIRECTORIES +LIBS_DIR = -L$(SYS) +LIBS_DIR += -L$(CMSIS_LIBDIR) +LIBS_DIR += -L$(INF_LIBDIR) +LIBS_DIR += -L$(XMC_LIBDIR) + +################################################################################ +# OBJECT FILES +OBJS = $(SRC:.c=.o) +OBJS+= $(SRCASM:.asm=.o) + +################################################################################ +# DEPENDENCY FILES +DEPS = $(SRC:.c=.d) +DEPS += $(SRCASM:.asm=.d) + +################################################################################ +# STACK USAGE FILES +SU = $(SRC:.c=.su) + +################################################################################ +# COMPILER, ASSEMBLER OPTIONS +CFLAGS = -mthumb +CFLAGS+= -mcpu=$(CPU) +#CFLAGS+= -mfpu=$(FPU) +#CFLAGS+= -mfloat-abi=$(FABI) +CFLAGS+= -O0 +CFLAGS+= -ffunction-sections -fdata-sections -fsigned-char -fstack-usage +CFLAGS+= -MD -std=c99 -Wall -fms-extensions +CFLAGS+= -DUC_ID=$(UC_ID) -DARM_MATH_CM4 -DXMC4500_F144x1024 +CFLAGS+= -g3 -fmessage-length=0 +AFLAGS = -x assembler-with-cpp +LFLAGS = -nostartfiles $(LIBS_DIR) -Wl,--gc-sections -Wl,-Map=bin/$(TARGET).map +CPFLAGS = -Obinary +ODFLAGS = -S + +################################################################################ +# BUILD RULES +all: $(OBJS) $(TARGET).elf $(TARGET) + +%.o: %.asm + @echo "----------------------------------------------------------------------" + @echo "Assembly of $<:" + @echo "" + $(CC) -c $(CFLAGS) $(INC_DIR) $(AFLAGS) $< -o $@ + @echo "" + +%.o: %.c + @echo "----------------------------------------------------------------------" + @echo "Compilation of $<:" + @echo "" + $(CC) -c $(CFLAGS) $(INC_DIR) $< -o $@ + @echo "" + +$(TARGET).elf: $(OBJS) + @echo "----------------------------------------------------------------------" + @echo "Linking:" + @echo "" + $(CC) -T $(LINKER_FILE) $(LFLAGS) $(CFLAGS) -o $(BIN)/$(TARGET).elf $(OBJS) $(LIBS) + @echo "" + +$(TARGET): $(TARGET).elf + @echo "----------------------------------------------------------------------" + @echo "Creation of Binary:" + @echo "" + $(CP) $(CPFLAGS) $(BIN)/$(TARGET).elf $(BIN)/$(TARGET).bin + @echo "----------------------------------------------------------------------" + @echo "Create Listing File:" + @echo "" + $(OD) $(ODFLAGS) $(BIN)/$(TARGET).elf > $(BIN)/$(TARGET).lst + @echo "----------------------------------------------------------------------" + @echo "Create Static Usage Analysis:" + @echo "" + $(SIZE) $(BIN)/$(TARGET).elf + +################################################################################ +# DEBUG RULES +debug: $(TARGET) +# comment the following line in Windows and launch JLinkGDBServer manually +ifdef SystemRoot + @call start JLinkGDBServer -Device XMC4500-1024 -if SWD +else + $(TERMINAL) -e "JLinkGDBServer -Device XMC4500-1024 -if SWD" & + sleep 1 && $(TERMINAL) -e "telnet localhost 2333" & +endif + $(GDB) -q $(BIN)/$(TARGET).elf $(GDB_ARGS) + +################################################################################ +# FLASH RULES +flash: $(TARGET) + echo -e 'speed 4000\nconnect\nh\nloadbin bin/$(TARGET).bin,0xC000000\nr\ng\nq' | JLinkExe -Device XMC4500-1024 -if SWD + +################################################################################ +# ERASE DEVICE +erase: + echo -e 'speed 4000\nconnect\nerase\nr\nq' | JLinkExe -Device XMC4500-1024 -if SWD + +################################################################################ +# DOCUMENTATION RULES +doc: $(TARGET) + doxygen + +################################################################################ +# CLEAN RULES +clean: + $(RM) $(call FixPath, ${OBJS} ${DEPS} ${SU}) + $(RM) $(call FixPath, ${BIN}/*) + $(RM) $(call FixPath, ${DOC}/html/*) + +################################################################################ +# EOF +################################################################################ diff --git a/XMC_UCOS3/APP_UART1_ECHO/_Makefile b/XMC_UCOS3/APP_UART1_ECHO/_Makefile new file mode 100644 index 0000000000000000000000000000000000000000..915c923a461cb489a4e89e54cb4a9d843229a040 --- /dev/null +++ b/XMC_UCOS3/APP_UART1_ECHO/_Makefile @@ -0,0 +1,258 @@ +################################################################################ +# Makefile for XMC4500 RelaxKit using uCOS-III +# v1, 02/2015 +# Martin Horauer, UAS Technikum Wien +# +# Supported: Windows, Linux, OSX +# Requirements: +# * GCC ARM https://launchpad.net/gcc-arm-embedded/+download +# * SEGGER JLINK https://www.segger.com/jlink-software.html +# * DOXYGEN http://www.stack.nl/~dimitri/doxygen/ + +################################################################################ +# USAGE +# ----- +# make .... build the program image +# make debug .... build the program image and invoke gdb +# make flash .... build an flash the application +# make erase .... erase the target device +# make doc .... run doxygen - output will be in > doc +# make clean .... remove intermediate and generated files + +################################################################################ +# define the name of the generated output file +# +TARGET = main + +################################################################################ +# below only edit with care +# +VENDOR = Infineon + +################################################################################ +# define the following symbol -D JLINK_RTT to enable JLINK_RTT tracing +# -D SEMI_HOSTING to enable semi hosted tracing +# comment the line to disable tracing +TRACE = -D SEMI_HOSTING + +################################################################################ +# DIRECTORIES +SRCDIR = ./ +BIN = ./bin +DOC = ./doc +SYS = ../CMSIS +XMCLIB = ../XMCLIB +OS = ../UCOS3 +BSP = $(SRCDIR)/BSP +CMSIS = $(SYS)/CMSIS +CMSIS_INCDIR = $(CMSIS)/Include +CMSIS_LIBDIR = $(CMSIS)/Lib/GCC +INF_INCDIR = $(CMSIS)/$(VENDOR)/Include +INF_LIBDIR = $(CMSIS)/$(VENDOR)/Lib +XMC_INCDIR = $(CMSIS)/$(VENDOR)/$(UC)_series/Include +XMC_LIBDIR = $(CMSIS)/$(VENDOR)/$(UC)_series/Lib +XMC_SRCDIR = $(CMSIS)/$(VENDOR)/$(UC)_series/Source +XMC_GCCDIR = $(CMSIS)/$(VENDOR)/$(UC)_series/Source/GCC +XMC_LIBINCDIR = $(XMCLIB)/inc +XMC_LIBSRCDIR = $(XMCLIB)/src + +################################################################################ +# TOOLS & ARGS +# +TERMINAL = gnome-terminal +TOOLCHAIN = arm-none-eabi +AS = $(TOOLCHAIN)-as +CC = $(TOOLCHAIN)-gcc +CP = $(TOOLCHAIN)-objcopy +OD = $(TOOLCHAIN)-objdump +GDB = $(TOOLCHAIN)-gdb +SIZE = $(TOOLCHAIN)-size +# DETERMINE OS +ifdef SystemRoot + RM = del /Q + FixPath = $(subst /,\,$1) +else + RM = rm -rf + FixPath = $1 +endif + +UC = XMC4500 +UC_ID = 4503 +CPU = cortex-m4 +FPU = fpv4-sp-d16 +FABI = softfp #soft, softfp, hard +LIBS = -larm_cortexM4_mathL_2 +LIBS += -lxmclibcstubs +LIBS += -lm +GDB_ARGS = -ex "target remote :2331" +GDB_ARGS += -ex "monitor reset" +GDB_ARGS += -ex "load" +GDB_ARGS += -ex "monitor reset" + +################################################################################ +# SEMI_HOSTED DEBUGGING +GDB_ARGS += -ex "monitor SWO EnableTarget 16000000 0 1 0" + +# RTT OPTION +#GDB_ARGS += -ex "monitor exec SetRTTAddr 0x20000000" +#GDB_ARGS += -ex "monitor exec SetRTTSearchRanges 0x20000000 0x1000" + +################################################################################ +# OS Source +SRC = $(wildcard *.c) +SRC += $(OS)/uC-CPU/cpu_core.c +SRC += $(OS)/uC-CPU/ARM-Cortex-M4/GNU/cpu_c.c +SRC += $(wildcard $(OS)/uC-LIB/*.c) +SRC += $(wildcard $(OS)/uCOS-III/Source/*.c) +SRC += $(OS)/uCOS-III/Ports/ARM-Cortex-M4/Generic/GNU/os_cpu_c.c +SRC += $(wildcard $(BSP)/*.c) + +################################################################################ +# SYSTEM SOURCES +SRC += $(INF_LIBDIR)/System_LibcStubs.c +SRC += $(XMC_SRCDIR)/System_XMC4500.c +SRC += $(wildcard $(XMC_LIBSRCDIR)/*.c) + +################################################################################ +# ASSEMBLER SOURCES +SRCASM = $(BSP)/startup.asm +SRCASM += $(OS)/uCOS-III/Ports/ARM-Cortex-M4/Generic/GNU/os_cpu_a.asm +SRCASM += $(OS)/uC-CPU/ARM-Cortex-M4/GNU/cpu_a.asm +SRCASM += $(OS)/uC-LIB/Ports/ARM-Cortex-M4/GNU/lib_mem_a.asm +SRCASM += $(XMC_GCCDIR)/startup_XMC4500.asm + +################################################################################ +# LINKER_FILE +LINKER_FILE = $(XMC_GCCDIR)/xmc4500_ucos.ld + +################################################################################ +# INCLUDE DIRECTORIES +OS_INCDIR += -I$(OS) +OS_INCDIR += -I$(OS)/uC-CPU +OS_INCDIR += -I$(OS)/uC-CPU/ARM-Cortex-M4/GNU +OS_INCDIR += -I$(OS)/uC-LIB +OS_INCDIR += -I$(OS)/uCOS-III/Source +OS_INCDIR += -I$(OS)/uCOS-III/Ports/ARM-Cortex-M4/Generic/GNU +OS_INCDIR += -I$(BSP) + +INC_DIR = -I$(SRCDIR) +INC_DIR+= -I$(SYS) +INC_DIR+= -I$(CMSIS_INCDIR) +INC_DIR+= -I$(INF_INCDIR) +INC_DIR+= -I$(XMC_INCDIR) +INC_DIR+= -I$(OS_INCDIR) +INC_DIR+= -I$(XMC_LIBINCDIR) + +################################################################################ +# LIBRARY DIRECTORIES +LIBS_DIR = -L$(SYS) +LIBS_DIR += -L$(CMSIS_LIBDIR) +LIBS_DIR += -L$(INF_LIBDIR) +LIBS_DIR += -L$(XMC_LIBDIR) + +################################################################################ +# OBJECT FILES +OBJS = $(SRC:.c=.o) +OBJS+= $(SRCASM:.asm=.o) + +################################################################################ +# DEPENDENCY FILES +DEPS = $(SRC:.c=.d) +DEPS += $(SRCASM:.asm=.d) + +################################################################################ +# STACK USAGE FILES +SU = $(SRC:.c=.su) + +################################################################################ +# COMPILER, ASSEMBLER OPTIONS +CFLAGS = -mthumb +CFLAGS+= -mcpu=$(CPU) +#CFLAGS+= -mfpu=$(FPU) +#CFLAGS+= -mfloat-abi=$(FABI) +CFLAGS+= -O0 +CFLAGS+= -ffunction-sections -fdata-sections -fsigned-char -fstack-usage +CFLAGS+= -MD -std=c99 -Wall -fms-extensions +CFLAGS+= -DUC_ID=$(UC_ID) -DARM_MATH_CM4 -DXMC4500_F144x1024 +CFLAGS+= -g3 -fmessage-length=0 +AFLAGS = -x assembler-with-cpp +LFLAGS = -nostartfiles $(LIBS_DIR) -Wl,--gc-sections -Wl,-Map=bin/$(TARGET).map +CPFLAGS = -Obinary +ODFLAGS = -S + +################################################################################ +# BUILD RULES +all: $(OBJS) $(TARGET).elf $(TARGET) + +%.o: %.asm + @echo "----------------------------------------------------------------------" + @echo "Assembly of $<:" + @echo "" + $(CC) -c $(CFLAGS) $(INC_DIR) $(AFLAGS) $< -o $@ + @echo "" + +%.o: %.c + @echo "----------------------------------------------------------------------" + @echo "Compilation of $<:" + @echo "" + $(CC) -c $(CFLAGS) $(INC_DIR) $< -o $@ + @echo "" + +$(TARGET).elf: $(OBJS) + @echo "----------------------------------------------------------------------" + @echo "Linking:" + @echo "" + $(CC) -T $(LINKER_FILE) $(LFLAGS) $(CFLAGS) -o $(BIN)/$(TARGET).elf $(OBJS) $(LIBS) + @echo "" + +$(TARGET): $(TARGET).elf + @echo "----------------------------------------------------------------------" + @echo "Creation of Binary:" + @echo "" + $(CP) $(CPFLAGS) $(BIN)/$(TARGET).elf $(BIN)/$(TARGET).bin + @echo "----------------------------------------------------------------------" + @echo "Create Listing File:" + @echo "" + $(OD) $(ODFLAGS) $(BIN)/$(TARGET).elf > $(BIN)/$(TARGET).lst + @echo "----------------------------------------------------------------------" + @echo "Create Static Usage Analysis:" + @echo "" + $(SIZE) $(BIN)/$(TARGET).elf + +################################################################################ +# DEBUG RULES +debug: $(TARGET) +# comment the following line in Windows and launch JLinkGDBServer manually +ifdef SystemRoot + @call start JLinkGDBServer -Device XMC4500-1024 -if SWD +else + $(TERMINAL) -e "JLinkGDBServer -Device XMC4500-1024 -if SWD" & + sleep 1 && $(TERMINAL) -e "telnet localhost 2333" & +endif + $(GDB) -q $(BIN)/$(TARGET).elf $(GDB_ARGS) + +################################################################################ +# FLASH RULES +flash: $(TARGET) + echo -e 'speed 4000\nconnect\nh\nloadbin bin/$(TARGET).bin,0xC000000\nr\ng\nq' | JLinkExe -Device XMC4500-1024 -if SWD + +################################################################################ +# ERASE DEVICE +erase: + echo -e 'speed 4000\nconnect\nerase\nr\nq' | JLinkExe -Device XMC4500-1024 -if SWD + +################################################################################ +# DOCUMENTATION RULES +doc: $(TARGET) + doxygen + +################################################################################ +# CLEAN RULES +clean: + $(RM) $(call FixPath, ${OBJS} ${DEPS} ${SU}) + $(RM) $(call FixPath, ${BIN}/*) + $(RM) $(call FixPath, ${DOC}/html/*) + +################################################################################ +# EOF +################################################################################ diff --git a/XMC_UCOS3/APP_UART1_ECHO/app.c b/XMC_UCOS3/APP_UART1_ECHO/app.c new file mode 100644 index 0000000000000000000000000000000000000000..f37fdae95220711ef2167a6ad356bfbbb6cb3ff5 --- /dev/null +++ b/XMC_UCOS3/APP_UART1_ECHO/app.c @@ -0,0 +1,324 @@ +/** + * \file app.c + * + * \mainpage Application for UART communication tests + * + * Build: make debug OR make flash + * Connect a TTL USB cable to UART1, launch a terminal program and initiate + * communication, e.g. (without the quotes): + * PC -> uC: "#Hello$" + * uC -> PC: "XMC: Hello" + * + * @author Beneder Roman, Martin Horauer, UAS Technikum Wien + * @revision 0.2 + * @date 02-2018 + */ + +/******************************************************************* INCLUDES */ +#include +#include +#include + +#include +#include +#include + +#include +#include +#include +#include + +#include +#include + +#include + +#include + +#if SEMI_HOSTING +#include +#endif + +#if JLINK_RTT +#include +#include +#endif + +/******************************************************************** DEFINES */ +#define ACK 0x6 +#define MAX_MSG_LENGTH 20 +#define NUM_MSG 3 + +/********************************************************* FILE LOCAL GLOBALS */ +static CPU_STK AppStartTaskStk[APP_CFG_TASK_START_STK_SIZE]; // <1> +static OS_TCB AppStartTaskTCB; + +static CPU_STK AppTaskComStk[APP_CFG_TASK_COM_STK_SIZE]; +static OS_TCB AppTaskComTCB; + +// Memory Block // <2> +OS_MEM Mem_Partition; +CPU_CHAR MyPartitionStorage[NUM_MSG - 1][MAX_MSG_LENGTH]; +// Message Queue +OS_Q UART_ISR; + +/****************************************************** FILE LOCAL PROTOTYPES */ +static void AppTaskStart (void *p_arg); +static void AppTaskCreate (void); +static void AppObjCreate (void); +static void AppTaskCom (void *p_arg); + +/************************************************************ FUNCTIONS/TASKS */ + +/*********************************************************************** MAIN */ +/** + * \function main + * \params none + * \returns 0 always + * + * \brief This is the standard entry point for C code. + */ +int main (void) +{ + OS_ERR err; + + // Disable all interrupts // <3> + BSP_IntDisAll(); + // Enable Interrupt UART + BSP_IntEn (BSP_INT_ID_USIC1_01); //** + BSP_IntEn (BSP_INT_ID_USIC1_00); //** + +// init SEMI Hosting DEBUG Support // <4> +#if SEMI_HOSTING + initRetargetSwo(); +#endif + +// init JLINK RTT DEBUG Support +#if JLINK_RTT + SEGGER_RTT_ConfigDownBuffer (0, NULL, NULL, 0, + SEGGER_RTT_MODE_BLOCK_IF_FIFO_FULL); + SEGGER_RTT_ConfigUpBuffer (0, NULL, NULL, 0, + SEGGER_RTT_MODE_BLOCK_IF_FIFO_FULL); +#endif + + // Init uC/OS-III + OSInit (&err); // <5> + if (err != OS_ERR_NONE) + APP_TRACE_DBG ("Error OSInit: main\n"); + + /* Create the start task */ // <6> + OSTaskCreate ( (OS_TCB *) &AppStartTaskTCB, + (CPU_CHAR *) "Startup Task", + (OS_TASK_PTR) AppTaskStart, + (void *) 0, + (OS_PRIO) APP_CFG_TASK_START_PRIO, + (CPU_STK *) &AppStartTaskStk[0], + (CPU_STK_SIZE) APP_CFG_TASK_START_STK_SIZE / 10u, + (CPU_STK_SIZE) APP_CFG_TASK_START_STK_SIZE, + (OS_MSG_QTY) 0u, + (OS_TICK) 0u, + (void *) 0, + (OS_OPT) (OS_OPT_TASK_STK_CHK | OS_OPT_TASK_STK_CLR), + (OS_ERR *) &err); + + // Start multitasking (i.e., give control to uC/OS-III) + OSStart (&err); // <7> + if (err != OS_ERR_NONE) + APP_TRACE_DBG ("Error OSStart: main\n"); + + while (1) { // <8> + APP_TRACE_DBG ("Should never be output! Bug?\n"); + } + return 0; +} + +/*************************************************************** STARTUP TASK */ +/** + * \function AppTaskStart + * \ params p_arg ... argument passed to AppTaskStart() by + * OSTaskCreate() + * \returns none + * + * \brief Startup (init) task that loads board support functions, + * initializes CPU services, the memory, the systick timer, + * etc. and finally invokes other application tasks. + */ +static void AppTaskStart (void *p_arg) +{ + CPU_INT32U cpu_clk_freq; + CPU_INT32U cnts; + OS_ERR err; + + (void) p_arg; + // initialize BSP functions + BSP_Init(); // <9> + // initialize the uC/CPU services + CPU_Init(); + // determine SysTick reference frequency + cpu_clk_freq = BSP_SysClkFreqGet(); + // determine nbr SysTick increments + cnts = cpu_clk_freq / (CPU_INT32U) OSCfg_TickRate_Hz; + // init uCOS-III periodic time src (SysTick) + OS_CPU_SysTickInit (cnts); + // initialize memory management module + Mem_Init(); + // initialize mathematical module + Math_Init(); + +// compute CPU capacity with no task running +#if (OS_CFG_STAT_TASK_EN > 0u) // <10> + OSStatTaskCPUUsageInit (&err); + if (err != OS_ERR_NONE) + APP_TRACE_DBG ("Error OSStatTaskCPUUsageInit: AppTaskStart\n"); +#endif + + APP_TRACE_INFO ("Creating Application Objects...\n"); // <11> + // create application objects + AppObjCreate(); + + APP_TRACE_INFO ("Creating Application Tasks...\n"); // <12> + // create application tasks + AppTaskCreate(); + + while (DEF_TRUE) { // <13> + // Suspend current task + OSTaskSuspend ( (OS_TCB *) 0, &err); + if (err != OS_ERR_NONE) + APP_TRACE_DBG ("Error OSTaskSuspend: AppTaskStart\n"); + } +} + +/************************************************* Create Application Objects */ +/** + * \function AppObjCreate() + * \brief Creates application objects. + * \params none + * \returns none + */ +static void AppObjCreate (void) +{ + OS_ERR err; + + // Create Shared Memory + OSMemCreate ( (OS_MEM *) &Mem_Partition, + (CPU_CHAR *) "Mem Partition", + (void *) &MyPartitionStorage[0][0], + (OS_MEM_QTY) NUM_MSG, + (OS_MEM_SIZE) MAX_MSG_LENGTH * sizeof (CPU_CHAR), + (OS_ERR *) &err); + if (err != OS_ERR_NONE) + APP_TRACE_DBG ("Error OSMemCreate: AppObjCreate\n"); + + // Create Message Queue + OSQCreate ( (OS_Q *) &UART_ISR, + (CPU_CHAR *) "ISR Queue", + (OS_MSG_QTY) NUM_MSG, + (OS_ERR *) &err); + if (err != OS_ERR_NONE) + APP_TRACE_DBG ("Error OSQCreate: AppObjCreate\n"); +} + +/*************************************************** Create Application Tasks */ +/** + * \function AppTaskCreate() + * \brief Creates one application task. + * \params none + * \returns none + */ +static void AppTaskCreate (void) +{ + OS_ERR err; + + // create AppTask_COM + OSTaskCreate ( (OS_TCB *) &AppTaskComTCB, + (CPU_CHAR *) "TaskCOM", + (OS_TASK_PTR) AppTaskCom, + (void *) 0, + (OS_PRIO) APP_CFG_TASK_COM_PRIO, + (CPU_STK *) &AppTaskComStk[0], + (CPU_STK_SIZE) APP_CFG_TASK_COM_STK_SIZE / 10u, + (CPU_STK_SIZE) APP_CFG_TASK_COM_STK_SIZE, + (OS_MSG_QTY) 0u, + (OS_TICK) 0u, + (void *) 0, + (OS_OPT) (OS_OPT_TASK_STK_CHK | OS_OPT_TASK_STK_CLR), + (OS_ERR *) &err); + if (err != OS_ERR_NONE) + APP_TRACE_DBG ("Error OSTaskCreate: AppTaskCreate\n"); +} + +/*********************************** Communication Application Task */ +/** + * \function AppTaskCom + * \ params p_arg ... argument passed to AppTaskCom() by + * AppTaskCreate() + * \returns none + * + * \brief Task for Communication between UART_ISR (see BSP/bsp_int.c) + * and AppTaskCom. Communication from the ISR to the AppTaskCom is + * facilitated using a message queue. + * + * Debug trace mesages are output to the SEGGER J-Link GDB Server. + * + * (1) Debug or Flash the application. + * (2) Connect a TTL-USB UART cable: + * GND (BLACK) - GND, TX (GREEN) - P0.0, RX (WHITE) - P0.1 + * (3) Launch a terminal program and connect with 9600-8N1 + * Enter strings like: #12345$, #abc$, etc. + * The XMC will respond with: XMC: 12345, XMC: abc, etc. + */ +static void AppTaskCom (void *p_arg) +{ + void *p_msg; + OS_ERR err; + OS_MSG_SIZE msg_size; + CPU_TS ts; + CPU_CHAR msg[MAX_MSG_LENGTH]; + CPU_INT08U i = 0; + CPU_CHAR debug_msg[MAX_MSG_LENGTH + 30]; + + (void) p_arg; // <14> + APP_TRACE_INFO ("Entering AppTaskCom ...\n"); + while (DEF_TRUE) { + // empty the message buffer + memset (&msg, 0, MAX_MSG_LENGTH); // <15> + + // wait until a message is received + p_msg = OSQPend (&UART_ISR, // <16> + 0, + OS_OPT_PEND_BLOCKING, + &msg_size, + &ts, + &err); + if (err != OS_ERR_NONE) + APP_TRACE_DBG ("Error OSQPend: AppTaskCom\n"); + + // obtain message we received + memcpy (msg, (CPU_CHAR*) p_msg, msg_size - 1); // <17> + + // release the memory partition allocated in the UART service routine + OSMemPut (&Mem_Partition, p_msg, &err); // <18> + if (err != OS_ERR_NONE) + APP_TRACE_DBG ("Error OSMemPut: AppTaskCom\n"); + + // send ACK in return + XMC_UART_CH_Transmit (XMC_UART1_CH1, ACK); // <19> + + // print the received message to the debug interface + sprintf (debug_msg, "Msg: %s\tLength: %d\n", msg, msg_size - 1); // <20> + APP_TRACE_INFO (debug_msg); + + // send the received message back via the UART pre-text with "XMC: " + XMC_UART_CH_Transmit (XMC_UART1_CH1, 'X'); // <21> + XMC_UART_CH_Transmit (XMC_UART1_CH1, 'M'); + XMC_UART_CH_Transmit (XMC_UART1_CH1, 'C'); + XMC_UART_CH_Transmit (XMC_UART1_CH1, ':'); + XMC_UART_CH_Transmit (XMC_UART1_CH1, ' '); + for (i = 0; i <= msg_size; i++) { + XMC_UART_CH_Transmit (XMC_UART1_CH1, msg[i]); + } + XMC_UART_CH_Transmit (XMC_UART1_CH1, '\n'); + } +} +/************************************************************************ EOF */ +/******************************************************************************/ diff --git a/XMC_UCOS3/APP_UART1_ECHO/app_cfg.h b/XMC_UCOS3/APP_UART1_ECHO/app_cfg.h new file mode 100644 index 0000000000000000000000000000000000000000..529a526e05376fd47a416f0d96b5b13dfaec1bad --- /dev/null +++ b/XMC_UCOS3/APP_UART1_ECHO/app_cfg.h @@ -0,0 +1,85 @@ +/** + * @file app_cfg.h + * + * @brief Application Configuration + */ + +#ifndef APP_CFG_MODULE_PRESENT +#define APP_CFG_MODULE_PRESENT + +/**************************************************** MODULE ENABLE / DISABLE */ +/** + * enable/disable semi hosted debug outputs + * + * @note: (1) Using the command-line debugger un-comment the GDB_ARGS in the + * Makefile below SEMI_HOSTED DEBUGGING + * (2) Start "telnet localhost 2333" before invoking "make debug" + */ + +#define SEMI_HOSTING 1 +/** + * enable/disable SEGGER RTT JLINK functionality + * see: https://www.segger.com/jlink-real-time-terminal.html + * + * @note: (1) Un-comment the GDB_ARGS in the Makefile below RTT_OPTION + * (2) Start "JLinkRTTClient" before invoking "make debug" + * Doesn't work using eclipse! :-( + */ +#define JLINK_RTT 0 + +/************************************************************ TASK PRIORITIES */ +#define APP_CFG_TASK_START_PRIO 2u +#define APP_CFG_TASK_COM_PRIO 10u + +/*********************************************************** TASK STACK SIZES */ +#define APP_CFG_TASK_START_STK_SIZE 256u +#define APP_CFG_TASK_COM_STK_SIZE 256u + +/************************************************ TRACE / DEBUG CONFIGURATION */ + +#ifndef TRACE_LEVEL_OFF +#define TRACE_LEVEL_OFF 0 +#endif + +#ifndef TRACE_LEVEL_INFO +#define TRACE_LEVEL_INFO 1 +#endif + +#ifndef TRACE_LEVEL_DBG +#define TRACE_LEVEL_DBG 2 +#endif + +#ifndef SEMI_HOSTING_PRINTF +#define SEMI_HOSTING_PRINTF printf +#endif + +#ifndef JLINK_RTT_PRINTF +#define JLINK_RTT_PRINTF SEGGER_RTT_printf +#endif + +/* set the following define to enable trace messages off/info/debug */ +#define APP_TRACE_LEVEL TRACE_LEVEL_DBG +#if SEMI_HOSTING +#define APP_TRACE SEMI_HOSTING_PRINTF +#endif + +#if JLINK_RTT +#define APP_TRACE JLINK_RTT_PRINTF +#endif + +#if SEMI_HOSTING +#define APP_TRACE_INFO(x) \ + ((APP_TRACE_LEVEL >= TRACE_LEVEL_INFO) ? (void)(APP_TRACE(x)) : (void)0) +#define APP_TRACE_DBG(x) \ + ((APP_TRACE_LEVEL >= TRACE_LEVEL_DBG) ? (void)(APP_TRACE(x)) : (void)0) +#endif + +#if JLINK_RTT +#define APP_TRACE_INFO(x) \ + ((APP_TRACE_LEVEL >= TRACE_LEVEL_INFO) ? (void)(APP_TRACE(0,x)) : (void)0) +#define APP_TRACE_DBG(x) \ + ((APP_TRACE_LEVEL >= TRACE_LEVEL_DBG) ? (void)(APP_TRACE(0,x)) : (void)0) +#endif + +#endif +/** EOF */ diff --git a/XMC_UCOS3/APP_UART1_ECHO/bsp_cfg.h b/XMC_UCOS3/APP_UART1_ECHO/bsp_cfg.h new file mode 100644 index 0000000000000000000000000000000000000000..72634867a34820fa37e1984f28a625922915b1eb --- /dev/null +++ b/XMC_UCOS3/APP_UART1_ECHO/bsp_cfg.h @@ -0,0 +1,34 @@ +/** + * @file bsp_cfg.h + * + * @brief Board Support Package + */ + +#ifndef BSP_CFG_H_ +#define BSP_CFG_H_ + +/************************************************************** MODULE ENABLE */ + +#define BSP_CFG_CAN_EN 0 /* Enable 1, Disable 0 uC/CAN */ +#define BSP_CFG_CAN_OPEN_EN 0 /* Enable 1, Disable 0 uC/CANopen */ +#define BSP_CFG_FS_EN 0 /* Enable 1, Disable 0 uC/FS */ +#define BSP_CFG_GUI_EN 0 /* Enable 1, Disable 0 uC/GUI */ +#define BSP_CFG_MBM_EN 0 /* Enable 1, Disable 0 uC/Modbus-Master */ +#define BSP_CFG_MBS_EN 0 /* Enable 1, Disable 0 uC/Modbus-Slave */ +#define BSP_CFG_NET_EN 0 /* Enable 1, Disable 0 uC/TCP-IP */ +#define BSP_CFG_OS2_EN 1 /* Enable 1, Disable 0 uC/OS-II */ +#define BSP_CFG_OS3_EN 0 /* Enable 1, Disable 0 uC/OS-III */ +#define BSP_CFG_USBD_EN 0 /* Enable 1, Disable 0 uC/USB-D */ +#define BSP_CFG_USBH_EN 0 /* Enable 1, Disable 0 uC/USB-H */ + + +/*********************************************************** CLOCK MANAGEMENT */ + +#define BSP_CFG_SYS_XTAL_OSC_FREQ_HZ 12000000u +#define BSP_CFG_SYS_INT_OSC_FI_FREQ_HZ 24000000u + + +/************************************************************ BOARD SPECIFICS */ + +#endif +/** EOF */ \ No newline at end of file diff --git a/XMC_UCOS3/APP_UART1_ECHO/cpu_cfg.h b/XMC_UCOS3/APP_UART1_ECHO/cpu_cfg.h new file mode 100644 index 0000000000000000000000000000000000000000..fa03aeda0eccdd4503dd560422943c248640e1de --- /dev/null +++ b/XMC_UCOS3/APP_UART1_ECHO/cpu_cfg.h @@ -0,0 +1,107 @@ +/** + * @file cpu_cfg.h + * + * @brief CPU CONFIGURATION FILE + */ +#ifndef CPU_CFG_MODULE_PRESENT +#define CPU_CFG_MODULE_PRESENT + +/***************************************************** CPU NAME CONFIGURATION */ + +/* Configure CPU host name feature: DEF_DISABLED .... CPU host name DISABLED + * DEF_ENABLED .... CPU host name ENABLED + */ +#define CPU_CFG_NAME_EN DEF_ENABLED + +/* Configure CPU host name ASCII string size ... see also 'cpu_core.h + */ +#define CPU_CFG_NAME_SIZE 16 + + +/************************************************* CPU TIMESTAMP CONFIGURATION */ + +/* Configure CPU timestamp features DEF_DISABLED ... CPU timestamps DISABLED + * DEF_ENABLED ... CPU timestamps ENABLED + */ +#define CPU_CFG_TS_32_EN DEF_ENABLED +#define CPU_CFG_TS_64_EN DEF_DISABLED + +/* Configure CPU timestamp timer word size: + * CPU_WORD_SIZE_08 8-bit word size + * CPU_WORD_SIZE_16 16-bit word size + * CPU_WORD_SIZE_32 32-bit word size + * CPU_WORD_SIZE_64 64-bit word size + * + * @note: If the size of the CPU timestamp timer is not a binary multiple of + * 8-bit octets (e.g. 20-bits or even 24-bits), then the next lower, + * binary-multiple octet word size SHOULD be configured (e.g., to + * 16-bits). However, the minimum supported word size for CPU timestamp + * timers is 8-bits. ... see also cpu_core.h + */ +#define CPU_CFG_TS_TMR_SIZE CPU_WORD_SIZE_32 + +/********************* CPU INTERRUPTS DISABLED TIME MEASUREMENT CONFIGURATION */ + +/* + * @note Configure CPU_CFG_INT_DIS_MEAS_EN to enable/disable measuring CPU's + * interrupts disabled time: + * (a) Enabled, if CPU_CFG_INT_DIS_MEAS_EN #define'd in 'cpu_cfg.h' + * (b) Disabled, if CPU_CFG_INT_DIS_MEAS_EN NOT #define'd in 'cpu_cfg.h' + * See also cpu_core.h + */ +#if 0 +#define CPU_CFG_INT_DIS_MEAS_EN +#endif + +/* + * @note Configure CPU_CFG_INT_DIS_MEAS_OVRHD_NBR with the number of times to + * measure & average the interrupts disabled time measurements overhead. + * Recommend a single (1) overhead time measurement, even for + * instruction-cache-enabled CPUs, since critical sections are NOT + * typically called within instruction-cached loops. + * Thus a single non-cached/non-averaged time measurement is a more + * realistic overhead for the majority of non-cached interrupts disabled + * time measurements. + * See also cpu_core.c + */ +#define CPU_CFG_INT_DIS_MEAS_OVRHD_NBR 1u + +/********************************************** CPU COUNT ZEROS CONFIGURATION */ + +/** + * @note Configure CPU_CFG_LEAD_ZEROS_ASM_PRESENT to define count leading zer * bits function(s) in: + * (1) 'cpu_a.asm', if CPU_CFG_LEAD_ZEROS_ASM_PRESENT #define'd n cpu.h + * and cpu_cfg.h to enable assembly-optimized function(s) + * (2) 'cpu_core.c', if CPU_CFG_LEAD_ZEROS_ASM_PRESENT NOT #define'd in + * cpu.h/cpu_cfg.h to enable C-source-optimized function(s) + * otherwise + */ +#if 1 +#define CPU_CFG_LEAD_ZEROS_ASM_PRESENT +#endif + +/** + * @note Configure CPU_CFG_TRAIL_ZEROS_ASM_PRESENT to define count traling + * zeros bits function(s) in: + * (1) 'cpu_a.asm', if CPU_CFG_TRAIL_ZEROS_ASM_PRESENT #define'd in + * cpu.h/cpu_cfg.h to enable assembly-optimized function(s) + * (2) 'cpu_core.c', if CPU_CFG_TRAIL_ZEROS_ASM_PRESENT NOT #define'd in + * cpu.h/cpu_cfg.h to enable C-source-optimized function(s) + * otherwise + */ +#if 0 +#define CPU_CFG_TRAIL_ZEROS_ASM_PRESENT +#endif + +/*********************************************************** CACHE MANAGEMENT */ + +/** + * @note Configure CPU_CFG_CACHE_MGMT_EN to enable the cache managment API. + * Defining CPU_CFG_CACHE_MGMT_EN to DEF_ENABLED only enable the cache + * management function. Cache are assumed to be configured and enabled by + * the time CPU_init() is called. + */ +#define CPU_CFG_CACHE_MGMT_EN DEF_DISABLED + +#endif +/** EOF */ \ No newline at end of file diff --git a/XMC_UCOS3/APP_UART1_ECHO/doc/tw_logo.png b/XMC_UCOS3/APP_UART1_ECHO/doc/tw_logo.png new file mode 100644 index 0000000000000000000000000000000000000000..1bfb1262a37e896f464d30242c37c2a3df0b5398 Binary files /dev/null and b/XMC_UCOS3/APP_UART1_ECHO/doc/tw_logo.png differ diff --git a/XMC_UCOS3/APP_UART1_ECHO/doxyfile b/XMC_UCOS3/APP_UART1_ECHO/doxyfile new file mode 100644 index 0000000000000000000000000000000000000000..e07ae394c89c0ce7661d531785682825f4b500da --- /dev/null +++ b/XMC_UCOS3/APP_UART1_ECHO/doxyfile @@ -0,0 +1,2422 @@ +# Doxyfile 1.8.13 + +# This file describes the settings to be used by the documentation system +# doxygen (www.doxygen.org) for a project. +# +# All text after a double hash (##) is considered a comment and is placed in +# front of the TAG it is preceding. +# +# All text after a single hash (#) is considered a comment and will be ignored. +# The format is: +# TAG = value [value, ...] +# For lists, items can also be appended using: +# TAG += value [value, ...] +# Values that contain spaces should be placed between quotes (\" \"). + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- + +# This tag specifies the encoding used for all characters in the config file +# that follow. The default is UTF-8 which is also the encoding used for all text +# before the first occurrence of this tag. Doxygen uses libiconv (or the iconv +# built into libc) for the transcoding. See +# https://www.gnu.org/software/libiconv/ for the list of possible encodings. +# The default value is: UTF-8. + +DOXYFILE_ENCODING = UTF-8 + +# The PROJECT_NAME tag is a single word (or a sequence of words surrounded by +# double-quotes, unless you are using Doxywizard) that should identify the +# project for which the documentation is generated. This name is used in the +# title of most generated pages and in a few other places. +# The default value is: My Project. + +PROJECT_NAME = "XMC4500 uCOS3 Demo" + +# The PROJECT_NUMBER tag can be used to enter a project or revision number. This +# could be handy for archiving the generated documentation or if some version +# control system is used. + +PROJECT_NUMBER = + +# Using the PROJECT_BRIEF tag one can provide an optional one line description +# for a project that appears at the top of each page and should give viewer a +# quick idea about the purpose of the project. Keep the description short. + +PROJECT_BRIEF = + +# With the PROJECT_LOGO tag one can specify a logo or an icon that is included +# in the documentation. The maximum height of the logo should not exceed 55 +# pixels and the maximum width should not exceed 200 pixels. Doxygen will copy +# the logo to the output directory. + +PROJECT_LOGO = ./doc/tw_logo.png + +# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path +# into which the generated documentation will be written. If a relative path is +# entered, it will be relative to the location where doxygen was started. If +# left blank the current directory will be used. + +OUTPUT_DIRECTORY = ./doc + +# If the CREATE_SUBDIRS tag is set to YES then doxygen will create 4096 sub- +# directories (in 2 levels) under the output directory of each output format and +# will distribute the generated files over these directories. Enabling this +# option can be useful when feeding doxygen a huge amount of source files, where +# putting all generated files in the same directory would otherwise causes +# performance problems for the file system. +# The default value is: NO. + +CREATE_SUBDIRS = YES + +# If the ALLOW_UNICODE_NAMES tag is set to YES, doxygen will allow non-ASCII +# characters to appear in the names of generated files. If set to NO, non-ASCII +# characters will be escaped, for example _xE3_x81_x84 will be used for Unicode +# U+3044. +# The default value is: NO. + +ALLOW_UNICODE_NAMES = NO + +# The OUTPUT_LANGUAGE tag is used to specify the language in which all +# documentation generated by doxygen is written. Doxygen will use this +# information to generate all constant output in the proper language. +# Possible values are: Afrikaans, Arabic, Armenian, Brazilian, Catalan, Chinese, +# Chinese-Traditional, Croatian, Czech, Danish, Dutch, English (United States), +# Esperanto, Farsi (Persian), Finnish, French, German, Greek, Hungarian, +# Indonesian, Italian, Japanese, Japanese-en (Japanese with English messages), +# Korean, Korean-en (Korean with English messages), Latvian, Lithuanian, +# Macedonian, Norwegian, Persian (Farsi), Polish, Portuguese, Romanian, Russian, +# Serbian, Serbian-Cyrillic, Slovak, Slovene, Spanish, Swedish, Turkish, +# Ukrainian and Vietnamese. +# The default value is: English. + +OUTPUT_LANGUAGE = English + +# If the BRIEF_MEMBER_DESC tag is set to YES, doxygen will include brief member +# descriptions after the members that are listed in the file and class +# documentation (similar to Javadoc). Set to NO to disable this. +# The default value is: YES. + +BRIEF_MEMBER_DESC = YES + +# If the REPEAT_BRIEF tag is set to YES, doxygen will prepend the brief +# description of a member or function before the detailed description +# +# Note: If both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the +# brief descriptions will be completely suppressed. +# The default value is: YES. + +REPEAT_BRIEF = YES + +# This tag implements a quasi-intelligent brief description abbreviator that is +# used to form the text in various listings. Each string in this list, if found +# as the leading text of the brief description, will be stripped from the text +# and the result, after processing the whole list, is used as the annotated +# text. Otherwise, the brief description is used as-is. If left blank, the +# following values are used ($name is automatically replaced with the name of +# the entity):The $name class, The $name widget, The $name file, is, provides, +# specifies, contains, represents, a, an and the. + +ABBREVIATE_BRIEF = + +# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then +# doxygen will generate a detailed section even if there is only a brief +# description. +# The default value is: NO. + +ALWAYS_DETAILED_SEC = YES + +# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all +# inherited members of a class in the documentation of that class as if those +# members were ordinary class members. Constructors, destructors and assignment +# operators of the base classes will not be shown. +# The default value is: NO. + +INLINE_INHERITED_MEMB = NO + +# If the FULL_PATH_NAMES tag is set to YES, doxygen will prepend the full path +# before files name in the file list and in the header files. If set to NO the +# shortest path that makes the file name unique will be used +# The default value is: YES. + +FULL_PATH_NAMES = YES + +# The STRIP_FROM_PATH tag can be used to strip a user-defined part of the path. +# Stripping is only done if one of the specified strings matches the left-hand +# part of the path. The tag can be used to show relative paths in the file list. +# If left blank the directory from which doxygen is run is used as the path to +# strip. +# +# Note that you can specify absolute paths here, but also relative paths, which +# will be relative from the directory where doxygen is started. +# This tag requires that the tag FULL_PATH_NAMES is set to YES. + +STRIP_FROM_PATH = + +# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the +# path mentioned in the documentation of a class, which tells the reader which +# header file to include in order to use a class. If left blank only the name of +# the header file containing the class definition is used. Otherwise one should +# specify the list of include paths that are normally passed to the compiler +# using the -I flag. + +STRIP_FROM_INC_PATH = + +# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but +# less readable) file names. This can be useful is your file systems doesn't +# support long names like on DOS, Mac, or CD-ROM. +# The default value is: NO. + +SHORT_NAMES = NO + +# If the JAVADOC_AUTOBRIEF tag is set to YES then doxygen will interpret the +# first line (until the first dot) of a Javadoc-style comment as the brief +# description. If set to NO, the Javadoc-style will behave just like regular Qt- +# style comments (thus requiring an explicit @brief command for a brief +# description.) +# The default value is: NO. + +JAVADOC_AUTOBRIEF = NO + +# If the QT_AUTOBRIEF tag is set to YES then doxygen will interpret the first +# line (until the first dot) of a Qt-style comment as the brief description. If +# set to NO, the Qt-style will behave just like regular Qt-style comments (thus +# requiring an explicit \brief command for a brief description.) +# The default value is: NO. + +QT_AUTOBRIEF = NO + +# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make doxygen treat a +# multi-line C++ special comment block (i.e. a block of //! or /// comments) as +# a brief description. This used to be the default behavior. The new default is +# to treat a multi-line C++ comment block as a detailed description. Set this +# tag to YES if you prefer the old behavior instead. +# +# Note that setting this tag to YES also means that rational rose comments are +# not recognized any more. +# The default value is: NO. + +MULTILINE_CPP_IS_BRIEF = NO + +# If the INHERIT_DOCS tag is set to YES then an undocumented member inherits the +# documentation from any documented member that it re-implements. +# The default value is: YES. + +INHERIT_DOCS = YES + +# If the SEPARATE_MEMBER_PAGES tag is set to YES then doxygen will produce a new +# page for each member. If set to NO, the documentation of a member will be part +# of the file/class/namespace that contains it. +# The default value is: NO. + +SEPARATE_MEMBER_PAGES = NO + +# The TAB_SIZE tag can be used to set the number of spaces in a tab. Doxygen +# uses this value to replace tabs by spaces in code fragments. +# Minimum value: 1, maximum value: 16, default value: 4. + +TAB_SIZE = 4 + +# This tag can be used to specify a number of aliases that act as commands in +# the documentation. An alias has the form: +# name=value +# For example adding +# "sideeffect=@par Side Effects:\n" +# will allow you to put the command \sideeffect (or @sideeffect) in the +# documentation, which will result in a user-defined paragraph with heading +# "Side Effects:". You can put \n's in the value part of an alias to insert +# newlines. + +ALIASES = + +# This tag can be used to specify a number of word-keyword mappings (TCL only). +# A mapping has the form "name=value". For example adding "class=itcl::class" +# will allow you to use the command class in the itcl::class meaning. + +TCL_SUBST = + +# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources +# only. Doxygen will then generate output that is more tailored for C. For +# instance, some of the names that are used will be different. The list of all +# members will be omitted, etc. +# The default value is: NO. + +OPTIMIZE_OUTPUT_FOR_C = YES + +# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java or +# Python sources only. Doxygen will then generate output that is more tailored +# for that language. For instance, namespaces will be presented as packages, +# qualified scopes will look different, etc. +# The default value is: NO. + +OPTIMIZE_OUTPUT_JAVA = NO + +# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran +# sources. Doxygen will then generate output that is tailored for Fortran. +# The default value is: NO. + +OPTIMIZE_FOR_FORTRAN = NO + +# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL +# sources. Doxygen will then generate output that is tailored for VHDL. +# The default value is: NO. + +OPTIMIZE_OUTPUT_VHDL = NO + +# Doxygen selects the parser to use depending on the extension of the files it +# parses. With this tag you can assign which parser to use for a given +# extension. Doxygen has a built-in mapping, but you can override or extend it +# using this tag. The format is ext=language, where ext is a file extension, and +# language is one of the parsers supported by doxygen: IDL, Java, Javascript, +# C#, C, C++, D, PHP, Objective-C, Python, Fortran (fixed format Fortran: +# FortranFixed, free formatted Fortran: FortranFree, unknown formatted Fortran: +# Fortran. In the later case the parser tries to guess whether the code is fixed +# or free formatted code, this is the default for Fortran type files), VHDL. For +# instance to make doxygen treat .inc files as Fortran files (default is PHP), +# and .f files as C (default is Fortran), use: inc=Fortran f=C. +# +# Note: For files without extension you can use no_extension as a placeholder. +# +# Note that for custom extensions you also need to set FILE_PATTERNS otherwise +# the files are not read by doxygen. + +EXTENSION_MAPPING = + +# If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments +# according to the Markdown format, which allows for more readable +# documentation. See http://daringfireball.net/projects/markdown/ for details. +# The output of markdown processing is further processed by doxygen, so you can +# mix doxygen, HTML, and XML commands with Markdown formatting. Disable only in +# case of backward compatibilities issues. +# The default value is: YES. + +MARKDOWN_SUPPORT = YES + +# When the TOC_INCLUDE_HEADINGS tag is set to a non-zero value, all headings up +# to that level are automatically included in the table of contents, even if +# they do not have an id attribute. +# Note: This feature currently applies only to Markdown headings. +# Minimum value: 0, maximum value: 99, default value: 0. +# This tag requires that the tag MARKDOWN_SUPPORT is set to YES. + +TOC_INCLUDE_HEADINGS = 0 + +# When enabled doxygen tries to link words that correspond to documented +# classes, or namespaces to their corresponding documentation. Such a link can +# be prevented in individual cases by putting a % sign in front of the word or +# globally by setting AUTOLINK_SUPPORT to NO. +# The default value is: YES. + +AUTOLINK_SUPPORT = YES + +# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want +# to include (a tag file for) the STL sources as input, then you should set this +# tag to YES in order to let doxygen match functions declarations and +# definitions whose arguments contain STL classes (e.g. func(std::string); +# versus func(std::string) {}). This also make the inheritance and collaboration +# diagrams that involve STL classes more complete and accurate. +# The default value is: NO. + +BUILTIN_STL_SUPPORT = NO + +# If you use Microsoft's C++/CLI language, you should set this option to YES to +# enable parsing support. +# The default value is: NO. + +CPP_CLI_SUPPORT = NO + +# Set the SIP_SUPPORT tag to YES if your project consists of sip (see: +# https://www.riverbankcomputing.com/software/sip/intro) sources only. Doxygen +# will parse them like normal C++ but will assume all classes use public instead +# of private inheritance when no explicit protection keyword is present. +# The default value is: NO. + +SIP_SUPPORT = NO + +# For Microsoft's IDL there are propget and propput attributes to indicate +# getter and setter methods for a property. Setting this option to YES will make +# doxygen to replace the get and set methods by a property in the documentation. +# This will only work if the methods are indeed getting or setting a simple +# type. If this is not the case, or you want to show the methods anyway, you +# should set this option to NO. +# The default value is: YES. + +IDL_PROPERTY_SUPPORT = YES + +# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC +# tag is set to YES then doxygen will reuse the documentation of the first +# member in the group (if any) for the other members of the group. By default +# all members of a group must be documented explicitly. +# The default value is: NO. + +DISTRIBUTE_GROUP_DOC = NO + +# If one adds a struct or class to a group and this option is enabled, then also +# any nested class or struct is added to the same group. By default this option +# is disabled and one has to add nested compounds explicitly via \ingroup. +# The default value is: NO. + +GROUP_NESTED_COMPOUNDS = NO + +# Set the SUBGROUPING tag to YES to allow class member groups of the same type +# (for instance a group of public functions) to be put as a subgroup of that +# type (e.g. under the Public Functions section). Set it to NO to prevent +# subgrouping. Alternatively, this can be done per class using the +# \nosubgrouping command. +# The default value is: YES. + +SUBGROUPING = YES + +# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and unions +# are shown inside the group in which they are included (e.g. using \ingroup) +# instead of on a separate page (for HTML and Man pages) or section (for LaTeX +# and RTF). +# +# Note that this feature does not work in combination with +# SEPARATE_MEMBER_PAGES. +# The default value is: NO. + +INLINE_GROUPED_CLASSES = NO + +# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and unions +# with only public data fields or simple typedef fields will be shown inline in +# the documentation of the scope in which they are defined (i.e. file, +# namespace, or group documentation), provided this scope is documented. If set +# to NO, structs, classes, and unions are shown on a separate page (for HTML and +# Man pages) or section (for LaTeX and RTF). +# The default value is: NO. + +INLINE_SIMPLE_STRUCTS = NO + +# When TYPEDEF_HIDES_STRUCT tag is enabled, a typedef of a struct, union, or +# enum is documented as struct, union, or enum with the name of the typedef. So +# typedef struct TypeS {} TypeT, will appear in the documentation as a struct +# with name TypeT. When disabled the typedef will appear as a member of a file, +# namespace, or class. And the struct will be named TypeS. This can typically be +# useful for C code in case the coding convention dictates that all compound +# types are typedef'ed and only the typedef is referenced, never the tag name. +# The default value is: NO. + +TYPEDEF_HIDES_STRUCT = NO + +# The size of the symbol lookup cache can be set using LOOKUP_CACHE_SIZE. This +# cache is used to resolve symbols given their name and scope. Since this can be +# an expensive process and often the same symbol appears multiple times in the +# code, doxygen keeps a cache of pre-resolved symbols. If the cache is too small +# doxygen will become slower. If the cache is too large, memory is wasted. The +# cache size is given by this formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range +# is 0..9, the default is 0, corresponding to a cache size of 2^16=65536 +# symbols. At the end of a run doxygen will report the cache usage and suggest +# the optimal cache size from a speed point of view. +# Minimum value: 0, maximum value: 9, default value: 0. + +LOOKUP_CACHE_SIZE = 0 + +#--------------------------------------------------------------------------- +# Build related configuration options +#--------------------------------------------------------------------------- + +# If the EXTRACT_ALL tag is set to YES, doxygen will assume all entities in +# documentation are documented, even if no documentation was available. Private +# class members and static file members will be hidden unless the +# EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES. +# Note: This will also disable the warnings about undocumented members that are +# normally produced when WARNINGS is set to YES. +# The default value is: NO. + +EXTRACT_ALL = YES + +# If the EXTRACT_PRIVATE tag is set to YES, all private members of a class will +# be included in the documentation. +# The default value is: NO. + +EXTRACT_PRIVATE = YES + +# If the EXTRACT_PACKAGE tag is set to YES, all members with package or internal +# scope will be included in the documentation. +# The default value is: NO. + +EXTRACT_PACKAGE = NO + +# If the EXTRACT_STATIC tag is set to YES, all static members of a file will be +# included in the documentation. +# The default value is: NO. + +EXTRACT_STATIC = YES + +# If the EXTRACT_LOCAL_CLASSES tag is set to YES, classes (and structs) defined +# locally in source files will be included in the documentation. If set to NO, +# only classes defined in header files are included. Does not have any effect +# for Java sources. +# The default value is: YES. + +EXTRACT_LOCAL_CLASSES = YES + +# This flag is only useful for Objective-C code. If set to YES, local methods, +# which are defined in the implementation section but not in the interface are +# included in the documentation. If set to NO, only methods in the interface are +# included. +# The default value is: NO. + +EXTRACT_LOCAL_METHODS = NO + +# If this flag is set to YES, the members of anonymous namespaces will be +# extracted and appear in the documentation as a namespace called +# 'anonymous_namespace{file}', where file will be replaced with the base name of +# the file that contains the anonymous namespace. By default anonymous namespace +# are hidden. +# The default value is: NO. + +EXTRACT_ANON_NSPACES = NO + +# If the HIDE_UNDOC_MEMBERS tag is set to YES, doxygen will hide all +# undocumented members inside documented classes or files. If set to NO these +# members will be included in the various overviews, but no documentation +# section is generated. This option has no effect if EXTRACT_ALL is enabled. +# The default value is: NO. + +HIDE_UNDOC_MEMBERS = NO + +# If the HIDE_UNDOC_CLASSES tag is set to YES, doxygen will hide all +# undocumented classes that are normally visible in the class hierarchy. If set +# to NO, these classes will be included in the various overviews. This option +# has no effect if EXTRACT_ALL is enabled. +# The default value is: NO. + +HIDE_UNDOC_CLASSES = NO + +# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, doxygen will hide all friend +# (class|struct|union) declarations. If set to NO, these declarations will be +# included in the documentation. +# The default value is: NO. + +HIDE_FRIEND_COMPOUNDS = NO + +# If the HIDE_IN_BODY_DOCS tag is set to YES, doxygen will hide any +# documentation blocks found inside the body of a function. If set to NO, these +# blocks will be appended to the function's detailed documentation block. +# The default value is: NO. + +HIDE_IN_BODY_DOCS = NO + +# The INTERNAL_DOCS tag determines if documentation that is typed after a +# \internal command is included. If the tag is set to NO then the documentation +# will be excluded. Set it to YES to include the internal documentation. +# The default value is: NO. + +INTERNAL_DOCS = NO + +# If the CASE_SENSE_NAMES tag is set to NO then doxygen will only generate file +# names in lower-case letters. If set to YES, upper-case letters are also +# allowed. This is useful if you have classes or files whose names only differ +# in case and if your file system supports case sensitive file names. Windows +# and Mac users are advised to set this option to NO. +# The default value is: system dependent. + +CASE_SENSE_NAMES = YES + +# If the HIDE_SCOPE_NAMES tag is set to NO then doxygen will show members with +# their full class and namespace scopes in the documentation. If set to YES, the +# scope will be hidden. +# The default value is: NO. + +HIDE_SCOPE_NAMES = NO + +# If the HIDE_COMPOUND_REFERENCE tag is set to NO (default) then doxygen will +# append additional text to a page's title, such as Class Reference. If set to +# YES the compound reference will be hidden. +# The default value is: NO. + +HIDE_COMPOUND_REFERENCE= NO + +# If the SHOW_INCLUDE_FILES tag is set to YES then doxygen will put a list of +# the files that are included by a file in the documentation of that file. +# The default value is: YES. + +SHOW_INCLUDE_FILES = YES + +# If the SHOW_GROUPED_MEMB_INC tag is set to YES then Doxygen will add for each +# grouped member an include statement to the documentation, telling the reader +# which file to include in order to use the member. +# The default value is: NO. + +SHOW_GROUPED_MEMB_INC = NO + +# If the FORCE_LOCAL_INCLUDES tag is set to YES then doxygen will list include +# files with double quotes in the documentation rather than with sharp brackets. +# The default value is: NO. + +FORCE_LOCAL_INCLUDES = NO + +# If the INLINE_INFO tag is set to YES then a tag [inline] is inserted in the +# documentation for inline members. +# The default value is: YES. + +INLINE_INFO = YES + +# If the SORT_MEMBER_DOCS tag is set to YES then doxygen will sort the +# (detailed) documentation of file and class members alphabetically by member +# name. If set to NO, the members will appear in declaration order. +# The default value is: YES. + +SORT_MEMBER_DOCS = YES + +# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the brief +# descriptions of file, namespace and class members alphabetically by member +# name. If set to NO, the members will appear in declaration order. Note that +# this will also influence the order of the classes in the class list. +# The default value is: NO. + +SORT_BRIEF_DOCS = NO + +# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the +# (brief and detailed) documentation of class members so that constructors and +# destructors are listed first. If set to NO the constructors will appear in the +# respective orders defined by SORT_BRIEF_DOCS and SORT_MEMBER_DOCS. +# Note: If SORT_BRIEF_DOCS is set to NO this option is ignored for sorting brief +# member documentation. +# Note: If SORT_MEMBER_DOCS is set to NO this option is ignored for sorting +# detailed member documentation. +# The default value is: NO. + +SORT_MEMBERS_CTORS_1ST = NO + +# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the hierarchy +# of group names into alphabetical order. If set to NO the group names will +# appear in their defined order. +# The default value is: NO. + +SORT_GROUP_NAMES = NO + +# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be sorted by +# fully-qualified names, including namespaces. If set to NO, the class list will +# be sorted only by class name, not including the namespace part. +# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. +# Note: This option applies only to the class list, not to the alphabetical +# list. +# The default value is: NO. + +SORT_BY_SCOPE_NAME = NO + +# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to do proper +# type resolution of all parameters of a function it will reject a match between +# the prototype and the implementation of a member function even if there is +# only one candidate or it is obvious which candidate to choose by doing a +# simple string match. By disabling STRICT_PROTO_MATCHING doxygen will still +# accept a match between prototype and implementation in such cases. +# The default value is: NO. + +STRICT_PROTO_MATCHING = NO + +# The GENERATE_TODOLIST tag can be used to enable (YES) or disable (NO) the todo +# list. This list is created by putting \todo commands in the documentation. +# The default value is: YES. + +GENERATE_TODOLIST = YES + +# The GENERATE_TESTLIST tag can be used to enable (YES) or disable (NO) the test +# list. This list is created by putting \test commands in the documentation. +# The default value is: YES. + +GENERATE_TESTLIST = YES + +# The GENERATE_BUGLIST tag can be used to enable (YES) or disable (NO) the bug +# list. This list is created by putting \bug commands in the documentation. +# The default value is: YES. + +GENERATE_BUGLIST = YES + +# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or disable (NO) +# the deprecated list. This list is created by putting \deprecated commands in +# the documentation. +# The default value is: YES. + +GENERATE_DEPRECATEDLIST= YES + +# The ENABLED_SECTIONS tag can be used to enable conditional documentation +# sections, marked by \if ... \endif and \cond +# ... \endcond blocks. + +ENABLED_SECTIONS = + +# The MAX_INITIALIZER_LINES tag determines the maximum number of lines that the +# initial value of a variable or macro / define can have for it to appear in the +# documentation. If the initializer consists of more lines than specified here +# it will be hidden. Use a value of 0 to hide initializers completely. The +# appearance of the value of individual variables and macros / defines can be +# controlled using \showinitializer or \hideinitializer command in the +# documentation regardless of this setting. +# Minimum value: 0, maximum value: 10000, default value: 30. + +MAX_INITIALIZER_LINES = 30 + +# Set the SHOW_USED_FILES tag to NO to disable the list of files generated at +# the bottom of the documentation of classes and structs. If set to YES, the +# list will mention the files that were used to generate the documentation. +# The default value is: YES. + +SHOW_USED_FILES = YES + +# Set the SHOW_FILES tag to NO to disable the generation of the Files page. This +# will remove the Files entry from the Quick Index and from the Folder Tree View +# (if specified). +# The default value is: YES. + +SHOW_FILES = YES + +# Set the SHOW_NAMESPACES tag to NO to disable the generation of the Namespaces +# page. This will remove the Namespaces entry from the Quick Index and from the +# Folder Tree View (if specified). +# The default value is: YES. + +SHOW_NAMESPACES = YES + +# The FILE_VERSION_FILTER tag can be used to specify a program or script that +# doxygen should invoke to get the current version for each file (typically from +# the version control system). Doxygen will invoke the program by executing (via +# popen()) the command command input-file, where command is the value of the +# FILE_VERSION_FILTER tag, and input-file is the name of an input file provided +# by doxygen. Whatever the program writes to standard output is used as the file +# version. For an example see the documentation. + +FILE_VERSION_FILTER = + +# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed +# by doxygen. The layout file controls the global structure of the generated +# output files in an output format independent way. To create the layout file +# that represents doxygen's defaults, run doxygen with the -l option. You can +# optionally specify a file name after the option, if omitted DoxygenLayout.xml +# will be used as the name of the layout file. +# +# Note that if you run doxygen from a directory containing a file called +# DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE +# tag is left empty. + +LAYOUT_FILE = + +# The CITE_BIB_FILES tag can be used to specify one or more bib files containing +# the reference definitions. This must be a list of .bib files. The .bib +# extension is automatically appended if omitted. This requires the bibtex tool +# to be installed. See also https://en.wikipedia.org/wiki/BibTeX for more info. +# For LaTeX the style of the bibliography can be controlled using +# LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the +# search path. See also \cite for info how to create references. + +CITE_BIB_FILES = + +#--------------------------------------------------------------------------- +# Configuration options related to warning and progress messages +#--------------------------------------------------------------------------- + +# The QUIET tag can be used to turn on/off the messages that are generated to +# standard output by doxygen. If QUIET is set to YES this implies that the +# messages are off. +# The default value is: NO. + +QUIET = NO + +# The WARNINGS tag can be used to turn on/off the warning messages that are +# generated to standard error (stderr) by doxygen. If WARNINGS is set to YES +# this implies that the warnings are on. +# +# Tip: Turn warnings on while writing the documentation. +# The default value is: YES. + +WARNINGS = YES + +# If the WARN_IF_UNDOCUMENTED tag is set to YES then doxygen will generate +# warnings for undocumented members. If EXTRACT_ALL is set to YES then this flag +# will automatically be disabled. +# The default value is: YES. + +WARN_IF_UNDOCUMENTED = YES + +# If the WARN_IF_DOC_ERROR tag is set to YES, doxygen will generate warnings for +# potential errors in the documentation, such as not documenting some parameters +# in a documented function, or documenting parameters that don't exist or using +# markup commands wrongly. +# The default value is: YES. + +WARN_IF_DOC_ERROR = YES + +# This WARN_NO_PARAMDOC option can be enabled to get warnings for functions that +# are documented, but have no documentation for their parameters or return +# value. If set to NO, doxygen will only warn about wrong or incomplete +# parameter documentation, but not about the absence of documentation. +# The default value is: NO. + +WARN_NO_PARAMDOC = NO + +# If the WARN_AS_ERROR tag is set to YES then doxygen will immediately stop when +# a warning is encountered. +# The default value is: NO. + +WARN_AS_ERROR = NO + +# The WARN_FORMAT tag determines the format of the warning messages that doxygen +# can produce. The string should contain the $file, $line, and $text tags, which +# will be replaced by the file and line number from which the warning originated +# and the warning text. Optionally the format may contain $version, which will +# be replaced by the version of the file (if it could be obtained via +# FILE_VERSION_FILTER) +# The default value is: $file:$line: $text. + +WARN_FORMAT = "$file:$line: $text" + +# The WARN_LOGFILE tag can be used to specify a file to which warning and error +# messages should be written. If left blank the output is written to standard +# error (stderr). + +WARN_LOGFILE = + +#--------------------------------------------------------------------------- +# Configuration options related to the input files +#--------------------------------------------------------------------------- + +# The INPUT tag is used to specify the files and/or directories that contain +# documented source files. You may enter file names like myfile.cpp or +# directories like /usr/src/myproject. Separate the files or directories with +# spaces. See also FILE_PATTERNS and EXTENSION_MAPPING +# Note: If this tag is empty the current directory is searched. + +INPUT = . \ + ./BSP \ + ../UCOS3 \ + ../CMSIS \ + ../XMCLIB + +# This tag can be used to specify the character encoding of the source files +# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses +# libiconv (or the iconv built into libc) for the transcoding. See the libiconv +# documentation (see: https://www.gnu.org/software/libiconv/) for the list of +# possible encodings. +# The default value is: UTF-8. + +INPUT_ENCODING = UTF-8 + +# If the value of the INPUT tag contains directories, you can use the +# FILE_PATTERNS tag to specify one or more wildcard patterns (like *.cpp and +# *.h) to filter out the source-files in the directories. +# +# Note that for custom extensions or not directly supported extensions you also +# need to set EXTENSION_MAPPING for the extension otherwise the files are not +# read by doxygen. +# +# If left blank the following patterns are tested:*.c, *.cc, *.cxx, *.cpp, +# *.c++, *.java, *.ii, *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h, +# *.hh, *.hxx, *.hpp, *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc, +# *.m, *.markdown, *.md, *.mm, *.dox, *.py, *.pyw, *.f90, *.f95, *.f03, *.f08, +# *.f, *.for, *.tcl, *.vhd, *.vhdl, *.ucf and *.qsf. + +FILE_PATTERNS = *.c \ + *.h + +# The RECURSIVE tag can be used to specify whether or not subdirectories should +# be searched for input files as well. +# The default value is: NO. + +RECURSIVE = YES + +# The EXCLUDE tag can be used to specify files and/or directories that should be +# excluded from the INPUT source files. This way you can easily exclude a +# subdirectory from a directory tree whose root is specified with the INPUT tag. +# +# Note that relative paths are relative to the directory from which doxygen is +# run. + +EXCLUDE = + +# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or +# directories that are symbolic links (a Unix file system feature) are excluded +# from the input. +# The default value is: NO. + +EXCLUDE_SYMLINKS = NO + +# If the value of the INPUT tag contains directories, you can use the +# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude +# certain files from those directories. +# +# Note that the wildcards are matched against the file with absolute path, so to +# exclude all test directories for example use the pattern */test/* + +EXCLUDE_PATTERNS = + +# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names +# (namespaces, classes, functions, etc.) that should be excluded from the +# output. The symbol name can be a fully qualified name, a word, or if the +# wildcard * is used, a substring. Examples: ANamespace, AClass, +# AClass::ANamespace, ANamespace::*Test +# +# Note that the wildcards are matched against the file with absolute path, so to +# exclude all test directories use the pattern */test/* + +EXCLUDE_SYMBOLS = + +# The EXAMPLE_PATH tag can be used to specify one or more files or directories +# that contain example code fragments that are included (see the \include +# command). + +EXAMPLE_PATH = + +# If the value of the EXAMPLE_PATH tag contains directories, you can use the +# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and +# *.h) to filter out the source-files in the directories. If left blank all +# files are included. + +EXAMPLE_PATTERNS = + +# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be +# searched for input files to be used with the \include or \dontinclude commands +# irrespective of the value of the RECURSIVE tag. +# The default value is: NO. + +EXAMPLE_RECURSIVE = NO + +# The IMAGE_PATH tag can be used to specify one or more files or directories +# that contain images that are to be included in the documentation (see the +# \image command). + +IMAGE_PATH = + +# The INPUT_FILTER tag can be used to specify a program that doxygen should +# invoke to filter for each input file. Doxygen will invoke the filter program +# by executing (via popen()) the command: +# +# +# +# where is the value of the INPUT_FILTER tag, and is the +# name of an input file. Doxygen will then use the output that the filter +# program writes to standard output. If FILTER_PATTERNS is specified, this tag +# will be ignored. +# +# Note that the filter must not add or remove lines; it is applied before the +# code is scanned, but not when the output code is generated. If lines are added +# or removed, the anchors will not be placed correctly. +# +# Note that for custom extensions or not directly supported extensions you also +# need to set EXTENSION_MAPPING for the extension otherwise the files are not +# properly processed by doxygen. + +INPUT_FILTER = + +# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern +# basis. Doxygen will compare the file name with each pattern and apply the +# filter if there is a match. The filters are a list of the form: pattern=filter +# (like *.cpp=my_cpp_filter). See INPUT_FILTER for further information on how +# filters are used. If the FILTER_PATTERNS tag is empty or if none of the +# patterns match the file name, INPUT_FILTER is applied. +# +# Note that for custom extensions or not directly supported extensions you also +# need to set EXTENSION_MAPPING for the extension otherwise the files are not +# properly processed by doxygen. + +FILTER_PATTERNS = + +# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using +# INPUT_FILTER) will also be used to filter the input files that are used for +# producing the source files to browse (i.e. when SOURCE_BROWSER is set to YES). +# The default value is: NO. + +FILTER_SOURCE_FILES = NO + +# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file +# pattern. A pattern will override the setting for FILTER_PATTERN (if any) and +# it is also possible to disable source filtering for a specific pattern using +# *.ext= (so without naming a filter). +# This tag requires that the tag FILTER_SOURCE_FILES is set to YES. + +FILTER_SOURCE_PATTERNS = + +# If the USE_MDFILE_AS_MAINPAGE tag refers to the name of a markdown file that +# is part of the input, its contents will be placed on the main page +# (index.html). This can be useful if you have a project on for instance GitHub +# and want to reuse the introduction page also for the doxygen output. + +USE_MDFILE_AS_MAINPAGE = + +#--------------------------------------------------------------------------- +# Configuration options related to source browsing +#--------------------------------------------------------------------------- + +# If the SOURCE_BROWSER tag is set to YES then a list of source files will be +# generated. Documented entities will be cross-referenced with these sources. +# +# Note: To get rid of all source code in the generated output, make sure that +# also VERBATIM_HEADERS is set to NO. +# The default value is: NO. + +SOURCE_BROWSER = YES + +# Setting the INLINE_SOURCES tag to YES will include the body of functions, +# classes and enums directly into the documentation. +# The default value is: NO. + +INLINE_SOURCES = YES + +# Setting the STRIP_CODE_COMMENTS tag to YES will instruct doxygen to hide any +# special comment blocks from generated source code fragments. Normal C, C++ and +# Fortran comments will always remain visible. +# The default value is: YES. + +STRIP_CODE_COMMENTS = YES + +# If the REFERENCED_BY_RELATION tag is set to YES then for each documented +# function all documented functions referencing it will be listed. +# The default value is: NO. + +REFERENCED_BY_RELATION = YES + +# If the REFERENCES_RELATION tag is set to YES then for each documented function +# all documented entities called/used by that function will be listed. +# The default value is: NO. + +REFERENCES_RELATION = YES + +# If the REFERENCES_LINK_SOURCE tag is set to YES and SOURCE_BROWSER tag is set +# to YES then the hyperlinks from functions in REFERENCES_RELATION and +# REFERENCED_BY_RELATION lists will link to the source code. Otherwise they will +# link to the documentation. +# The default value is: YES. + +REFERENCES_LINK_SOURCE = YES + +# If SOURCE_TOOLTIPS is enabled (the default) then hovering a hyperlink in the +# source code will show a tooltip with additional information such as prototype, +# brief description and links to the definition and documentation. Since this +# will make the HTML file larger and loading of large files a bit slower, you +# can opt to disable this feature. +# The default value is: YES. +# This tag requires that the tag SOURCE_BROWSER is set to YES. + +SOURCE_TOOLTIPS = YES + +# If the USE_HTAGS tag is set to YES then the references to source code will +# point to the HTML generated by the htags(1) tool instead of doxygen built-in +# source browser. The htags tool is part of GNU's global source tagging system +# (see https://www.gnu.org/software/global/global.html). You will need version +# 4.8.6 or higher. +# +# To use it do the following: +# - Install the latest version of global +# - Enable SOURCE_BROWSER and USE_HTAGS in the config file +# - Make sure the INPUT points to the root of the source tree +# - Run doxygen as normal +# +# Doxygen will invoke htags (and that will in turn invoke gtags), so these +# tools must be available from the command line (i.e. in the search path). +# +# The result: instead of the source browser generated by doxygen, the links to +# source code will now point to the output of htags. +# The default value is: NO. +# This tag requires that the tag SOURCE_BROWSER is set to YES. + +USE_HTAGS = NO + +# If the VERBATIM_HEADERS tag is set the YES then doxygen will generate a +# verbatim copy of the header file for each class for which an include is +# specified. Set to NO to disable this. +# See also: Section \class. +# The default value is: YES. + +VERBATIM_HEADERS = YES + +#--------------------------------------------------------------------------- +# Configuration options related to the alphabetical class index +#--------------------------------------------------------------------------- + +# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index of all +# compounds will be generated. Enable this if the project contains a lot of +# classes, structs, unions or interfaces. +# The default value is: YES. + +ALPHABETICAL_INDEX = YES + +# The COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns in +# which the alphabetical index list will be split. +# Minimum value: 1, maximum value: 20, default value: 5. +# This tag requires that the tag ALPHABETICAL_INDEX is set to YES. + +COLS_IN_ALPHA_INDEX = 5 + +# In case all classes in a project start with a common prefix, all classes will +# be put under the same header in the alphabetical index. The IGNORE_PREFIX tag +# can be used to specify a prefix (or a list of prefixes) that should be ignored +# while generating the index headers. +# This tag requires that the tag ALPHABETICAL_INDEX is set to YES. + +IGNORE_PREFIX = + +#--------------------------------------------------------------------------- +# Configuration options related to the HTML output +#--------------------------------------------------------------------------- + +# If the GENERATE_HTML tag is set to YES, doxygen will generate HTML output +# The default value is: YES. + +GENERATE_HTML = YES + +# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. If a +# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of +# it. +# The default directory is: html. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_OUTPUT = html + +# The HTML_FILE_EXTENSION tag can be used to specify the file extension for each +# generated HTML page (for example: .htm, .php, .asp). +# The default value is: .html. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_FILE_EXTENSION = .html + +# The HTML_HEADER tag can be used to specify a user-defined HTML header file for +# each generated HTML page. If the tag is left blank doxygen will generate a +# standard header. +# +# To get valid HTML the header file that includes any scripts and style sheets +# that doxygen needs, which is dependent on the configuration options used (e.g. +# the setting GENERATE_TREEVIEW). It is highly recommended to start with a +# default header using +# doxygen -w html new_header.html new_footer.html new_stylesheet.css +# YourConfigFile +# and then modify the file new_header.html. See also section "Doxygen usage" +# for information on how to generate the default header that doxygen normally +# uses. +# Note: The header is subject to change so you typically have to regenerate the +# default header when upgrading to a newer version of doxygen. For a description +# of the possible markers and block names see the documentation. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_HEADER = + +# The HTML_FOOTER tag can be used to specify a user-defined HTML footer for each +# generated HTML page. If the tag is left blank doxygen will generate a standard +# footer. See HTML_HEADER for more information on how to generate a default +# footer and what special commands can be used inside the footer. See also +# section "Doxygen usage" for information on how to generate the default footer +# that doxygen normally uses. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_FOOTER = + +# The HTML_STYLESHEET tag can be used to specify a user-defined cascading style +# sheet that is used by each HTML page. It can be used to fine-tune the look of +# the HTML output. If left blank doxygen will generate a default style sheet. +# See also section "Doxygen usage" for information on how to generate the style +# sheet that doxygen normally uses. +# Note: It is recommended to use HTML_EXTRA_STYLESHEET instead of this tag, as +# it is more robust and this tag (HTML_STYLESHEET) will in the future become +# obsolete. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_STYLESHEET = + +# The HTML_EXTRA_STYLESHEET tag can be used to specify additional user-defined +# cascading style sheets that are included after the standard style sheets +# created by doxygen. Using this option one can overrule certain style aspects. +# This is preferred over using HTML_STYLESHEET since it does not replace the +# standard style sheet and is therefore more robust against future updates. +# Doxygen will copy the style sheet files to the output directory. +# Note: The order of the extra style sheet files is of importance (e.g. the last +# style sheet in the list overrules the setting of the previous ones in the +# list). For an example see the documentation. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_EXTRA_STYLESHEET = + +# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or +# other source files which should be copied to the HTML output directory. Note +# that these files will be copied to the base HTML output directory. Use the +# $relpath^ marker in the HTML_HEADER and/or HTML_FOOTER files to load these +# files. In the HTML_STYLESHEET file, use the file name only. Also note that the +# files will be copied as-is; there are no commands or markers available. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_EXTRA_FILES = + +# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen +# will adjust the colors in the style sheet and background images according to +# this color. Hue is specified as an angle on a colorwheel, see +# https://en.wikipedia.org/wiki/Hue for more information. For instance the value +# 0 represents red, 60 is yellow, 120 is green, 180 is cyan, 240 is blue, 300 +# purple, and 360 is red again. +# Minimum value: 0, maximum value: 359, default value: 220. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_COLORSTYLE_HUE = 220 + +# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of the colors +# in the HTML output. For a value of 0 the output will use grayscales only. A +# value of 255 will produce the most vivid colors. +# Minimum value: 0, maximum value: 255, default value: 100. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_COLORSTYLE_SAT = 100 + +# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to the +# luminance component of the colors in the HTML output. Values below 100 +# gradually make the output lighter, whereas values above 100 make the output +# darker. The value divided by 100 is the actual gamma applied, so 80 represents +# a gamma of 0.8, The value 220 represents a gamma of 2.2, and 100 does not +# change the gamma. +# Minimum value: 40, maximum value: 240, default value: 80. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_COLORSTYLE_GAMMA = 80 + +# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML +# page will contain the date and time when the page was generated. Setting this +# to YES can help to show when doxygen was last run and thus if the +# documentation is up to date. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_TIMESTAMP = NO + +# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML +# documentation will contain sections that can be hidden and shown after the +# page has loaded. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_DYNAMIC_SECTIONS = NO + +# With HTML_INDEX_NUM_ENTRIES one can control the preferred number of entries +# shown in the various tree structured indices initially; the user can expand +# and collapse entries dynamically later on. Doxygen will expand the tree to +# such a level that at most the specified number of entries are visible (unless +# a fully collapsed tree already exceeds this amount). So setting the number of +# entries 1 will produce a full collapsed tree by default. 0 is a special value +# representing an infinite number of entries and will result in a full expanded +# tree by default. +# Minimum value: 0, maximum value: 9999, default value: 100. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_INDEX_NUM_ENTRIES = 100 + +# If the GENERATE_DOCSET tag is set to YES, additional index files will be +# generated that can be used as input for Apple's Xcode 3 integrated development +# environment (see: https://developer.apple.com/tools/xcode/), introduced with +# OSX 10.5 (Leopard). To create a documentation set, doxygen will generate a +# Makefile in the HTML output directory. Running make will produce the docset in +# that directory and running make install will install the docset in +# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find it at +# startup. See https://developer.apple.com/tools/creatingdocsetswithdoxygen.html +# for more information. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_DOCSET = NO + +# This tag determines the name of the docset feed. A documentation feed provides +# an umbrella under which multiple documentation sets from a single provider +# (such as a company or product suite) can be grouped. +# The default value is: Doxygen generated docs. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_FEEDNAME = "Doxygen generated docs" + +# This tag specifies a string that should uniquely identify the documentation +# set bundle. This should be a reverse domain-name style string, e.g. +# com.mycompany.MyDocSet. Doxygen will append .docset to the name. +# The default value is: org.doxygen.Project. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_BUNDLE_ID = org.doxygen.Project + +# The DOCSET_PUBLISHER_ID tag specifies a string that should uniquely identify +# the documentation publisher. This should be a reverse domain-name style +# string, e.g. com.mycompany.MyDocSet.documentation. +# The default value is: org.doxygen.Publisher. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_PUBLISHER_ID = org.doxygen.Publisher + +# The DOCSET_PUBLISHER_NAME tag identifies the documentation publisher. +# The default value is: Publisher. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_PUBLISHER_NAME = Publisher + +# If the GENERATE_HTMLHELP tag is set to YES then doxygen generates three +# additional HTML index files: index.hhp, index.hhc, and index.hhk. The +# index.hhp is a project file that can be read by Microsoft's HTML Help Workshop +# (see: http://www.microsoft.com/en-us/download/details.aspx?id=21138) on +# Windows. +# +# The HTML Help Workshop contains a compiler that can convert all HTML output +# generated by doxygen into a single compiled HTML file (.chm). Compiled HTML +# files are now used as the Windows 98 help format, and will replace the old +# Windows help format (.hlp) on all Windows platforms in the future. Compressed +# HTML files also contain an index, a table of contents, and you can search for +# words in the documentation. The HTML workshop also contains a viewer for +# compressed HTML files. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_HTMLHELP = NO + +# The CHM_FILE tag can be used to specify the file name of the resulting .chm +# file. You can add a path in front of the file if the result should not be +# written to the html output directory. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +CHM_FILE = + +# The HHC_LOCATION tag can be used to specify the location (absolute path +# including file name) of the HTML help compiler (hhc.exe). If non-empty, +# doxygen will try to run the HTML help compiler on the generated index.hhp. +# The file has to be specified with full path. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +HHC_LOCATION = + +# The GENERATE_CHI flag controls if a separate .chi index file is generated +# (YES) or that it should be included in the master .chm file (NO). +# The default value is: NO. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +GENERATE_CHI = NO + +# The CHM_INDEX_ENCODING is used to encode HtmlHelp index (hhk), content (hhc) +# and project file content. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +CHM_INDEX_ENCODING = + +# The BINARY_TOC flag controls whether a binary table of contents is generated +# (YES) or a normal table of contents (NO) in the .chm file. Furthermore it +# enables the Previous and Next buttons. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +BINARY_TOC = NO + +# The TOC_EXPAND flag can be set to YES to add extra items for group members to +# the table of contents of the HTML help documentation and to the tree view. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +TOC_EXPAND = NO + +# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and +# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated that +# can be used as input for Qt's qhelpgenerator to generate a Qt Compressed Help +# (.qch) of the generated HTML documentation. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_QHP = NO + +# If the QHG_LOCATION tag is specified, the QCH_FILE tag can be used to specify +# the file name of the resulting .qch file. The path specified is relative to +# the HTML output folder. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QCH_FILE = + +# The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help +# Project output. For more information please see Qt Help Project / Namespace +# (see: http://doc.qt.io/qt-4.8/qthelpproject.html#namespace). +# The default value is: org.doxygen.Project. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_NAMESPACE = org.doxygen.Project + +# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt +# Help Project output. For more information please see Qt Help Project / Virtual +# Folders (see: http://doc.qt.io/qt-4.8/qthelpproject.html#virtual-folders). +# The default value is: doc. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_VIRTUAL_FOLDER = doc + +# If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom +# filter to add. For more information please see Qt Help Project / Custom +# Filters (see: http://doc.qt.io/qt-4.8/qthelpproject.html#custom-filters). +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_CUST_FILTER_NAME = + +# The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the +# custom filter to add. For more information please see Qt Help Project / Custom +# Filters (see: http://doc.qt.io/qt-4.8/qthelpproject.html#custom-filters). +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_CUST_FILTER_ATTRS = + +# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this +# project's filter section matches. Qt Help Project / Filter Attributes (see: +# http://doc.qt.io/qt-4.8/qthelpproject.html#filter-attributes). +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_SECT_FILTER_ATTRS = + +# The QHG_LOCATION tag can be used to specify the location of Qt's +# qhelpgenerator. If non-empty doxygen will try to run qhelpgenerator on the +# generated .qhp file. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHG_LOCATION = + +# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files will be +# generated, together with the HTML files, they form an Eclipse help plugin. To +# install this plugin and make it available under the help contents menu in +# Eclipse, the contents of the directory containing the HTML and XML files needs +# to be copied into the plugins directory of eclipse. The name of the directory +# within the plugins directory should be the same as the ECLIPSE_DOC_ID value. +# After copying Eclipse needs to be restarted before the help appears. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_ECLIPSEHELP = NO + +# A unique identifier for the Eclipse help plugin. When installing the plugin +# the directory name containing the HTML and XML files should also have this +# name. Each documentation set should have its own identifier. +# The default value is: org.doxygen.Project. +# This tag requires that the tag GENERATE_ECLIPSEHELP is set to YES. + +ECLIPSE_DOC_ID = org.doxygen.Project + +# If you want full control over the layout of the generated HTML pages it might +# be necessary to disable the index and replace it with your own. The +# DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs) at top +# of each HTML page. A value of NO enables the index and the value YES disables +# it. Since the tabs in the index contain the same information as the navigation +# tree, you can set this option to YES if you also set GENERATE_TREEVIEW to YES. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +DISABLE_INDEX = NO + +# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index +# structure should be generated to display hierarchical information. If the tag +# value is set to YES, a side panel will be generated containing a tree-like +# index structure (just like the one that is generated for HTML Help). For this +# to work a browser that supports JavaScript, DHTML, CSS and frames is required +# (i.e. any modern browser). Windows users are probably better off using the +# HTML help feature. Via custom style sheets (see HTML_EXTRA_STYLESHEET) one can +# further fine-tune the look of the index. As an example, the default style +# sheet generated by doxygen has an example that shows how to put an image at +# the root of the tree instead of the PROJECT_NAME. Since the tree basically has +# the same information as the tab index, you could consider setting +# DISABLE_INDEX to YES when enabling this option. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_TREEVIEW = YES + +# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values that +# doxygen will group on one line in the generated HTML documentation. +# +# Note that a value of 0 will completely suppress the enum values from appearing +# in the overview section. +# Minimum value: 0, maximum value: 20, default value: 4. +# This tag requires that the tag GENERATE_HTML is set to YES. + +ENUM_VALUES_PER_LINE = 4 + +# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be used +# to set the initial width (in pixels) of the frame in which the tree is shown. +# Minimum value: 0, maximum value: 1500, default value: 250. +# This tag requires that the tag GENERATE_HTML is set to YES. + +TREEVIEW_WIDTH = 250 + +# If the EXT_LINKS_IN_WINDOW option is set to YES, doxygen will open links to +# external symbols imported via tag files in a separate window. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +EXT_LINKS_IN_WINDOW = NO + +# Use this tag to change the font size of LaTeX formulas included as images in +# the HTML documentation. When you change the font size after a successful +# doxygen run you need to manually remove any form_*.png images from the HTML +# output directory to force them to be regenerated. +# Minimum value: 8, maximum value: 50, default value: 10. +# This tag requires that the tag GENERATE_HTML is set to YES. + +FORMULA_FONTSIZE = 10 + +# Use the FORMULA_TRANPARENT tag to determine whether or not the images +# generated for formulas are transparent PNGs. Transparent PNGs are not +# supported properly for IE 6.0, but are supported on all modern browsers. +# +# Note that when changing this option you need to delete any form_*.png files in +# the HTML output directory before the changes have effect. +# The default value is: YES. +# This tag requires that the tag GENERATE_HTML is set to YES. + +FORMULA_TRANSPARENT = YES + +# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see +# https://www.mathjax.org) which uses client side Javascript for the rendering +# instead of using pre-rendered bitmaps. Use this if you do not have LaTeX +# installed or if you want to formulas look prettier in the HTML output. When +# enabled you may also need to install MathJax separately and configure the path +# to it using the MATHJAX_RELPATH option. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +USE_MATHJAX = NO + +# When MathJax is enabled you can set the default output format to be used for +# the MathJax output. See the MathJax site (see: +# http://docs.mathjax.org/en/latest/output.html) for more details. +# Possible values are: HTML-CSS (which is slower, but has the best +# compatibility), NativeMML (i.e. MathML) and SVG. +# The default value is: HTML-CSS. +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_FORMAT = HTML-CSS + +# When MathJax is enabled you need to specify the location relative to the HTML +# output directory using the MATHJAX_RELPATH option. The destination directory +# should contain the MathJax.js script. For instance, if the mathjax directory +# is located at the same level as the HTML output directory, then +# MATHJAX_RELPATH should be ../mathjax. The default value points to the MathJax +# Content Delivery Network so you can quickly see the result without installing +# MathJax. However, it is strongly recommended to install a local copy of +# MathJax from https://www.mathjax.org before deployment. +# The default value is: http://cdn.mathjax.org/mathjax/latest. +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_RELPATH = http://cdn.mathjax.org/mathjax/latest + +# The MATHJAX_EXTENSIONS tag can be used to specify one or more MathJax +# extension names that should be enabled during MathJax rendering. For example +# MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_EXTENSIONS = + +# The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces +# of code that will be used on startup of the MathJax code. See the MathJax site +# (see: http://docs.mathjax.org/en/latest/output.html) for more details. For an +# example see the documentation. +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_CODEFILE = + +# When the SEARCHENGINE tag is enabled doxygen will generate a search box for +# the HTML output. The underlying search engine uses javascript and DHTML and +# should work on any modern browser. Note that when using HTML help +# (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets (GENERATE_DOCSET) +# there is already a search function so this one should typically be disabled. +# For large projects the javascript based search engine can be slow, then +# enabling SERVER_BASED_SEARCH may provide a better solution. It is possible to +# search using the keyboard; to jump to the search box use + S +# (what the is depends on the OS and browser, but it is typically +# , /