XMC Peripheral Library for XMC4000 Family: CCU4

XMC Peripheral Library for XMC4000 Family

XMC Peripheral Library for XMC4000 Family  2.1.16

Data Structures

struct  XMC_CCU4_SLICE_CAPTURE_CONFIG_t
 
struct  XMC_CCU4_SLICE_COMPARE_CONFIG_t
 
struct  XMC_CCU4_SLICE_EVENT_CONFIG_t
 

Typedefs

typedef CCU4_GLOBAL_TypeDef XMC_CCU4_MODULE_t
 
typedef uint8_t XMC_CCU4_SLICE_INPUT_t
 
typedef CCU4_CC4_TypeDef XMC_CCU4_SLICE_t
 

Enumerations

Functions

void XMC_CCU4_DisableClock (XMC_CCU4_MODULE_t *const module, const uint8_t slice_number)
 
void XMC_CCU4_DisableModule (XMC_CCU4_MODULE_t *const module)
 
void XMC_CCU4_EnableClock (XMC_CCU4_MODULE_t *const module, const uint8_t slice_number)
 
void XMC_CCU4_EnableModule (XMC_CCU4_MODULE_t *const module)
 
void XMC_CCU4_EnableMultipleClocks (XMC_CCU4_MODULE_t *const module, const uint8_t clock_mask)
 
void XMC_CCU4_EnableShadowTransfer (XMC_CCU4_MODULE_t *const module, const uint32_t shadow_transfer_msk)
 
void XMC_CCU4_Init (XMC_CCU4_MODULE_t *const module, const XMC_CCU4_SLICE_MCMS_ACTION_t mcs_action)
 
bool XMC_CCU4_IsPrescalerRunning (XMC_CCU4_MODULE_t *const module)
 
void XMC_CCU4_SetModuleClock (XMC_CCU4_MODULE_t *const module, const XMC_CCU4_CLOCK_t clock)
 
void XMC_CCU4_SetMultiChannelShadowTransferMode (XMC_CCU4_MODULE_t *const module, const uint32_t slice_mode_msk)
 
void XMC_CCU4_SLICE_Capture0Config (XMC_CCU4_SLICE_t *const slice, const XMC_CCU4_SLICE_EVENT_t event)
 
void XMC_CCU4_SLICE_Capture1Config (XMC_CCU4_SLICE_t *const slice, const XMC_CCU4_SLICE_EVENT_t event)
 
void XMC_CCU4_SLICE_CaptureInit (XMC_CCU4_SLICE_t *const slice, const XMC_CCU4_SLICE_CAPTURE_CONFIG_t *const capture_init)
 
void XMC_CCU4_SLICE_ClearEvent (XMC_CCU4_SLICE_t *const slice, const XMC_CCU4_SLICE_IRQ_ID_t event)
 
void XMC_CCU4_SLICE_ClearTimer (XMC_CCU4_SLICE_t *const slice)
 
void XMC_CCU4_SLICE_CompareInit (XMC_CCU4_SLICE_t *const slice, const XMC_CCU4_SLICE_COMPARE_CONFIG_t *const compare_init)
 
void XMC_CCU4_SLICE_ConfigureEvent (XMC_CCU4_SLICE_t *const slice, const XMC_CCU4_SLICE_EVENT_t event, const XMC_CCU4_SLICE_EVENT_CONFIG_t *const config)
 
void XMC_CCU4_SLICE_ConfigureStatusBitOverrideEvent (XMC_CCU4_SLICE_t *const slice, const XMC_CCU4_SLICE_EVENT_CONFIG_t *const ev1_config, const XMC_CCU4_SLICE_EVENT_CONFIG_t *const ev2_config)
 
void XMC_CCU4_SLICE_CountConfig (XMC_CCU4_SLICE_t *const slice, const XMC_CCU4_SLICE_EVENT_t event)
 
void XMC_CCU4_SLICE_DirectionConfig (XMC_CCU4_SLICE_t *const slice, const XMC_CCU4_SLICE_EVENT_t event)
 
void XMC_CCU4_SLICE_DisableAutomaticShadowTransferRequest (XMC_CCU4_SLICE_t *const slice, const uint32_t automatic_shadow_transfer)
 
void XMC_CCU4_SLICE_DisableCascadedShadowTransfer (XMC_CCU4_SLICE_t *const slice)
 
void XMC_CCU4_SLICE_DisableDithering (XMC_CCU4_SLICE_t *const slice)
 
void XMC_CCU4_SLICE_DisableEvent (XMC_CCU4_SLICE_t *const slice, const XMC_CCU4_SLICE_IRQ_ID_t event)
 
void XMC_CCU4_SLICE_DisableFloatingPrescaler (XMC_CCU4_SLICE_t *const slice)
 
void XMC_CCU4_SLICE_DisableMultiChannelMode (XMC_CCU4_SLICE_t *const slice)
 
void XMC_CCU4_SLICE_DisableMultipleEvents (XMC_CCU4_SLICE_t *const slice, const uint16_t mask)
 
void XMC_CCU4_SLICE_DisableTrap (XMC_CCU4_SLICE_t *const slice)
 
void XMC_CCU4_SLICE_EnableAutomaticShadowTransferRequest (XMC_CCU4_SLICE_t *const slice, const uint32_t automatic_shadow_transfer)
 
void XMC_CCU4_SLICE_EnableCascadedShadowTransfer (XMC_CCU4_SLICE_t *const slice)
 
void XMC_CCU4_SLICE_EnableDithering (XMC_CCU4_SLICE_t *const slice, const bool period_dither, const bool duty_dither, const uint8_t spread)
 
void XMC_CCU4_SLICE_EnableEvent (XMC_CCU4_SLICE_t *const slice, const XMC_CCU4_SLICE_IRQ_ID_t event)
 
void XMC_CCU4_SLICE_EnableFloatingPrescaler (XMC_CCU4_SLICE_t *const slice)
 
void XMC_CCU4_SLICE_EnableMultiChannelMode (XMC_CCU4_SLICE_t *const slice)
 
void XMC_CCU4_SLICE_EnableMultipleEvents (XMC_CCU4_SLICE_t *const slice, const uint16_t intr_mask)
 
void XMC_CCU4_SLICE_EnableTrap (XMC_CCU4_SLICE_t *const slice)
 
void XMC_CCU4_SLICE_GateConfig (XMC_CCU4_SLICE_t *const slice, const XMC_CCU4_SLICE_EVENT_t event)
 
uint32_t XMC_CCU4_SLICE_GetCapturedValueFromFifo (const XMC_CCU4_SLICE_t *const slice, const XMC_CCU4_SLICE_CAP_REG_SET_t set)
 
uint32_t XMC_CCU4_SLICE_GetCaptureRegisterValue (const XMC_CCU4_SLICE_t *const slice, const uint8_t reg_num)
 
XMC_CCU4_SLICE_TIMER_COUNT_DIR_t XMC_CCU4_SLICE_GetCountingDir (const XMC_CCU4_SLICE_t *const slice)
 
bool XMC_CCU4_SLICE_GetEvent (const XMC_CCU4_SLICE_t *const slice, const XMC_CCU4_SLICE_IRQ_ID_t event)
 
XMC_CCU4_STATUS_t XMC_CCU4_SLICE_GetLastCapturedTimerValue (const XMC_CCU4_SLICE_t *const slice, const XMC_CCU4_SLICE_CAP_REG_SET_t set, uint32_t *val_ptr)
 
XMC_CCU4_SLICE_MODE_t XMC_CCU4_SLICE_GetSliceMode (const XMC_CCU4_SLICE_t *const slice)
 
uint16_t XMC_CCU4_SLICE_GetTimerCompareMatch (const XMC_CCU4_SLICE_t *const slice)
 
XMC_CCU4_SLICE_TIMER_COUNT_MODE_t XMC_CCU4_SLICE_GetTimerCountingMode (const XMC_CCU4_SLICE_t *const slice)
 
uint16_t XMC_CCU4_SLICE_GetTimerPeriodMatch (const XMC_CCU4_SLICE_t *const slice)
 
XMC_CCU4_SLICE_TIMER_REPEAT_MODE_t XMC_CCU4_SLICE_GetTimerRepeatMode (const XMC_CCU4_SLICE_t *const slice)
 
uint16_t XMC_CCU4_SLICE_GetTimerValue (const XMC_CCU4_SLICE_t *const slice)
 
bool XMC_CCU4_SLICE_IsExtendedCapReadEnabled (const XMC_CCU4_SLICE_t *const slice)
 
bool XMC_CCU4_SLICE_IsTimerRunning (const XMC_CCU4_SLICE_t *const slice)
 
void XMC_CCU4_SLICE_LoadConfig (XMC_CCU4_SLICE_t *const slice, const XMC_CCU4_SLICE_EVENT_t event)
 
void XMC_CCU4_SLICE_ModulationConfig (XMC_CCU4_SLICE_t *const slice, const XMC_CCU4_SLICE_EVENT_t event, const XMC_CCU4_SLICE_MODULATION_MODE_t mod_mode, const bool synch_with_pwm)
 
void XMC_CCU4_SLICE_SetDitherCompareValue (XMC_CCU4_SLICE_t *const slice, const uint8_t comp_val)
 
void XMC_CCU4_SLICE_SetEvent (XMC_CCU4_SLICE_t *const slice, const XMC_CCU4_SLICE_IRQ_ID_t event)
 
void XMC_CCU4_SLICE_SetFloatingPrescalerCompareValue (XMC_CCU4_SLICE_t *const slice, const uint8_t cmp_val)
 
void XMC_CCU4_SLICE_SetInput (XMC_CCU4_SLICE_t *const slice, const XMC_CCU4_SLICE_EVENT_t event, const XMC_CCU4_SLICE_INPUT_t input)
 
void XMC_CCU4_SLICE_SetInterruptNode (XMC_CCU4_SLICE_t *const slice, const XMC_CCU4_SLICE_IRQ_ID_t event, const XMC_CCU4_SLICE_SR_ID_t sr)
 
void XMC_CCU4_SLICE_SetPassiveLevel (XMC_CCU4_SLICE_t *const slice, const XMC_CCU4_SLICE_OUTPUT_PASSIVE_LEVEL_t level)
 
void XMC_CCU4_SLICE_SetPrescaler (XMC_CCU4_SLICE_t *const slice, const XMC_CCU4_SLICE_PRESCALER_t div_val)
 
void XMC_CCU4_SLICE_SetShadowTransferMode (XMC_CCU4_SLICE_t *const slice, const XMC_CCU4_SLICE_SHADOW_TRANSFER_MODE_t shadow_transfer_mode)
 
void XMC_CCU4_SLICE_SetTimerCompareMatch (XMC_CCU4_SLICE_t *const slice, const uint16_t compare_val)
 
void XMC_CCU4_SLICE_SetTimerCountingMode (XMC_CCU4_SLICE_t *const slice, const XMC_CCU4_SLICE_TIMER_COUNT_MODE_t mode)
 
void XMC_CCU4_SLICE_SetTimerPeriodMatch (XMC_CCU4_SLICE_t *const slice, const uint16_t period_val)
 
void XMC_CCU4_SLICE_SetTimerRepeatMode (XMC_CCU4_SLICE_t *const slice, const XMC_CCU4_SLICE_TIMER_REPEAT_MODE_t mode)
 
void XMC_CCU4_SLICE_SetTimerValue (XMC_CCU4_SLICE_t *const slice, const uint16_t timer_val)
 
