iLLD_TC29x  1.0
IfxCpu.h File Reference

CPU basic functionality. More...

#include "_Impl/IfxCpu_cfg.h"
#include "IfxSrc_reg.h"
#include "IfxScu_reg.h"
#include "Scu/Std/IfxScuWdt.h"
#include "_Impl/IfxScu_cfg.h"
#include "_Utilities/Ifx_Assert.h"

Go to the source code of this file.

Data Structures

struct  IfxCpu_Counter
 
struct  IfxCpu_Perf
 Performance counter result. More...
 

Macros

#define IFXCPU_GLB_ADDR_DSPR(cpu, address)   ((((((unsigned)(address) & 0xF0000000) == 0xD0000000) ? ((((unsigned)(address) & 0x000fffff) | 0x70000000) - ((cpu) * 0x10000000)) : (unsigned)(address))))
 Convert local DSPR address to global DSPR address which can be accessed from the SRI bus. Use this macro to convert a local DSPR address (in segment 0xd00.....) to a global DSPR address (in segment 0x700....., 0x600....., 0x500..... downwards) depending on the CPU number. Example usage: More...
 
#define IFXCPU_GLB_ADDR_PSPR(cpu, address)   ((((unsigned)(address) & 0x000fffff) | 0x70100000) - ((cpu) * 0x10000000))
 Convert local PSPR address to global PSPR address which can be accessed from the SRI bus. Use this macro to convert a local PSPR address (in segment 0xc......) to a global PSPR address (in segment 0x701....., 0x601....., 0x501..... downwards) depending on the CPU number. More...
 

Typedefs

typedef unsigned int IfxCpu_spinLock
 Lock type Spin lock. More...
 
typedef unsigned int IfxCpu_mutexLock
 Lock type Mutex lock. More...
 

Enumerations

enum  IfxCpu_CoreMode {
  IfxCpu_CoreMode_halt,
  IfxCpu_CoreMode_run,
  IfxCpu_CoreMode_idle,
  IfxCpu_CoreMode_sleep,
  IfxCpu_CoreMode_stby,
  IfxCpu_CoreMode_unknown
}
 Enumeration for the Cpu mode. More...
 
enum  IfxCpu_CounterMode {
  IfxCpu_CounterMode_normal = 0,
  IfxCpu_CounterMode_task = 1
}
 Performance conunter modes. More...
 

Functions

IFX_INLINE IfxCpu_ResourceCpu IfxCpu_getCoreId (void)
 API to get core id of the CPU of the caller. Caution: Core id of the cpus may not be continguous and shouldn't be used to index cpu. Use IfxCpu_getCoreIndex() to get cpu no. More...
 
IFX_INLINE IfxCpu_ResourceCpu IfxCpu_getCoreIndex (void)
 API to get cpu index of the caller CPU. Note: This api can be used whereever cpu no/index is needed. More...
 
IFX_INLINE void IfxCpu_initCSA (uint32 *csaBegin, uint32 *csaEnd)
 API to initialize the context save area of the CPU where this is called. More...
 
IFX_INLINE void IfxCpu_setSafetyTaskIdentifier (boolean safetyId)
 Set/Clear safety task identifier (PSW.S) on current CPU. More...
 
IFX_INLINE void IfxCpu_triggerSwReset (void)
 Triggers Software Reset. More...
 
IFX_EXTERN Ifx_CPU * IfxCpu_getAddress (IfxCpu_ResourceCpu cpu)
 API to get the address for CPU HW module register memory map. More...
 
IFX_EXTERN IfxCpu_CoreMode IfxCpu_getCoreMode (Ifx_CPU *cpu)
 API to get current mode of CPU. More...
 
IFX_EXTERN IfxCpu_ResourceCpu IfxCpu_getIndex (Ifx_CPU *cpu)
 API to get current mode of CPU. More...
 
IFX_EXTERN boolean IfxCpu_setCoreMode (Ifx_CPU *cpu, IfxCpu_CoreMode mode)
 API to set mode of the CPU. More...
 