void XMC_CCU4_SLICE_StartConfig (XMC_CCU4_SLICE_t *const slice, const XMC_CCU4_SLICE_EVENT_t event, const XMC_CCU4_SLICE_START_MODE_t start_mode)
 
void XMC_CCU4_SLICE_StartTimer (XMC_CCU4_SLICE_t *const slice)
 
void XMC_CCU4_SLICE_StatusBitOverrideConfig (XMC_CCU4_SLICE_t *const slice)
 
void XMC_CCU4_SLICE_StopClearTimer (XMC_CCU4_SLICE_t *const slice)
 
void XMC_CCU4_SLICE_StopConfig (XMC_CCU4_SLICE_t *const slice, const XMC_CCU4_SLICE_EVENT_t event, const XMC_CCU4_SLICE_END_MODE_t end_mode)
 
void XMC_CCU4_SLICE_StopTimer (XMC_CCU4_SLICE_t *const slice)
 
void XMC_CCU4_SLICE_TrapConfig (XMC_CCU4_SLICE_t *const slice, const XMC_CCU4_SLICE_TRAP_EXIT_MODE_t exit_mode, bool synch_with_pwm)
 
void XMC_CCU4_SLICE_WriteCoherentlyWithPWMCycle (XMC_CCU4_SLICE_t *const slice, const uint32_t coherent_write)
 
void XMC_CCU4_SLICE_WriteImmediateAfterShadowTransfer (XMC_CCU4_SLICE_t *const slice, const uint32_t immediate_write)
 
void XMC_CCU4_StartPrescaler (XMC_CCU4_MODULE_t *const module)
 
void XMC_CCU4_StopPrescaler (XMC_CCU4_MODULE_t *const module)
 

Detailed Description

The CCU4 peripheral is a major component for systems that need general purpose timers for signal monitoring/conditioning and Pulse Width Modulation (PWM) signal generation. Power electronic control systems like switched mode power supplies or interruptible power supplies, can easily be implemented with the functions inside the CCU4 peripheral.
Each CCU4 module is comprised of four identical 16 bit Capture/Compare Timer slices, CC4y (where y = [0..4]). Each timer slice can work in compare mode or in capture mode.

APIs provided in this file cover the following functional blocks of CCU4:
– Timer configuration, Capture configuration, Function/Event configuration, Interrupt configuration

Note:
  1. SLICE (APIs prefixed with e.g. XMC_CCU4_SLICE_)
  2. Module (APIs are not having any prefix e.g. XMC_CCU4_)
Timer(Compare mode) configuration:
This section of the LLD provides the configuration structure XMC_CCU4_SLICE_COMPARE_CONFIG_t and the initialization function XMC_CCU4_SLICE_CompareInit().

It can be used to:

  1. Start and Stop the timer. (XMC_CCU4_SLICE_StartTimer(), XMC_CCU4_SLICE_StopTimer())
  2. Update the period, compare, Dither, Prescaler and Passive values. (XMC_CCU4_SLICE_SetTimerPeriodMatch(), XMC_CCU4_SLICE_SetTimerCompareMatch(), XMC_CCU4_SLICE_SetPrescaler(), XMC_CCU4_SLICE_SetDitherCompareValue(), XMC_CCU4_SLICE_SetPassiveLevel())
  3. Enable the slices to support multichannel mode. (XMC_CCU4_SLICE_EnableMultiChannelMode())
Capture configuration:
This section of the LLD provides the configuration structure XMC_CCU4_SLICE_CAPTURE_CONFIG_t and the initialization function XMC_CCU4_SLICE_CaptureInit().

It can be used to:

  1. Configure the capture functionality. (XMC_CCU4_SLICE_Capture0Config(), XMC_CCU4_SLICE_Capture1Config())
  2. Read the captured values along with the status, which indicate the value is latest or not. (XMC_CCU4_SLICE_GetCaptureRegisterValue())
Function/Event configuration:
This section of the LLD provides the configuration structure XMC_CCU4_SLICE_EVENT_CONFIG_t.
It can be used to:
  1. Enable and Disable the events. (XMC_CCU4_SLICE_EnableEvent(), XMC_CCU4_SLICE_DisableEvent())
  2. Configure to start and stop the timer on external events.(XMC_CCU4_SLICE_StartConfig(), XMC_CCU4_SLICE_StopConfig())
  3. Modulation, external load and Gating of the timer output.(XMC_CCU4_SLICE_ModulationConfig(), XMC_CCU4_SLICE_LoadConfig(), XMC_CCU4_SLICE_GateConfig())
  4. Control the count direction of the timer based on the external event. (XMC_CCU4_SLICE_DirectionConfig())
  5. Count the external events.(XMC_CCU4_SLICE_CountConfig())
  6. External Trap. Which can be used as protective feature.(XMC_CCU4_SLICE_EnableTrap(), XMC_CCU4_SLICE_DisableTrap(), XMC_CCU4_SLICE_TrapConfig())
Interrupt configuration:
This section of the LLD provides the function to configure the interrupt node to each event (XMC_CCU4_SLICE_SetInterruptNode())

Typedef Documentation

typedef CCU4_GLOBAL_TypeDef XMC_CCU4_MODULE_t

Typedef for CCU4 Global data structure

typedef uint8_t XMC_CCU4_SLICE_INPUT_t

External Event Input list. This list depicts the possible input connections to the CCU4 slice. Interconnects are specific to each device.

typedef CCU4_CC4_TypeDef XMC_CCU4_SLICE_t

Typedef for CCU4 Slice data structure

Enumeration Type Documentation

CCU4 module clock

Enumerator
XMC_CCU4_CLOCK_SCU 

Select the fCCU as the clock

XMC_CCU4_CLOCK_EXTERNAL_A 

External clock-A

XMC_CCU4_CLOCK_EXTERNAL_B 

External clock-B

XMC_CCU4_CLOCK_EXTERNAL_C 

External clock-C

CCU4 set the shadow transfer type for multichannel mode

Enumerator
XMC_CCU4_MULTI_CHANNEL_SHADOW_TRANSFER_SW_SLICE0 

Shadow transfer through software only for slice 0

XMC_CCU4_MULTI_CHANNEL_SHADOW_TRANSFER_SW_MCSS_SLICE0 

Shadow transfer through software and hardware for slice 0

XMC_CCU4_MULTI_CHANNEL_SHADOW_TRANSFER_SW_SLICE1 

Shadow transfer through software only for slice 1

XMC_CCU4_MULTI_CHANNEL_SHADOW_TRANSFER_SW_MCSS_SLICE1 

Shadow transfer through software and hardware for slice 1

XMC_CCU4_MULTI_CHANNEL_SHADOW_TRANSFER_SW_SLICE2 

Shadow transfer through software only for slice 2

XMC_CCU4_MULTI_CHANNEL_SHADOW_TRANSFER_SW_MCSS_SLICE2 

Shadow transfer through software and hardware for slice 2

XMC_CCU4_MULTI_CHANNEL_SHADOW_TRANSFER_SW_SLICE3 

Shadow transfer through software only for slice 3

XMC_CCU4_MULTI_CHANNEL_SHADOW_TRANSFER_SW_MCSS_SLICE3 

Shadow transfer through software and hardware for slice 3

Slice shadow transfer options.

Enumerator
XMC_CCU4_SHADOW_TRANSFER_SLICE_0 

Transfer Period, Compare and Passive Level shadow register values to actual registers for SLICE-0

XMC_CCU4_SHADOW_TRANSFER_DITHER_SLICE_0 

Transfer Dither compare shadow register value to actual register for SLICE-0

XMC_CCU4_SHADOW_TRANSFER_PRESCALER_SLICE_0 

Transfer Prescaler shadow register value to actual register for SLICE-0

XMC_CCU4_SHADOW_TRANSFER_SLICE_1 

Transfer Period, Compare and Passive Level shadow register values to actual registers for SLICE-1

XMC_CCU4_SHADOW_TRANSFER_DITHER_SLICE_1 

Transfer Dither compare shadow register value to actual registers for SLICE-1

XMC_CCU4_SHADOW_TRANSFER_PRESCALER_SLICE_1 

Transfer Prescaler shadow register value to actual register for SLICE-1

XMC_CCU4_SHADOW_TRANSFER_SLICE_2 

Transfer Period, Compare and Passive Level shadow register values to actual registers for SLICE-2

XMC_CCU4_SHADOW_TRANSFER_DITHER_SLICE_2 

Transfer Dither compare shadow register value to actual register for SLICE-2

XMC_CCU4_SHADOW_TRANSFER_PRESCALER_SLICE_2 

Transfer Prescaler shadow register value to actual register for SLICE-2

XMC_CCU4_SHADOW_TRANSFER_SLICE_3 

Transfer Period, Compare and Passive Level shadow register values to actual registers for SLICE-3

XMC_CCU4_SHADOW_TRANSFER_DITHER_SLICE_3 

Transfer Dither compare shadow register value to actual register for SLICE-3

XMC_CCU4_SHADOW_TRANSFER_PRESCALER_SLICE_3 

Transfer Prescaler shadow register value to actual register for SLICE-3

Automatic Shadow Transfer request when writing into shadow register

Note
Only available for XMC1400 series
Enumerator
XMC_CCU4_SLICE_AUTOMAIC_SHADOW_TRANSFER_WRITE_INTO_PERIOD_SHADOW 

Automatic Shadow Transfer request when writing into Period Shadow Register

XMC_CCU4_SLICE_AUTOMAIC_SHADOW_TRANSFER_WRITE_INTO_COMPARE_SHADOW 

Automatic Shadow transfer request when writing into Compare Shadow Register

XMC_CCU4_SLICE_AUTOMAIC_SHADOW_TRANSFER_WRITE_INTO_PASSIVE_LEVEL 

Automatic Shadow transfer request when writing into Passive Level Register

XMC_CCU4_SLICE_AUTOMAIC_SHADOW_TRANSFER_WRITE_INTO_DITHER_SHADOW 

Automatic Shadow transfer request when writing into Dither Shadow Register

XMC_CCU4_SLICE_AUTOMAIC_SHADOW_TRANSFER_WRITE_INTO_FLOATING_PRESCALER_SHADOW 

Automatic Shadow transfer request when writing into Floating Prescaler Shadow register

Capture mode register sets

Enumerator
XMC_CCU4_SLICE_CAP_REG_SET_LOW 

Capture register-0, Capture register-1 used

XMC_CCU4_SLICE_CAP_REG_SET_HIGH 

Capture register-2, Capture register-3 used

Actions that can be performed upon detection of an external Timer STOP event

Enumerator
XMC_CCU4_SLICE_END_MODE_TIMER_STOP 

Stops the timer, without clearing TIMER register

XMC_CCU4_SLICE_END_MODE_TIMER_CLEAR 

Without stopping timer, clears the TIMER register

XMC_CCU4_SLICE_END_MODE_TIMER_STOP_CLEAR 

Stops the timer and clears the TIMER register

External Event trigger criteria - Edge sensitivity

Enumerator
XMC_CCU4_SLICE_EVENT_EDGE_SENSITIVITY_NONE 

None

XMC_CCU4_SLICE_EVENT_EDGE_SENSITIVITY_RISING_EDGE 

Rising Edge of the input signal generates event trigger

XMC_CCU4_SLICE_EVENT_EDGE_SENSITIVITY_FALLING_EDGE 

Falling Edge of the input signal generates event trigger

XMC_CCU4_SLICE_EVENT_EDGE_SENSITIVITY_DUAL_EDGE 

Both Rising and Falling edges cause an event trigger

Low pass filter Configuration. The External Event input should be stable for a selected number of clock cycles.

Enumerator
XMC_CCU4_SLICE_EVENT_FILTER_DISABLED 

No Low Pass Filter

XMC_CCU4_SLICE_EVENT_FILTER_3_CYCLES 

3 clock cycles

XMC_CCU4_SLICE_EVENT_FILTER_5_CYCLES 

5 clock cycles

XMC_CCU4_SLICE_EVENT_FILTER_7_CYCLES 

7 clock cycles

External Event trigger criteria - Level sensitivity

Enumerator
XMC_CCU4_SLICE_EVENT_LEVEL_SENSITIVITY_ACTIVE_HIGH 

Level sensitive functions react to a high signal level

XMC_CCU4_SLICE_EVENT_LEVEL_SENSITIVITY_ACTIVE_LOW 

Level sensitive functions react to a low signal level

XMC_CCU4_SLICE_EVENT_LEVEL_SENSITIVITY_COUNT_UP_ON_LOW 

Timer counts up, during Low state of the control signal

XMC_CCU4_SLICE_EVENT_LEVEL_SENSITIVITY_COUNT_UP_ON_HIGH 

Timer counts up, during High state of the control signal

External Event list

Enumerator
XMC_CCU4_SLICE_EVENT_NONE 

None

XMC_CCU4_SLICE_EVENT_0 

Event-0

XMC_CCU4_SLICE_EVENT_1 

Event-1

XMC_CCU4_SLICE_EVENT_2 

Event-2

External Function list

Enumerator
XMC_CCU4_SLICE_FUNCTION_START 

Start function

XMC_CCU4_SLICE_FUNCTION_STOP 

Stop function

XMC_CCU4_SLICE_FUNCTION_CAPTURE_EVENT0 

Capture Event-0 function, CCycapt0 signal is used for event generation

XMC_CCU4_SLICE_FUNCTION_CAPTURE_EVENT1 

Capture Event-1 function, CCycapt1 signal is used for event generation

XMC_CCU4_SLICE_FUNCTION_GATING 

Gating function

XMC_CCU4_SLICE_FUNCTION_DIRECTION 

Direction function

XMC_CCU4_SLICE_FUNCTION_LOAD 

Load function

XMC_CCU4_SLICE_FUNCTION_COUNT 

Counting function

XMC_CCU4_SLICE_FUNCTION_OVERRIDE 

Override function

XMC_CCU4_SLICE_FUNCTION_MODULATION 

Modulation function

XMC_CCU4_SLICE_FUNCTION_TRAP 

Trap function

Available Interrupt Event Ids

Enumerator
XMC_CCU4_SLICE_IRQ_ID_PERIOD_MATCH 

Period match counting up

XMC_CCU4_SLICE_IRQ_ID_ONE_MATCH 

Period match -> One match counting down

XMC_CCU4_SLICE_IRQ_ID_COMPARE_MATCH_UP 

Compare match counting up

XMC_CCU4_SLICE_IRQ_ID_COMPARE_MATCH_DOWN 

Compare match counting down

XMC_CCU4_SLICE_IRQ_ID_EVENT0 

Event-0 occurrence

XMC_CCU4_SLICE_IRQ_ID_EVENT1 

Event-1 occurrence

XMC_CCU4_SLICE_IRQ_ID_EVENT2 

Event-2 occurrence

XMC_CCU4_SLICE_IRQ_ID_TRAP 

Trap occurrence

Used to create Mask needed for Multi-channel Shadow transfer enable/disable

Enumerator
XMC_CCU4_SLICE_MASK_SLICE_0 

SLICE-0

XMC_CCU4_SLICE_MASK_SLICE_1 

SLICE-1

XMC_CCU4_SLICE_MASK_SLICE_2 

SLICE-2

XMC_CCU4_SLICE_MASK_SLICE_3 

SLICE-3

Multi Channel Shadow transfer request configuration options

Enumerator
XMC_CCU4_SLICE_MCMS_ACTION_TRANSFER_PR_CR 

Transfer Compare and Period Shadow register values to the actual registers upon MCS xfer request

XMC_CCU4_SLICE_MCMS_ACTION_TRANSFER_PR_CR_PCMP 

Transfer Compare, Period and Prescaler Compare Shadow register values to the actual registers upon MCS xfer request

XMC_CCU4_SLICE_MCMS_ACTION_TRANSFER_PR_CR_PCMP_DIT 

Transfer Compare, Period ,Prescaler Compare and Dither Compare register values to the actual registers upon MCS xfer request

Operational modes of CCU4 slice

Enumerator
XMC_CCU4_SLICE_MODE_COMPARE 

slice(CC4y) operates in Compare Mode

XMC_CCU4_SLICE_MODE_CAPTURE 

slice(CC4y) operates in Capture Mode

Modulation of timer output signals

Enumerator
XMC_CCU4_SLICE_MODULATION_MODE_CLEAR_ST_OUT 

Clear ST and OUT signals

XMC_CCU4_SLICE_MODULATION_MODE_CLEAR_OUT 

Clear only the OUT signal

Available Interrupt Event Ids, which is added to support multi event APIs

Enumerator
XMC_CCU4_SLICE_MULTI_IRQ_ID_PERIOD_MATCH 

Period match counting up

XMC_CCU4_SLICE_MULTI_IRQ_ID_ONE_MATCH 

Period match -> One match counting down

XMC_CCU4_SLICE_MULTI_IRQ_ID_COMPARE_MATCH_UP 

Compare match counting up

XMC_CCU4_SLICE_MULTI_IRQ_ID_COMPARE_MATCH_DOWN 

Compare match counting down

XMC_CCU4_SLICE_MULTI_IRQ_ID_EVENT0 

Event-0 occurrence

XMC_CCU4_SLICE_MULTI_IRQ_ID_EVENT1 

Event-1 occurrence

XMC_CCU4_SLICE_MULTI_IRQ_ID_EVENT2 

Event-2 occurrence

Timer output passive level

Enumerator
XMC_CCU4_SLICE_OUTPUT_PASSIVE_LEVEL_LOW 

Passive level = Low

XMC_CCU4_SLICE_OUTPUT_PASSIVE_LEVEL_HIGH 

Passive level = High

Prescaler mode

Enumerator
XMC_CCU4_SLICE_PRESCALER_MODE_NORMAL 

Fixed division of module clock

XMC_CCU4_SLICE_PRESCALER_MODE_FLOAT 

Floating divider.

Timer clock Divider

Enumerator
XMC_CCU4_SLICE_PRESCALER_1 

Slice Clock = fccu4

XMC_CCU4_SLICE_PRESCALER_2 

Slice Clock = fccu4/2

XMC_CCU4_SLICE_PRESCALER_4 

Slice Clock = fccu4/4

XMC_CCU4_SLICE_PRESCALER_8 

Slice Clock = fccu4/8

XMC_CCU4_SLICE_PRESCALER_16 

Slice Clock = fccu4/16

XMC_CCU4_SLICE_PRESCALER_32 

Slice Clock = fccu4/32

XMC_CCU4_SLICE_PRESCALER_64 

Slice Clock = fccu4/64

XMC_CCU4_SLICE_PRESCALER_128 

Slice Clock = fccu4/128

XMC_CCU4_SLICE_PRESCALER_256 

Slice Clock = fccu4/256

XMC_CCU4_SLICE_PRESCALER_512 

Slice Clock = fccu4/512

XMC_CCU4_SLICE_PRESCALER_1024 

Slice Clock = fccu4/1024

XMC_CCU4_SLICE_PRESCALER_2048 

Slice Clock = fccu4/2048

XMC_CCU4_SLICE_PRESCALER_4096 

Slice Clock = fccu4/4096

XMC_CCU4_SLICE_PRESCALER_8192 

Slice Clock = fccu4/8192

XMC_CCU4_SLICE_PRESCALER_16384 

Slice Clock = fccu4/16384

XMC_CCU4_SLICE_PRESCALER_32768 

Slice Clock = fccu4/32768

Slice shadow transfer mode options.

Note
Only available for XMC1400 series
Enumerator
XMC_CCU4_SLICE_SHADOW_TRANSFER_MODE_IN_PERIOD_MATCH_AND_ONE_MATCH 

Shadow transfer is done in Period Match and One match.

XMC_CCU4_SLICE_SHADOW_TRANSFER_MODE_ONLY_IN_PERIOD_MATCH 

Shadow transfer is done only in Period Match.

XMC_CCU4_SLICE_SHADOW_TRANSFER_MODE_ONLY_IN_ONE_MATCH 

Shadow transfer is done only in One Match.

Service Request Lines for CCU4. Event are mapped to these SR lines and these are used to generate the interrupt.

Enumerator
XMC_CCU4_SLICE_SR_ID_0 

Service Request Line-0 selected

XMC_CCU4_SLICE_SR_ID_1 

Service Request Line-1 selected

XMC_CCU4_SLICE_SR_ID_2 

Service Request Line-2 selected

XMC_CCU4_SLICE_SR_ID_3 

Service Request Line-3 selected

Actions that can be performed upon detection of an external Timer START event

Enumerator
XMC_CCU4_SLICE_START_MODE_TIMER_START 

Start the timer from the current count of TIMER register

XMC_CCU4_SLICE_START_MODE_TIMER_START_CLEAR 

Clears the TIMER register and start the timer

Timer clear on capture

Enumerator
XMC_CCU4_SLICE_TIMER_CLEAR_MODE_NEVER 

Never clear the timer on any capture event

XMC_CCU4_SLICE_TIMER_CLEAR_MODE_CAP_HIGH 

Clear only when timer value has been captured in C3V and C2V

XMC_CCU4_SLICE_TIMER_CLEAR_MODE_CAP_LOW 

Clear only when timer value has been captured in C1V and C0V

XMC_CCU4_SLICE_TIMER_CLEAR_MODE_ALWAYS 

Always clear the timer upon detection of any capture event

Timer counting direction for the CCU4 slice

Enumerator
XMC_CCU4_SLICE_TIMER_COUNT_DIR_UP 

Counting up

XMC_CCU4_SLICE_TIMER_COUNT_DIR_DOWN 

Counting down

Timer counting modes for the slice

Enumerator
XMC_CCU4_SLICE_TIMER_COUNT_MODE_EA 

Edge Aligned Mode

XMC_CCU4_SLICE_TIMER_COUNT_MODE_CA 

Center Aligned Mode

Timer repetition mode for the slice

Enumerator
XMC_CCU4_SLICE_TIMER_REPEAT_MODE_REPEAT 

Repetitive mode: continuous mode of operation

XMC_CCU4_SLICE_TIMER_REPEAT_MODE_SINGLE 

Single shot mode: Once a Period match/One match occurs timer goes to idle state

Trap exit mode

Enumerator
XMC_CCU4_SLICE_TRAP_EXIT_MODE_AUTOMATIC 

Clear trap state as soon as the trap signal is de-asserted

XMC_CCU4_SLICE_TRAP_EXIT_MODE_SW 

Clear only when acknowledged by software

Immediate write into configuration register

Note
Only available for XMC1400 series
Enumerator
XMC_CCU4_SLICE_WRITE_INTO_PERIOD_CONFIGURATION 

Immediate or Coherent Write into Period Configuration

XMC_CCU4_SLICE_WRITE_INTO_COMPARE_CONFIGURATION 

Immediate or Coherent Write into Compare Configuration