IFX_EXTERN boolean IfxCpu_setProgramCounter (Ifx_CPU *cpu, uint32 programCounter)
 API to set the program counter for the CPU specified. More...
 
IFX_EXTERN boolean IfxCpu_startCore (Ifx_CPU *cpu, uint32 programCounter)
 API to set the program counter for the CPU specified and start the CPU. More...
 
IFX_INLINE boolean IfxCpu_areInterruptsEnabled (void)
 API to get the status of global interrupt enable (ICR.IE) for the CPU which calls this API This API provides the status of CPU where this API is called. More...
 
IFX_INLINE boolean IfxCpu_disableInterrupts (void)
 API to disable global interrupt and return the previous status. More...
 
IFX_INLINE void IfxCpu_enableInterrupts (void)
 API to enable global interrupt. This API simply enables the global interrupt. More...
 
IFX_INLINE void IfxCpu_forceDisableInterrupts (void)
 Disable the Global Interrupt. More...
 
IFX_INLINE void IfxCpu_restoreInterrupts (boolean enabled)
 API to restore global interrupt with that of the passed parameter. More...
 
IFX_INLINE void IfxCpu_enableSegmentSpecificDataAccessCacheability (uint16 segmentNumberMask, boolean enable)
 API to enable/ disable the data cacheability for selected segments With this API cacheability for one or more segment can be enabled/disabled for the CPU core where this API is called. More...
 
IFX_INLINE void IfxCpu_enableSegmentSpecificInstructionAccessCacheability (uint16 segmentNumberMask, boolean enable)
 API to enable/ disable the instruction cacheability for selected segments With this API cacheability for one or more segment can be enabled/disabled for the CPU core where this API is called. More...
 
IFX_INLINE void IfxCpu_invalidateProgramCache (void)
 API to invalidate the program cache. More...
 
IFX_INLINE boolean IfxCpu_isAddressCachable (void *address)
 API to determine if an address is in a cachable or non-cachable Flash/LMU section. More...
 
IFX_INLINE void IfxCpu_setDataCache (boolean enable)
 API to enable or bypass the data cache for the CPU which calls this API. More...
 
IFX_INLINE void IfxCpu_setProgramCache (boolean enable)
 API to enable or bypass the program cache for the CPU which calls this API. More...
 
IFX_INLINE uint32 IfxCpu_getClockCounter (void)
 API to read the clock counter for the CPU which calls this API. More...
 
IFX_INLINE boolean IfxCpu_getClockCounterStickyOverflow (void)
 API to get sticky overflow bit of clock counter for the CPU, which calls this API. More...
 
IFX_INLINE uint32 IfxCpu_getInstructionCounter (void)
 API to read the instruction counter for the CPU which calls this API. More...
 
IFX_INLINE boolean IfxCpu_getInstructionCounterStickyOverflow (void)
 API to get sticky overflow bit of Instruction counter for the CPU, which calls this API. More...
 
IFX_INLINE uint32 IfxCpu_getPerformanceCounter (uint32 address)
 API to read the performance counter for the CPU which calls this API. More...
 
IFX_INLINE boolean IfxCpu_getPerformanceCounterStickyOverflow (uint32 address)
 API to get sticky overflow bit of performance counter for the CPU, which calls this API. This is generic function to get sticky overflow bit of any performance counters. More...
 
IFX_INLINE void IfxCpu_resetAndStartCounters (IfxCpu_CounterMode mode)
 Reset and start instruction, clock and multi counters. More...
 
IFX_INLINE void IfxCpu_setPerformanceCountersEnableBit (uint32 enable)
 API to enable or disable performance counter for the CPU which calls this API. More...
 
IFX_INLINE IfxCpu_Perf IfxCpu_stopCounters (void)
 Stop instruction and clock counters, return their values. More...
 
IFX_INLINE void IfxCpu_updateClockCounter (uint32 count)
 API to update clock counter for the CPU which calls this API. More...
 