XMC_CCU4_SLICE_WRITE_INTO_PASSIVE_LEVEL_CONFIGURATION 

Immediate or Coherent Write into Passive Level Configuration

XMC_CCU4_SLICE_WRITE_INTO_DITHER_VALUE_CONFIGURATION 

Immediate or Coherent Write into Dither Value Configuration

XMC_CCU4_SLICE_WRITE_INTO_FLOATING_PRESCALER_VALUE_CONFIGURATION 

Immediate or Coherent Write into Floating Prescaler Value Configuration

Return Value of an API

Enumerator
XMC_CCU4_STATUS_OK 

API fulfils request

XMC_CCU4_STATUS_ERROR 

API cannot fulfil the request

XMC_CCU4_STATUS_RUNNING 

The timer slice is currently running

XMC_CCU4_STATUS_IDLE 

The timer slice is currently idle

Function Documentation

void XMC_CCU4_DisableClock ( XMC_CCU4_MODULE_t *const  module,
const uint8_t  slice_number 
)
Parameters
moduleConstant pointer to CCU4 module
slice_numberSlice for which the clock should be disabled. Range: [0x0 to 0x3]
Returns

None
Description:
Disables the slice timer clock, by configuring GIDLS.SS0I, GIDLS.SSS1I, GIDLS.SSS2I, GIDLS.SSS3I bits according to the selected slice_number .

It is possible to disable clock at slice level using the module pointer. slice_number is used to disable the clock to a given slice of the module. Directly accessed Register is GIDLS.
Related APIs:
XMC_CCU4_EnableClock()
XMC_CCU4_EnableMultipleClocks()
XMC_CCU4_StartPrescaler()
XMC_CCU4_StopPrescaler().
void XMC_CCU4_DisableModule ( XMC_CCU4_MODULE_t *const  module)
Parameters
moduleConstant pointer to CCU4 module
Returns

None
Description:
Brings the CCU4 module to reset state and enables gating of the clock signal(if applicable depending on the device being selected).

Invoke this API when a CCU4 module needs to be disabled completely. Any operation on the CCU4 module will have no effect after this API is called.
Related APIs:
XMC_CCU4_EnableModule()
XMC_CCU4_DisableModule().
void XMC_CCU4_EnableClock ( XMC_CCU4_MODULE_t *const  module,
const uint8_t  slice_number 
)
Parameters
moduleConstant pointer to CCU4 module
slice_numberSlice for which the clock should be Enabled. Range: [0x0 to 0x3]
Returns

None
Description:
Enables the slice timer clock, by configuring GIDLC.CS0I, GIDLC.CS1I, GIDLC.CS2I, GIDLC.CS3I bits according to the selected slice_number.

It is possible to enable/disable clock at slice level. This uses the slice_number to indicate the slice whose clock needs to be enabled.
Related APIs:
XMC_CCU4_DisableClock()
XMC_CCU4_EnableMultipleClocks()
XMC_CCU4_StartPrescaler()
XMC_CCU4_StopPrescaler().
void XMC_CCU4_EnableModule ( XMC_CCU4_MODULE_t *const  module)
Parameters
moduleConstant pointer to CCU4 module
Returns

None
Description:
Enables the CCU4 module and brings it to active state.

Also disables the gating of the clock signal (if applicable depending on the device being selected). Invoke this API before any operations are done on the CCU4 module. Invoked from XMC_CCU4_Init().
Related APIs:
XMC_CCU4_SetModuleClock()
XMC_CCU4_DisableModule()
XMC_CCU4_StartPrescaler().
void XMC_CCU4_EnableMultipleClocks ( XMC_CCU4_MODULE_t *const  module,
const uint8_t  clock_mask 
)
Parameters
moduleConstant pointer to CCU4 module
clock_maskSlices whose clocks are to be enabled simultaneously. Bit location 0/1/2/3 represents slice-0/1/2/3 respectively. Range: [0x1 to 0xF]
Returns

None
Description:
Enables clocks of multiple slices at a time, by configuring GIDLC.CS0I, GIDLC.CS1I, GIDLC.CS2I, GIDLC.CS3I bits.

Takes an input clock_mask, which determines the slices that would receive the clock. Bring them out of the idle state simultaneously.
Related APIs:
XMC_CCU4_EnableClock()
XMC_CCU4_DisableClock().
void XMC_CCU4_EnableShadowTransfer ( XMC_CCU4_MODULE_t *const  module,
const uint32_t  shadow_transfer_msk 
)
Parameters
moduleConstant pointer to CCU4 module
shadow_transfer_mskShadow transfer request mask for various transfers. Use XMC_CCU4_SHADOW_TRANSFER_t enum items to create a mask of choice, using a bit wise OR operation.
Returns

None
Description:
Requests of shadow transfer for Period, Compare, Passive level, dither and prescaler, by configuring the GCSS register.

The transfer from the shadow registers to the actual registers is done in the immediate next occurrence of the shadow transfer trigger after the API is called.

Any call to XMC_CCU4_SLICE_SetTimerPeriodMatch()
XMC_CCU4_SLICE_SetTimerCompareMatch()
XMC_CCU4_SLICE_SetPrescaler()
XMC_CCU4_SLICE_CompareInit()
XMC_CCU4_SLICE_CaptureInit(). must be succeeded by this API. Directly accessed Register is GCSS.

Related APIs:
None.
void XMC_CCU4_Init ( XMC_CCU4_MODULE_t *const  module,
const XMC_CCU4_SLICE_MCMS_ACTION_t  mcs_action 
)
Parameters
moduleConstant pointer to CCU4 module
mcs_actionmulti-channel shadow transfer request configuration
Returns

None
Description:
Initialization of global register GCTRL.

As part of module initialization, behaviour of the module upon detection Multi-Channel Mode trigger is configured. Will also invoke the XMC_CCU4_EnableModule(). The API call would bring up the required CCU4 module and also initialize the module for the required multi-channel shadow transfer.
Related APIs:
XMC_CCU4_SLICE_CompareInit()
XMC_CCU4_SLICE_CaptureInit().
bool XMC_CCU4_IsPrescalerRunning ( XMC_CCU4_MODULE_t *const  module)
Parameters
moduleConstant pointer to CCU4 module
Returns

None
Description:
Returns the state of the prescaler, by reading GSTAT.PRB bit.

This will return true if the prescaler is running. If clock is being supplied to the slices of the module then returns as true.
Related APIs:
XMC_CCU4_StartPrescaler()
XMC_CCU4_StopPrescaler()
XMC_CCU4_EnableClock()
XMC_CCU4_DisableClock().
void XMC_CCU4_SetModuleClock ( XMC_CCU4_MODULE_t *const  module,
const XMC_CCU4_CLOCK_t  clock 
)
Parameters
moduleConstant pointer to CCU4 module
clockChoice of input clock to the module
Returns

None
Description:
Selects the Module Clock by configuring GCTRL.PCIS bits.

There are 3 potential clock sources. This API helps to select the required clock source. Call to this API is valid after the XMC_CCU4_Init().
Related APIs:
None.
void XMC_CCU4_SetMultiChannelShadowTransferMode ( XMC_CCU4_MODULE_t *const  module,
const uint32_t  slice_mode_msk 
)
Parameters
moduleConstant pointer to CCU4 module
slice_mode_mskSlices for which the configuration has to be applied. Use XMC_CCU4_MULTI_CHANNEL_SHADOW_TRANSFER_t enum items to create a mask of choice, using a bit wise OR operation.
Returns

None
Description:
Enables the Multi-channel shadow transfer request trigger signal either by software or hardware by configuring GCTRL.MSE0, GCTRL.MSE1, GCTRL.MSE2, and GCTRL.MSE3 based on the mask.

The shadow transfer would take place either if it was requested by software or by the CCU4x.MCSS input.
Related APIs:
None.
void XMC_CCU4_SLICE_Capture0Config ( XMC_CCU4_SLICE_t *const  slice,
const XMC_CCU4_SLICE_EVENT_t  event 
)
Parameters
sliceConstant pointer to CC4 Slice
eventMap an External event to the Capture-0 Function
Returns

None
Description:
Configures the Capture-0 Function of the slice, by configuring CC4yCMC.CAP0S bit.

Capture function is mapped with one of the 3 events. A CCU4 slice can be configured into capture-0 mode with the selected event. In this mode the CCU4 will capture the timer value into CC4yC0V and CC4yC1V.
Related APIs:
XMC_CCU4_SLICE_ConfigureEvent()
XMC_CCU4_SLICE_SetInput().
void XMC_CCU4_SLICE_Capture1Config ( XMC_CCU4_SLICE_t *const  slice,
const XMC_CCU4_SLICE_EVENT_t  event 
)
Parameters
sliceConstant pointer to CC4 Slice
eventMap an External event to the Capture-1 Function
Returns

None
Description:
Configures the Capture-1 Function of the slice, by configuring CC4yCMC.CAP1S bit.

Capture function is mapped with one of the 3 events. A CCU4 slice can be configured into capture-1 mode with the selected event. In this mode the CCU4 will capture the timer value into CC4yC2V and CC4yC3V.
Related APIs:
XMC_CCU4_SLICE_ConfigureEvent()
XMC_CCU4_SLICE_SetInput().
void XMC_CCU4_SLICE_CaptureInit ( XMC_CCU4_SLICE_t *const  slice,
const XMC_CCU4_SLICE_CAPTURE_CONFIG_t *const  capture_init 
)
Parameters
sliceConstant pointer to CC4 Slice
capture_initPointer to slice configuration structure
Returns

None
Description:
Initialization of a CC4 slice to capture mode, by configuring CC4yTC, CC4yCMC, CC4yPSC,CC4yFPCS registers.

CC4 slice is configured with Capture configurations in this routine.After initialization user has to explicitly enable the shadow transfer for the required values by calling XMC_CCU4_EnableShadowTransfer() with appropriate mask.
Related APIs:
XMC_CCU4_SLICE_Capture0Config()
XMC_CCU4_SLICE_Capture1Config().
void XMC_CCU4_SLICE_ClearEvent ( XMC_CCU4_SLICE_t *const  slice,
const XMC_CCU4_SLICE_IRQ_ID_t  event 
)
Parameters
sliceConstant pointer to CC4 Slice
eventAsserted event which must be acknowledged.
Returns

None
Description:
Acknowledges an asserted event, by setting CC4ySWR with respective event flag.

Related APIs:
XMC_CCU4_SLICE_EnableEvent()
XMC_CCU4_SLICE_SetEvent()
XMC_CCU4_SLICE_GetEvent().
void XMC_CCU4_SLICE_ClearTimer ( XMC_CCU4_SLICE_t *const  slice)
Parameters
sliceConstant pointer to CC4 Slice
Returns

None
Description:
Resets the timer count to zero, by setting CC4yTCCLR.TCC bit.

A timer which has been stopped can still retain the last counted value. After invoking this API the timer value will be cleared.
Related APIs:
XMC_CCU4_SLICE_StartTimer().
void XMC_CCU4_SLICE_CompareInit ( XMC_CCU4_SLICE_t *const  slice,
const XMC_CCU4_SLICE_COMPARE_CONFIG_t *const  compare_init 
)
Parameters
sliceConstant pointer to CC4 Slice
compare_initPointer to slice configuration structure
Returns

None
Description:
Initialization of a CC4 slice to compare mode, by configuring CC4yTC, CC4yCMC, CC4yPSC, CC4yDITH, CC4yPSL, CC4yFPCS, CC4yCHC registers.

CC4 slice is configured with Timer configurations in this routine. After initialization user has to explicitly enable the shadow transfer for the required values by calling XMC_CCU4_EnableShadowTransfer() with appropriate mask.
Related APIs:
None.
void XMC_CCU4_SLICE_ConfigureEvent ( XMC_CCU4_SLICE_t *const  slice,
const XMC_CCU4_SLICE_EVENT_t  event,
const XMC_CCU4_SLICE_EVENT_CONFIG_t *const  config 
)
Parameters
sliceConstant pointer to CC4 Slice
eventThe External Event which needs to be configured.
configPointer to event configuration data.
Returns

None
Description:
Configures an External Event of the slice, by updating CC4yINS register .

Details such as the input mapped to the event, event detection criteria and low pass filter options are programmed by this routine. The Event config will configure the input selection, the edge selection, the level selection and the Low pass filter for the event.
Related APIs:
XMC_CCU4_SLICE_StartConfig()
XMC_CCU4_SLICE_StopConfig()
XMC_CCU4_SLICE_LoadConfig()
XMC_CCU4_SLICE_ModulationConfig()
XMC_CCU4_SLICE_CountConfig()
XMC_CCU4_SLICE_GateConfig()
XMC_CCU4_SLICE_Capture0Config()
XMC_CCU4_SLICE_Capture1Config()
XMC_CCU4_SLICE_DirectionConfig()
XMC_CCU4_SLICE_StatusBitOverrideConfig()
XMC_CCU4_SLICE_TrapConfig().
void XMC_CCU4_SLICE_ConfigureStatusBitOverrideEvent ( XMC_CCU4_SLICE_t *const  slice,
const XMC_CCU4_SLICE_EVENT_CONFIG_t *const  ev1_config,
const XMC_CCU4_SLICE_EVENT_CONFIG_t *const  ev2_config 
)
Parameters
sliceConstant pointer to CC4 Slice
ev1_configPointer to event 1 configuration data
ev2_configPointer to event 2 configuration data
Returns

None
Description:
Map Status bit override function with an Event1 & Event 2 of the slice and configure CC4yINS register.

Details such as the input mapped to the event, event detection criteria and Low Pass filter options are programmed by this routine for the events 1 & 2. Event-1 input would be the trigger to override the value. Event-2 input would be the override value.
Related APIs:
XMC_CCU4_SLICE_StatusBitOverrideConfig().
void XMC_CCU4_SLICE_CountConfig ( XMC_CCU4_SLICE_t *const  slice,
const XMC_CCU4_SLICE_EVENT_t  event 
)
Parameters
sliceConstant pointer to CC4 Slice
eventMap an External event to the External Count Function
Returns

None
Description:
Configures the Count Function of the slice, by configuring CC4yCMC.CNTS bit.

Count function is mapped with one of the 3 events. CCU4 slice can take an external signal to act as the counting event. The CCU4 slice would count the edges present on the event selected.
Related APIs:
XMC_CCU4_SLICE_ConfigureEvent()
XMC_CCU4_SLICE_SetInput().
void XMC_CCU4_SLICE_DirectionConfig ( XMC_CCU4_SLICE_t *const  slice,
const XMC_CCU4_SLICE_EVENT_t  event 
)
Parameters
sliceConstant pointer to CC4 Slice
eventMap an External event to the External Count Direction Function
Returns

None
Description:
Configures the Count Direction of the slice, by configuring CC4yCMC.UDS bit.

Count direction function is mapped with one of the 3 events. A slice can be configured to change the CC4yTIMER count direction depending on an external signal.
Related APIs:
XMC_CCU4_SLICE_ConfigureEvent()
XMC_CCU4_SLICE_SetInput().
void XMC_CCU4_SLICE_DisableAutomaticShadowTransferRequest ( XMC_CCU4_SLICE_t *const  slice,
const uint32_t  automatic_shadow_transfer 
)
Parameters
sliceConstant pointer to CC4 Slice
automatic_shadow_transferspecify upon which register update, automatic shadow transfer request should not be generated Use :: XMC_CCU4_SLICE_AUTOMAIC_SHADOW_TRANSFER_WRITE_INTO_t enum items to create a mask of choice, using a bit wise OR operation.
Returns

None
Description:
Configure on which shadow register update, automatic shadow transfer request generation has to be disabled. By clearing ASPC, ASCC1, ASCC2, ASLC, ASDC, ASFC bits in STC register.

This disables the generation of automatic shadow transfer request for the specified register update.
Note:
Related APIs:
XMC_CCU4_SLICE_EnableAutomaticShadowTransferRequest().
Note
Only available for XMC1400 series
void XMC_CCU4_SLICE_DisableCascadedShadowTransfer ( XMC_CCU4_SLICE_t *const  slice)
Parameters
sliceConstant pointer to CC4 Slice
Returns

None
Description:
Disables the cascaded the shadow transfer operation, by clearing CSE bit in STC register.

If in any slice the cascaded mode disabled, other slices from there onwards does not update the values in cascaded mode.
Related APIs:
XMC_CCU4_SLICE_EnableCascadedShadowTransfer()
.
Note
Only available for XMC1400 series
void XMC_CCU4_SLICE_DisableDithering ( XMC_CCU4_SLICE_t *const  slice)
Parameters
sliceConstant pointer to CC4 Slice
Returns

None
Description:
Disables dithering of PWM frequency and duty cycle, by clearing CC4yTC.DITHE bits.

This disables the Dither mode that was set in XMC_CCU4_SLICE_EnableDithering(). This API will not clear the dither compare value.
Related APIs:
XMC_CCU4_SLICE_EnableDithering().
void XMC_CCU4_SLICE_DisableEvent ( XMC_CCU4_SLICE_t *const  slice,
const XMC_CCU4_SLICE_IRQ_ID_t  event 
)
Parameters
sliceConstant pointer to CC4 Slice
eventEvent whose assertion can potentially lead to an interrupt
Returns

None
Description:
Disables the generation of an interrupt pulse for the event, by clearing CC4yINTE register.

Prevents the event from being asserted
Related APIs:
XMC_CCU4_SLICE_SetInterruptNode()
XMC_CCU4_SLICE_EnableEvent()
XMC_CCU4_SLICE_EnableMultipleEvents()
XMC_CCU4_SLICE_DisableMultipleEvents().
void XMC_CCU4_SLICE_DisableFloatingPrescaler ( XMC_CCU4_SLICE_t *const  slice)
Parameters
sliceConstant pointer to CC4 Slice
Returns

None
Description:
Disables the floating prescaler, by clearing CC4yTC.FPE bit.

This would return the prescaler to the normal mode. The prescaler that would be applied is the value present in CC4yPSC.
Related APIs:
XMC_CCU4_SLICE_EnableFloatingPrescaler().
void XMC_CCU4_SLICE_DisableMultiChannelMode ( XMC_CCU4_SLICE_t *const  slice)
Parameters
sliceConstant pointer to CC4 Slice
Returns

None
Description:
Disables the multichannel mode, by clearing CC4yTC.MCME bit.

This would return the slices to the normal operation mode.
Related APIs:
XMC_CCU4_SLICE_EnableMultiChannelMode().
void XMC_CCU4_SLICE_DisableMultipleEvents ( XMC_CCU4_SLICE_t *const  slice,
const uint16_t  mask 
)
Parameters
sliceConstant pointer to CC4 Slice
maskEvent mask such that multiple events can be enabled. Use XMC_CCU4_SLICE_MULTI_IRQ_ID_t enum items to create a mask of choice, using a bit wise OR operation.
Returns

None
Description:
Disables the generation of an interrupt pulse for the required events, by clearing CC4yINTE register.

Prevents selected events of the slice from being asserted.
Related APIs:
XMC_CCU4_SLICE_SetInterruptNode()
XMC_CCU4_SLICE_EnableEvent()
XMC_CCU4_SLICE_EnableMultipleEvents()
XMC_CCU4_SLICE_DisableEvent().
void XMC_CCU4_SLICE_DisableTrap ( XMC_CCU4_SLICE_t *const  slice)
Parameters
sliceConstant pointer to CC4 Slice
Returns

None
Description:
Disables the trap feature, by clearing CC4yTC.TRAPE0, CC4yTC.TRAPE1, CC4yTC.TRAPE2 and CC4yTC.TRAPE3 bit based on the out_mask.

.

This API will revert the changes done by XMC_CCU4_SLICE_EnableTrap(). This Ensures that the TRAP function has no effect on the output of the CCU4 slice.
Related APIs:
XMC_CCU4_SLICE_EnableTrap().
void XMC_CCU4_SLICE_EnableAutomaticShadowTransferRequest ( XMC_CCU4_SLICE_t *const  slice,
const uint32_t  automatic_shadow_transfer 
)
Parameters
sliceConstant pointer to CC4 Slice
automatic_shadow_transferspecify upon which register update, automatic shadow transfer request is generated Use :: XMC_CCU4_SLICE_AUTOMAIC_SHADOW_TRANSFER_WRITE_INTO_t enum items to create a mask of choice, using a bit wise OR operation.
Returns

None
Description:
Configure on which shadow register update, automatic shadow transfer request generation has to be enabled. By setting ASPC, ASCC1, ASCC2, ASLC, ASDC, ASFC bits in STC register.

By updating the configured shadow register, the shadow transfer request is generated to update all the shadow registers.
Note:
Related APIs:
XMC_CCU4_SLICE_DisableAutomaticShadowTransferRequest().
Note
Only available for XMC1400 series
void XMC_CCU4_SLICE_EnableCascadedShadowTransfer ( XMC_CCU4_SLICE_t *const  slice)
Parameters
sliceConstant pointer to CC4 Slice
Returns

None
Description:
Cascades the shadow transfer operation throughout the CCU4 timer slices, by setting CSE bit in STC register.

The shadow transfer enable bits needs to be set in all timer slices, that are being used in the cascaded architecture, at the same time. The shadow transfer enable bits, also need to be set for all slices even if the shadow values of some slices were not updated. It is possible to to cascade with the adjacent slices only. CC40 slice is a master to start the operation.
Note:
XMC_CCU4_EnableShadowTransfer() must be called to enable the shadow transfer of the all the slices, which needs to be cascaded.
Related APIs:
XMC_CCU4_EnableShadowTransfer(), XMC_CCU4_SLICE_DisableCascadedShadowTransfer()
.
Note
Only available for XMC1400 series
void XMC_CCU4_SLICE_EnableDithering ( XMC_CCU4_SLICE_t *const  slice,
const bool  period_dither,
const bool  duty_dither,
const uint8_t  spread 
)
Parameters
sliceConstant pointer to CC4 Slice
period_ditherBoolean instruction on dithering of period match
duty_ditherBoolean instruction on dithering of compare match
spreadDither compare value
Returns

None
Description:
Enables dithering of PWM frequency and duty cycle, by configuring CC4yTC.DITHE and CC4yDITS bits.

Some control loops are slow in updating PWM frequency and duty cycle. In such a case, a Bresenham style dithering can help reduce long term errors. Dithering can be applied to period and duty individually, this can be selected using the parameter period_dither and duty_dither. The spread would provide the dither compare value. If the dither counter value is less than this spread then the period/compare values would be dithered according to the dither mode selected. This API would invoke XMC_CCU4_SLICE_SetDitherCompareValue().
Note:
After this API call, XMC_CCU4_EnableShadowTransfer() has to be called with appropriate mask to transfer the dither value.
Related APIs:
XMC_CCU4_SLICE_DisableDithering().
void XMC_CCU4_SLICE_EnableEvent ( XMC_CCU4_SLICE_t *const  slice,
const XMC_CCU4_SLICE_IRQ_ID_t  event 
)
Parameters
sliceConstant pointer to CC4 Slice
eventEvent whose assertion can potentially lead to an interrupt
Returns