IFX_INLINE void IfxCpu_updateInstructionCounter (uint32 count)
 API to update Instruction counter for the CPU which calls this API. More...
 
IFX_INLINE void IfxCpu_updatePerformanceCounter (uint32 address, uint32 count)
 API to update performance counter for the CPU which calls this API. This is generic function to update any of the performance counters. More...
 
IFX_EXTERN boolean IfxCpu_acquireMutex (IfxCpu_mutexLock *lock)
 API to acquire the mutex (binary semaphore). More...
 
IFX_EXTERN void IfxCpu_releaseMutex (IfxCpu_mutexLock *lock)
 API to unlock the mutex . More...
 
IFX_EXTERN void IfxCpu_resetSpinLock (IfxCpu_spinLock *lock)
 API to unlock the resource . More...
 
IFX_EXTERN boolean IfxCpu_setSpinLock (IfxCpu_spinLock *lock, uint32 timeoutCount)
 API to lock the resource in spin mode with the given timeout. More...
 
IFX_EXTERN uint32 IfxCpu_getRandomValue (uint32 *seed)
 API to get random value. More...
 
IFX_EXTERN uint32 IfxCpu_getRandomValueWithinRange (uint32 *seed, uint32 min, uint32 max)
 API to get random value with in the range. More...
 

Detailed Description

CPU basic functionality.

Version
iLLD_1_0_0_11_0
                            IMPORTANT NOTICE

Infineon Technologies AG (Infineon) is supplying this file for use exclusively with Infineon's microcontroller products. This file can be freely distributed within development tools that are supporting such microcontroller products.

THIS SOFTWARE IS PROVIDED "AS IS". NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE. INFINEON SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER.

Definition in file IfxCpu.h.

Macro Definition Documentation

#define IFXCPU_GLB_ADDR_DSPR (   cpu,
  address 
)    ((((((unsigned)(address) & 0xF0000000) == 0xD0000000) ? ((((unsigned)(address) & 0x000fffff) | 0x70000000) - ((cpu) * 0x10000000)) : (unsigned)(address))))

Convert local DSPR address to global DSPR address which can be accessed from the SRI bus. Use this macro to convert a local DSPR address (in segment 0xd00.....) to a global DSPR address (in segment 0x700....., 0x600....., 0x500..... downwards) depending on the CPU number. Example usage:

dmaChConfig.sourceAddress = IFXCPU_GLB_ADDR_DSPR(IfxCpu_getCoreId(), &sourceBuffer[i][0]);
dmaChConfig.destinationAddress = IFXCPU_GLB_ADDR_DSPR(IfxCpu_getCoreId(), &destinationBuffer[i][0]);

Definition at line 71 of file IfxCpu.h.

Referenced by IfxEth_RxDescr_setBuffer(), and IfxEth_TxDescr_setBuffer().

#define IFXCPU_GLB_ADDR_PSPR (   cpu,
  address 
)    ((((unsigned)(address) & 0x000fffff) | 0x70100000) - ((cpu) * 0x10000000))

Convert local PSPR address to global PSPR address which can be accessed from the SRI bus. Use this macro to convert a local PSPR address (in segment 0xc......) to a global PSPR address (in segment 0x701....., 0x601....., 0x501..... downwards) depending on the CPU number.

Example usage:

dmaChConfig.sourceAddress = IFXCPU_GLB_ADDR_PSPR(IfxCpu_getCoreId(), &sourceBufferInPsprMemory);
dmaChConfig.destinationAddress = IFXCPU_GLB_ADDR_PSPR(IfxCpu_getCoreId(), &destinationBufferInPsprMemory);

Definition at line 84 of file IfxCpu.h.

Typedef Documentation

typedef unsigned int IfxCpu_mutexLock

Lock type Mutex lock.

Definition at line 96 of file IfxCpu.h.

typedef unsigned int IfxCpu_spinLock

Lock type Spin lock.

Definition at line 92 of file IfxCpu.h.