None
Description:
Enables the generation of an interrupt pulse for the event, by configuring CC4yINTE register.

For an event to lead to an interrupt, it must first be enabled and bound to a service request line. The corresponding NVIC node must be enabled as well. This API merely enables the event. Binding with SR is performed by another API.
Related APIs:
XMC_CCU4_SLICE_SetInterruptNode()
XMC_CCU4_SLICE_EnableMultipleEvents()
XMC_CCU4_SLICE_DisableEvent()
XMC_CCU4_SLICE_DisableMultipleEvents().
void XMC_CCU4_SLICE_EnableFloatingPrescaler ( XMC_CCU4_SLICE_t *const  slice)
Parameters
sliceConstant pointer to CC4 Slice
Returns

None
Description:
Enables the floating prescaler, by setting CC4yTC.FPE bit.

The prescaler divider starts with an initial value and increments upon every period match. It keeps incrementing until a ceiling (prescaler compare value) is hit and thereafter rolls back to the original prescaler divider value.
It is necessary to have programmed an initial divider value and a compare value before the feature is enabled.
Related APIs:
XMC_CCU4_SLICE_SetFloatingPrescalerCompareValue()
XMC_CCU4_SLICE_DisableFloatingPrescaler()
XMC_CCU4_SLICE_SetPrescaler().
void XMC_CCU4_SLICE_EnableMultiChannelMode ( XMC_CCU4_SLICE_t *const  slice)
Parameters
sliceConstant pointer to CC4 Slice
Returns

None
Description:
Enables the multichannel mode, by setting CC4yTC.MCME bit.

The output state of the Timer slices can be controlled in parallel by a single input signal. A particularly useful feature in motor control applications where the PWM output of multiple slices of a module can be gated and ungated by multi-channel gating inputs connected to the slices. A peripheral like POSIF connected to the motor knows exactly which of the power drive switches are to be turned on and off at any instant. It can thus through a gating bus (known as multi-channel inputs) control which of the slices output stays gated/ungated.
Related APIs:
XMC_CCU4_SLICE_DisableMultiChannelMode()
XMC_CCU4_SetMultiChannelShadowTransferMode().
void XMC_CCU4_SLICE_EnableMultipleEvents ( XMC_CCU4_SLICE_t *const  slice,
const uint16_t  intr_mask 
)
Parameters
sliceConstant pointer to CC4 Slice
intr_maskEvent mask such that multiple events can be enabled. Use XMC_CCU4_SLICE_MULTI_IRQ_ID_t enum items to create a mask of choice, using a bit wise OR operation.
Returns

None
Description:
Enables the generation of an interrupt pulse for the required events, by configuring CC4yINTE register.

For an event to lead to an interrupt, it must first be enabled and bound to a service request line. The corresponding NVIC node must be enabled as well. This API merely enables the events. Binding with SR is performed by another API.
Related APIs:
XMC_CCU4_SLICE_SetInterruptNode()
XMC_CCU4_SLICE_EnableEvent()
XMC_CCU4_SLICE_DisableEvent()
XMC_CCU4_SLICE_DisableMultipleEvents().
void XMC_CCU4_SLICE_EnableTrap ( XMC_CCU4_SLICE_t *const  slice)
Parameters
sliceConstant pointer to CC4 Slice
Returns

None
Description:
Enables the trap feature, by setting CC4yTC.TRAPE0, CC4yTC.TRAPE1, CC4yTC.TRAPE2 and CC4yTC.TRAPE3 bit based on the out_mask.

A particularly useful feature where the PWM output can be forced inactive upon detection of a trap. The trap signal can be the output of a sensing element which has just detected an abnormal electrical condition.
Related APIs:
XMC_CCU4_SLICE_TrapConfig()
XMC_CCU4_SLICE_DisableTrap()
XMC_CCU4_SLICE_ConfigureEvent()
XMC_CCU4_SLICE_SetInput().
void XMC_CCU4_SLICE_GateConfig ( XMC_CCU4_SLICE_t *const  slice,
const XMC_CCU4_SLICE_EVENT_t  event 
)
Parameters
sliceConstant pointer to CC4 Slice
eventMap an External event to the External Gating Function
Returns

None
Description:
Configures the Gating Function of the slice, by configuring CC4yCMC.GATES bit.

Gating function is mapped with one of the 3 events. A CCU4 slice can use an input signal that would operate as counter gating. If the configured Active level is detected the counter will gate all the pulses.
Related APIs:
XMC_CCU4_SLICE_ConfigureEvent()
XMC_CCU4_SLICE_SetInput().
uint32_t XMC_CCU4_SLICE_GetCapturedValueFromFifo ( const XMC_CCU4_SLICE_t *const  slice,
const XMC_CCU4_SLICE_CAP_REG_SET_t  set 
)
Parameters
sliceConstant pointer to CC4 Slice
setThe capture register set from which the captured value is to be retrieved
Returns

uint32_t Returns the value captured in the slice_number Range: [0x0 to 0xFFFF]
Description:
Read captured value from FIFO(CC4yECRD0 and CC4yECRD1).

This is applicable only in the Capture mode of operation. The signal whose timing characteristics are to be measured must be mapped to an event which in turn must be mapped to the capture function. Based on the capture criteria, the instant timer values are captured into capture registers. Timing characteristics of the input signal may then be derived/inferred from the captured values.
Related APIs:
XMC_CCU4_SLICE_IsExtendedCapReadEnabled().
Note
Defined for XMC4800, XMC4700, XMC4500, XMC4400, XMC4200, XMC4100 devices only. For other devices use XMC_CCU4_GetCapturedValueFromFifo() API
uint32_t XMC_CCU4_SLICE_GetCaptureRegisterValue ( const XMC_CCU4_SLICE_t *const  slice,
const uint8_t  reg_num 
)
Parameters
sliceConstant pointer to CC4 Slice
reg_numThe capture register from which the captured value is to be retrieved Range: [0,3]
Returns

uint32_t Returns the Capture register value. Range: [0 to 0x1FFFFF]
Description:
Retrieves timer value which has been captured in the Capture registers, by reading CC4yCV[reg_num] register.

The signal whose timing characteristics are to be measured must be mapped to an event which in turn must be mapped to the capture function. Based on the capture criteria, the timer values are captured into capture registers. Timing characteristics of the input signal may then be derived/inferred from the captured values. The full flag will help to find out if there is a new captured value present.
Related APIs:
XMC_CCU4_SLICE_GetLastCapturedTimerValue().
XMC_CCU4_SLICE_TIMER_COUNT_DIR_t XMC_CCU4_SLICE_GetCountingDir ( const XMC_CCU4_SLICE_t *const  slice)
Parameters
sliceConstant pointer to CC4 Slice
Returns

XMC_CCU4_SLICE_TIMER_COUNT_DIR_t returns the direction in which the timer is counting.
Description:
Returns the timer counting direction, by reading CC4yTCST.CDIR bit.

This API will return the direction in which the timer is currently incrementing(XMC_CCU4_SLICE_TIMER_COUNT_DIR_UP) or decrementing (XMC_CCU4_SLICE_TIMER_COUNT_DIR_DOWN).
Related APIs:
None.
bool XMC_CCU4_SLICE_GetEvent ( const XMC_CCU4_SLICE_t *const  slice,
const XMC_CCU4_SLICE_IRQ_ID_t  event 
)
Parameters
sliceConstant pointer to CC4 Slice
eventEvent to be evaluated for assertion
Returns

bool Returns true if event is set else false is returned.
Description:
Evaluates if a given event is asserted or not, by reading CC4yINTS register.

Return true if the event is asserted. For a event to be asserted it has to be first enabled. Only if that event is enabled the call to this API is valid. If the Event is enabled and has not yet occurred then a false is returned.
Related APIs:
XMC_CCU4_SLICE_EnableEvent()
XMC_CCU4_SLICE_SetEvent().
XMC_CCU4_STATUS_t XMC_CCU4_SLICE_GetLastCapturedTimerValue ( const XMC_CCU4_SLICE_t *const  slice,
const XMC_CCU4_SLICE_CAP_REG_SET_t  set,
uint32_t *  val_ptr 
)
Parameters
sliceConstant pointer to CC4 Slice
setThe capture register set, which must be evaluated
val_ptrOut Parameter of the API.Stores the captured timer value into this out parameter.
Returns

XMC_CCU4_STATUS_t Returns XMC_CCU4_STATUS_OK if there was new value present in the capture registers. returns XMC_CCU4_STATUS_ERROR if there was no new value present in the capture registers.
Description:
Retrieves the latest captured timer value, by reading CC4yCV registers.

Retrieve the timer value last stored by the slice. When separate capture events are used, users must specify the capture set to evaluate. If single capture event mode is used, all 4 capture registers are evaluated.
The lowest register is evaluated first followed by the next higher ordered register and this continues until all capture registers have been evaluated.
Related APIs:
XMC_CCU4_SLICE_GetCaptureRegisterValue().
XMC_CCU4_SLICE_MODE_t XMC_CCU4_SLICE_GetSliceMode ( const XMC_CCU4_SLICE_t *const  slice)
Parameters
sliceConstant pointer to CC4 Slice
Returns

XMC_CCU4_SLICE_MODE_t returns XMC_CCU4_SLICE_MODE_COMPARE if the slice is operating in compare mode returns XMC_CCU4_SLICE_MODE_CAPTURE if the slice is operating in capture mode
Description:
Retrieves the current mode of operation in the slice (either Capture mode or Compare mode), by reading CC4yTC.CMOD bit.

Ensure that before invoking this API the CCU4 slice should be configured otherwise the output of this API is invalid.
Related APIs:
None.
uint16_t XMC_CCU4_SLICE_GetTimerCompareMatch ( const XMC_CCU4_SLICE_t *const  slice)
Parameters
sliceConstant pointer to CC4 Slice
Returns

uint16_t returns the current timer compare value Range: [0x0 to 0xFFFF]
Description:
Retrieves the timer compare value currently effective, by reading CC4yCRS register.

If the timer is active then the value being returned is currently being for the PWM duty cycle( timer compare value).
Note:
The XMC_CCU4_SLICE_SetTimerCompareMatch() would set the new compare value to a shadow register. This would only transfer the new values into the actual compare register if the shadow transfer request is enabled and if a period match occurs. Hence a consecutive call to XMC_CCU4_SLICE_GetTimerCompareMatch() would not reflect the new values until the shadow transfer completes. Directly accessed Register is CC4yCR.
Related APIs:
XMC_CCU4_SLICE_SetTimerCompareMatch().
XMC_CCU4_SLICE_TIMER_COUNT_MODE_t XMC_CCU4_SLICE_GetTimerCountingMode ( const XMC_CCU4_SLICE_t *const  slice)
Parameters
sliceConstant pointer to CC4 Slice
Returns

XMC_CCU4_SLICE_TIMER_COUNT_MODE_t returns XMC_CCU4_SLICE_TIMER_COUNT_MODE_EA if edge aligned mode is selected returns XMC_CCU4_SLICE_TIMER_COUNT_MODE_CA if center aligned mode is selected
Description:
Retrieves timer counting mode either Edge aligned or Center Aligned, by reading CC4yTC.TCM bit.

Related APIs:
XMC_CCU4_SLICE_SetTimerCountingMode().
uint16_t XMC_CCU4_SLICE_GetTimerPeriodMatch ( const XMC_CCU4_SLICE_t *const  slice)
Parameters
sliceConstant pointer to CC4 Slice
Returns

uint16_t returns the current timer period value Range: [0x0 to 0xFFFF]
Description:
Retrieves the timer period value currently effective, by reading CC4yPR register.

If the timer is active then the value being returned is currently being used for the PWM period.
Note:
The XMC_CCU4_SLICE_SetTimerPeriodMatch() would set the new period value to a shadow register. This would only transfer the new values into the actual period register if the shadow transfer request is enabled and if a period match occurs. Hence a consecutive call to XMC_CCU4_SLICE_GetTimerPeriodMatch() would not reflect the new values until the shadow transfer completes.
Related APIs:
XMC_CCU4_SLICE_SetTimerPeriodMatch().
XMC_CCU4_SLICE_TIMER_REPEAT_MODE_t XMC_CCU4_SLICE_GetTimerRepeatMode ( const XMC_CCU4_SLICE_t *const  slice)
Parameters
sliceConstant pointer to CC4 Slice
Returns

XMC_CCU4_SLICE_TIMER_REPEAT_MODE_t returns XMC_CCU4_SLICE_TIMER_REPEAT_MODE_REPEAT if continuous mode is selected returns XMC_CCU4_SLICE_TIMER_REPEAT_MODE_SINGLE if single shot mode is selected
Description:
Retrieves the Timer repeat mode, either Single shot mode or continuous mode, by reading CC4yTC.TSSM bit.

The timer will count up to the terminal count as specified in the period register and stops immediately if the repeat mode has been set to single shot mode. In the continuous mode of operation, the timer starts counting all over again after reaching the terminal count.
Related APIs:
XMC_CCU4_SLICE_SetTimerRepeatMode().
uint16_t XMC_CCU4_SLICE_GetTimerValue ( const XMC_CCU4_SLICE_t *const  slice)
Parameters
sliceConstant pointer to CC4 Slice
Returns

uint16_t returns the current timer value Range: [0x0 to 0xFFFF]
Description:
Retrieves the latest timer value, from CC4yTIMER register.

Related APIs:
XMC_CCU4_SLICE_SetTimerValue().
bool XMC_CCU4_SLICE_IsExtendedCapReadEnabled ( const XMC_CCU4_SLICE_t *const  slice)
Parameters
sliceConstant pointer to CC4 Slice
Returns

bool would return true if the extended capture read back mode is enabled
Description:
Checks if Extended capture mode read is enabled for particular slice or not, by reading CC4yTC.ECM bit.

In this mode the there is only one associated read address for all the capture registers. Individual capture registers can still be accessed in this mode.
Related APIs:
XMC_CCU4_GetCapturedValueFromFifo().
bool XMC_CCU4_SLICE_IsTimerRunning ( const XMC_CCU4_SLICE_t *const  slice)
Parameters
sliceConstant pointer to CC4 Slice
Returns

bool returns true if the Timer is running else it returns false.
Description:
Returns the state of the timer (Either Running or stopped(idle)), by reading CC4yTCST.TRB bit.
Related APIs:
XMC_CCU4_SLICE_StartTimer()
XMC_CCU4_SLICE_StopTimer().
void XMC_CCU4_SLICE_LoadConfig ( XMC_CCU4_SLICE_t *const  slice,
const XMC_CCU4_SLICE_EVENT_t  event 
)
Parameters
sliceConstant pointer to CC4 Slice
eventMap an External event to the External load Function
Returns

None
Description:
Configures the Load Function for the slice, by configuring CC4yCMC.LDS bit.

Load function is mapped with one of the 3 events. Up on occurrence of the event,
if CC4yTCST.CDIR set to 0,CC4yTIMER register is reloaded with the value from compare register
if CC4yTCST.CDIR set to 1,CC4yTIMER register is reloaded with the value from period register
Related APIs:
XMC_CCU4_SLICE_ConfigureEvent()
XMC_CCU4_SLICE_SetInput().
void XMC_CCU4_SLICE_ModulationConfig ( XMC_CCU4_SLICE_t *const  slice,
const XMC_CCU4_SLICE_EVENT_t  event,
const XMC_CCU4_SLICE_MODULATION_MODE_t  mod_mode,
const bool  synch_with_pwm 
)
Parameters
sliceConstant pointer to CC4 Slice
eventMap an External event to the External Modulation Function
mod_modeDesired Modulation mode
synch_with_pwmOption to synchronize modulation with PWM start Pass true if the modulation needs to be synchronized with PWM signal.
Returns

None
Description:
Configures the Output Modulation Function of the slice, by configuring CCeyCMC.MOS, CC4yTC.EMT and CC4yTC.EMS bits.

Modulation function is mapped with one of the 3 events. The output signal of the CCU can be modulated according to a external input. Additionally, the behaviour of the slice upon activation of the modulation function is configured as well.
Related APIs:
XMC_CCU4_SLICE_ConfigureEvent()
XMC_CCU4_SLICE_SetInput().
void XMC_CCU4_SLICE_SetDitherCompareValue ( XMC_CCU4_SLICE_t *const  slice,
const uint8_t  comp_val 
)
Parameters
sliceConstant pointer to CC4 Slice
comp_valDither compare value Range: [0x0 to 0xF]
Returns

None
Description:
Sets the dither spread/compare value, by setting CC4yDITS.DCVS bits.

This value is the cornerstone of PWM dithering feature. Dithering is applied/done when the value in the dithering counter is less than this compare/spread value. For all dithering counter values greater than the spread value, there is no dithering. After setting the value XMC_CCU4_EnableShadowTransfer() has to be called with appropriate mask.
Related APIs:
XMC_CCU4_SLICE_EnableDithering().
void XMC_CCU4_SLICE_SetEvent ( XMC_CCU4_SLICE_t *const  slice,
const XMC_CCU4_SLICE_IRQ_ID_t  event 
)
Parameters
sliceConstant pointer to CC4 Slice
eventEvent whose assertion can potentially lead to an interrupt
Returns

None
Description:
Manually asserts the requested event, by setting CC4ySWS register.

For an event to lead to an interrupt, it must first be enabled and bound to a service request line. The corresponding NVIC node must be enabled as well. This API manually asserts the requested event.
Related APIs:
XMC_CCU4_SLICE_SetInterruptNode()
XMC_CCU4_SLICE_EnableEvent()
XMC_CCU4_SLICE_EnableMultipleEvents().
void XMC_CCU4_SLICE_SetFloatingPrescalerCompareValue ( XMC_CCU4_SLICE_t *const  slice,
const uint8_t  cmp_val 
)
Parameters
sliceConstant pointer to CC4 Slice
cmp_valPrescaler divider compare value Range: [0x0 to 0xF]
Returns

None
Description:
Programs the slice specific prescaler divider compare value, by configuring CC4yFPCS register.

The compare value is applicable only in floating mode of operation. The prescaler divider starts with an initial value and increments to the compare value steadily upon every period match. Once prescaler divider equals the prescaler divider compare value, the value in the former resets back to the PVAL (from FPC). After setting the value, XMC_CCU4_EnableShadowTransfer() has to be called with appropriate mask.
Related APIs:
XMC_CCU4_SLICE_SetPrescaler().
void XMC_CCU4_SLICE_SetInput ( XMC_CCU4_SLICE_t *const  slice,
const XMC_CCU4_SLICE_EVENT_t  event,
const XMC_CCU4_SLICE_INPUT_t  input 
)
Parameters
sliceConstant pointer to CC4 Slice
eventThe External Event which needs to be configured.
inputOne of the 16 inputs meant to be mapped to the desired event
Returns

None
Description:
Selects an input for an external event, by configuring CC4yINS register.

It is possible to select one of the possible 16 input signals for a given Event. This configures the CC4yINS.EVxIS for the selected event.
Related APIs:
XMC_CCU4_SLICE_StartConfig()
XMC_CCU4_SLICE_StopConfig()
XMC_CCU4_SLICE_LoadConfig()
XMC_CCU4_SLICE_ModulationConfig()
XMC_CCU4_SLICE_CountConfig()
XMC_CCU4_SLICE_GateConfig()
XMC_CCU4_SLICE_Capture0Config()
XMC_CCU4_SLICE_Capture1Config()
XMC_CCU4_SLICE_DirectionConfig()
XMC_CCU4_SLICE_StatusBitOverrideConfig()
XMC_CCU4_SLICE_TrapConfig().
void XMC_CCU4_SLICE_SetInterruptNode ( XMC_CCU4_SLICE_t *const  slice,
const XMC_CCU4_SLICE_IRQ_ID_t  event,
const XMC_CCU4_SLICE_SR_ID_t  sr 
)
Parameters
sliceConstant pointer to CC4 Slice
eventEvent which must be bound to a service request line
srThe Service request line which is bound to the event
Returns

None
Description:
Binds requested event to a service request line, by configuring CC4ySRS register with respective event.

For an event to lead to an interrupt, it must first be enabled and bound to a service request line. The corresponding NVIC node must be enabled as well. This API binds the requested event with the requested service request line(sr).
Related APIs:
XMC_CCU4_SLICE_EnableEvent()
XMC_CCU4_SLICE_SetEvent().
void XMC_CCU4_SLICE_SetPassiveLevel ( XMC_CCU4_SLICE_t *const  slice,
const XMC_CCU4_SLICE_OUTPUT_PASSIVE_LEVEL_t  level 
)
Parameters
sliceConstant pointer to CC4 Slice
levelSlice output passive level
Returns

None
Description:
Configures the passive level for the slice output, by setting CC4yPSL register.

Defines the passive level for the timer slice output pin. Selects either level high is passive or level low is passive. This is the level of the output before the compare match is value changes it.
Related APIs:
XMC_CCU4_SLICE_EnableEvent()
XMC_CCU4_SLICE_SetEvent().
void XMC_CCU4_SLICE_SetPrescaler ( XMC_CCU4_SLICE_t *const  slice,
const XMC_CCU4_SLICE_PRESCALER_t  div_val 
)
Parameters
sliceConstant pointer to CC4 Slice
div_valPrescaler divider value. Accepts enum :: XMC_CCU4_SLICE_PRESCALER_t Range: [0x0 to 0xF]
Returns

None
Description:
Programs the slice specific prescaler divider, by configuring the CC4yPSC and CC4yFPC registers.

The prescaler divider may only be programmed after the prescaler run bit has been cleared by calling XMC_CCU4_StopPrescaler().
Related APIs:
XMC_CCU4_SLICE_SetFloatingPrescalerCompareValue().
void XMC_CCU4_SLICE_SetShadowTransferMode ( XMC_CCU4_SLICE_t *const  slice,
const XMC_CCU4_SLICE_SHADOW_TRANSFER_MODE_t  shadow_transfer_mode 
)
Parameters
sliceConstant pointer to CC4 Slice
shadow_transfer_modemode to be configured Use :: XMC_CCU4_SLICE_SHADOW_TRANSFER_MODE_t enum items for mode
Returns

None
Description:
Configures when the shadow transfer has to occur, by setting STM bit in STC register.

After requesting for shadow transfer mode using XMC_CCU4_EnableShadowTransfer(), actual transfer occurs based on the selection done using this API (i.e. on period and One match, on Period match only, on One match only).
Note:
This is effective when the timer is configured in centre aligned mode.
Related APIs:
XMC_CCU4_EnableShadowTransfer()
Note
Only available for XMC1400 series
void XMC_CCU4_SLICE_SetTimerCompareMatch ( XMC_CCU4_SLICE_t *const  slice,
const uint16_t  compare_val 
)
Parameters
sliceConstant pointer to CC4 Slice
compare_valTimer compare value
Returns

None
Description:
Programs the timer compare value, by writing CC4yCRS register.

The PWM duty cycle is determined by this value. The compare value is written to a shadow register. Explicitly enable the shadow transfer for the the period/compare value by calling XMC_CCU4_EnableShadowTransfer() with appropriate mask.If shadow transfer is enabled and the timer is running, a period match transfers the value from the shadow register to the actual compare register.
Related APIs:
XMC_CCU4_SLICE_GetTimerPeriodMatch().
void XMC_CCU4_SLICE_SetTimerCountingMode ( XMC_CCU4_SLICE_t *const  slice,
const XMC_CCU4_SLICE_TIMER_COUNT_MODE_t  mode 
)
Parameters
sliceConstant pointer to CC4 Slice
modeDesired counting mode (Either Edge Aligned or Center Aligned)
Returns

None
Description:
Configures the timer counting mode either Edge Aligned or Center Aligned, by configuring CC4yTC.TCM bit.

In the edge aligned mode, the timer counts from 0 to the terminal count. Once the timer count has reached a preset compare value, the timer status output asserts itself. It will now deassert only after the timer count reaches the terminal count.
In the center aligned mode, the timer first counts from 0 to the terminal count and then back to 0. During this upward and downward counting, the timer status output stays asserted as long as the timer value is greater than the compare value.
Related APIs:
XMC_CCU4_SLICE_GetTimerCountingMode().
void XMC_CCU4_SLICE_SetTimerPeriodMatch ( XMC_CCU4_SLICE_t *const  slice,
const uint16_t  period_val 
)
Parameters
sliceConstant pointer to CC4 Slice
period_valTimer period value Range: [0x0 to 0xFFFF]
Returns

None
Description:
Programs the timer period, by writing CC4yPRS register.

The frequency of counting/ PWM frequency is determined by this value. The period value is written to a shadow register. Explicitly enable the shadow transfer for the the period value by calling XMC_CCU4_EnableShadowTransfer() with appropriate mask. If shadow transfer is enabled and the timer is running, a period match transfers the value from the shadow register to the actual period register.
Related APIs:
XMC_CCU4_SLICE_GetTimerPeriodMatch().
void XMC_CCU4_SLICE_SetTimerRepeatMode ( XMC_CCU4_SLICE_t *const  slice,
const XMC_CCU4_SLICE_TIMER_REPEAT_MODE_t  mode 
)
Parameters
sliceConstant pointer to CC4 Slice
modeDesired repetition mode (Either single shot or Continuous)
Returns

None
Description:
Configures the Timer to either Single shot mode or continuous mode, by configuring CC4yTC.TSSM bit.

The timer will count up to the terminal count as specified in the period register and stops immediately if the repeat mode has been set to single shot. In the continuous mode of operation, the timer starts counting all over again after reaching the terminal count.
Related APIs:
XMC_CCU4_SLICE_GetTimerRepeatMode().
void XMC_CCU4_SLICE_SetTimerValue ( XMC_CCU4_SLICE_t *const  slice,
const uint16_t  timer_val 
)
Parameters
sliceConstant pointer to CC4 Slice
timer_valThe new timer value that has to be loaded into the TIMER register. Range: [0x0 to 0xFFFF]
Returns

None
Description:
Loads a new timer value, by setting CC4yTIMER register.

Note:
Request to load is ignored if the timer is running.
Related APIs:
XMC_CCU4_SLICE_GetTimerValue().
void XMC_CCU4_SLICE_StartConfig ( XMC_CCU4_SLICE_t *const  slice,
const XMC_CCU4_SLICE_EVENT_t  event,
const XMC_CCU4_SLICE_START_MODE_t  start_mode 
)
Parameters
sliceConstant pointer to CC4 Slice
eventMap an External event to the External Start Function
start_modeBehavior of slice when the start function is activated
Returns

None
Description:
Configures the Start Function of the slice, by configuring CC4yCMC.ENDS and CC4yTC.ENDM bits.

Start function is mapped with one of the 3 events. An external signal can control when a CC4 timer should start. Additionally, the behaviour of the slice upon activation of the start function is configured as well.
Related APIs:
XMC_CCU4_SLICE_StopConfig()
XMC_CCU4_SLICE_ConfigureEvent()
XMC_CCU4_SLICE_SetInput().
void XMC_CCU4_SLICE_StartTimer ( XMC_CCU4_SLICE_t *const  slice)
Parameters
sliceConstant pointer to CC4 Slice
Returns

None
Description:
Starts the timer counting operation, by setting CC4yTCSET.TRBS bit.

It is necessary to have configured the CC4 slice before starting its timer. Before the Timer is started ensure that the clock is provided to the slice.
Related APIs:
XMC_CCU4_SLICE_StopTimer().
void XMC_CCU4_SLICE_StatusBitOverrideConfig ( XMC_CCU4_SLICE_t *const  slice)
Parameters
sliceConstant pointer to CC4 Slice
Returns

None
Description:
Configures the status bit override Function of the slice, by configuring CC4yCMC.OFS bit.

Status bit override function is mapped with one of the 3 events. A slice can be configured to change the output of the timer's CC4yST signal depending on an external signal.
Related APIs:
XMC_CCU4_SLICE_ConfigureStatusBitOverrideEvent().
void XMC_CCU4_SLICE_StopClearTimer ( XMC_CCU4_SLICE_t *const  slice)
Parameters
sliceConstant pointer to CC4 Slice
Returns

None
Description:
Stops and resets the timer count to zero, by setting CC4yTCCLR.TCC and CC4yTCCLR.TRBC bit.

Related APIs:
XMC_CCU4_SLICE_StartTimer().
void XMC_CCU4_SLICE_StopConfig ( XMC_CCU4_SLICE_t *const  slice,
const XMC_CCU4_SLICE_EVENT_t  event,
const XMC_CCU4_SLICE_END_MODE_t  end_mode 
)
Parameters
sliceConstant pointer to CC4 Slice
eventMap an External event to the External Stop Function
end_modeBehavior of slice when the stop function is activated
Returns

None
Description:
Configures the Stop function for the slice, by configuring CC4yCMC.STRTS and CC4yTC.STRM bits.

Stop function is mapped with one of the 3 events. An external signal can control when a CCU4 timer should stop. Additionally, the behaviour of the slice upon activation of the stop function is configured as well.
Related APIs:
XMC_CCU4_SLICE_StartConfig()
XMC_CCU4_SLICE_ConfigureEvent()
XMC_CCU4_SLICE_SetInput().
void XMC_CCU4_SLICE_StopTimer ( XMC_CCU4_SLICE_t *const  slice)
Parameters
sliceConstant pointer to CC4 Slice
Returns

None
Description:
Stops the Timer.

Timer counting operation can be stopped by invoking this API, by setting CC4yTCCLR.TRBC bit.
Related APIs:
XMC_CCU4_SLICE_StartTimer().
void XMC_CCU4_SLICE_TrapConfig ( XMC_CCU4_SLICE_t *const  slice,
const XMC_CCU4_SLICE_TRAP_EXIT_MODE_t  exit_mode,
bool  synch_with_pwm 
)
Parameters
sliceConstant pointer to CC4 Slice
exit_modeHow should a previously logged trap state be exited?
synch_with_pwmShould exit of trap state be synchronized with PWM cycle start?
Returns

None
Description:
Configures the Trap Function of the slice, by configuring CC4yCMC.TS, CC4yTC.TRPSE, and CC4yTC.TRPSW bits.

Trap function is mapped with Event-2. Criteria for exiting the trap state is configured. This trap function allows PWM outputs to react on the state of an input pin. Thus PWM output can be forced to inactive state upon detection of a trap. It is also possible to synchronize the trap function with the PWM signal using the synch_with_pwm.
Related APIs:
XMC_CCU4_SLICE_ConfigureEvent()
XMC_CCU4_SLICE_SetInput().
void XMC_CCU4_SLICE_WriteCoherentlyWithPWMCycle ( XMC_CCU4_SLICE_t *const  slice,
const uint32_t  coherent_write 
)
Parameters
sliceConstant pointer to CC4 Slice
coherent_writespecifies for what fields this mode has to be applied Use :: XMC_CCU4_SLICE_WRITE_INTO_t enum items to create a mask of choice, using a bit wise OR operation.
Returns

None
Description:
Configures the specified fields shadow value to be updated in synchronous with PWM after shadow transfer request, by clearing IRPC, IRCC1, IRCC2, IRLC, IRDC, IRFC bits in STC register.

When coherent shadow is enabled, after calling XMC_CCU4_EnableShadowTransfer(), the value which are written in the respective shadow registers get updated according the configuration done using XMC_CCU4_SLICE_SetShadowTransferMode() API.
Note:
Related APIs:
XMC_CCU4_EnableShadowTransfer(), XMC_CCU4_SLICE_SetShadowTransferMode()
Note
Only available for XMC1400 series
void XMC_CCU4_SLICE_WriteImmediateAfterShadowTransfer ( XMC_CCU4_SLICE_t *const  slice,
const uint32_t  immediate_write 
)
Parameters
sliceConstant pointer to CC4 Slice
immediate_writespecifies for what fields this mode has to be applied Use :: XMC_CCU4_SLICE_WRITE_INTO_t enum items to create a mask of choice, using a bit wise OR operation.
Returns

None
Description:
Configures the specified fields shadow value to be updated immediately after shadow transfer request, by setting IRPC, IRCC1, IRCC2, IRLC, IRDC, IRFC bits in STC register.

When immediate shadow is enabled, by calling XMC_CCU4_EnableShadowTransfer() the value which are written in the shadow registers get updated to the actual registers immediately.
Note:
Related APIs:
XMC_CCU4_EnableShadowTransfer()
Note
Only available for XMC1400 series
void XMC_CCU4_StartPrescaler ( XMC_CCU4_MODULE_t *const  module)
Parameters
moduleConstant pointer to CCU4 module
Returns

None
Description:
Starts the prescaler and restores clocks to the timer slices, by setting GIDLC.SPRB bit.

Once the input to the prescaler has been chosen and the prescaler divider of all slices programmed, the prescaler itself may be started. Invoke this API after XMC_CCU4_Init() (Mandatory to fully initialize the module).Directly accessed register is GIDLC.
Related APIs:
XMC_CCU4_Init()
XMC_CCU4_EnableClock()
XMC_CCU4_DisableClock()
XMC_CCU4_StartPrescaler()
XMC_CCU4_StopPrescaler().
void XMC_CCU4_StopPrescaler ( XMC_CCU4_MODULE_t *const  module)
Parameters
moduleConstant pointer to CCU4 module
Returns

None
Description:
Stops the prescaler and blocks clocks to the timer slices, by setting GIDLS.CPRB bit.

Opposite of the StartPrescaler routine. Clears the run bit of the prescaler. Ensures that the module clock is not supplied to the slices of the module.Registers directly accessed is GIDLS.
Related APIs:
XMC_CCU4_EnableClock()
XMC_CCU4_DisableClock()
XMC_CCU4_StartPrescaler()
XMC_CCU4_StopPrescaler().
Generated on Mon Aug 7 2017 11:33:56 for XMC Peripheral Library for XMC4000 Family by   doxygen 1.8.11