XMC Peripheral Library for XMC4000 Family
2.1.16
|
Data Structures | |
struct | XMC_CCU8_SLICE_CAPTURE_CONFIG_t |
struct | XMC_CCU8_SLICE_COMPARE_CONFIG_t |
struct | XMC_CCU8_SLICE_DEAD_TIME_CONFIG_t |
struct | XMC_CCU8_SLICE_EVENT_CONFIG_t |
Typedefs | |
typedef CCU8_GLOBAL_TypeDef | XMC_CCU8_MODULE_t |
typedef uint8_t | XMC_CCU8_SLICE_INPUT_t |
typedef CCU8_CC8_TypeDef | XMC_CCU8_SLICE_t |
Enumerations |
Detailed Description
The CCU8 peripheral functions play a major role in applications that need complex Pulse Width Modulation (PWM) signal generation, with complementary high side and low side switches, multi phase control. These functions in conjunction with a very flexible and programmable signal conditioning scheme, make the CCU8 the must have peripheral for state of the art motor control, multi phase and multi level power electronics systems.
Each CCU8 module is comprised of four identical 16 bit Capture/Compare Timer slices, CC8y (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 CCU8: – Timer configuration, Capture configuration, Function/Event configuration, Interrupt configuration
- Note:
- SLICE (APIs prefixed with e.g. XMC_CCU8_SLICE_)
- Module (APIs are not having any prefix e.g. XMC_CCU8_)
- Timer(Compare mode) configuration:
- This section of the LLD provides the configuration structure XMC_CCU8_SLICE_COMPARE_CONFIG_t, XMC_CCU8_SLICE_DEAD_TIME_CONFIG_t and the initialization functions XMC_CCU8_SLICE_CompareInit(), XMC_CCU8_SLICE_DeadTimeInit().
It can be used to:
- Start and Stop the timer. (XMC_CCU8_SLICE_StartTimer(), XMC_CCU8_SLICE_StopTimer())
- Update the period, compare, Dither, Prescaler and Passive values. (XMC_CCU8_SLICE_SetTimerPeriodMatch(), XMC_CCU8_SLICE_SetTimerCompareMatch(), XMC_CCU8_SLICE_SetPrescaler(), XMC_CCU8_SLICE_SetDitherCompareValue(), XMC_CCU8_SLICE_SetPassiveLevel())
- Configure the dead time.(XMC_CCU8_SLICE_SetDeadTimeValue(), XMC_CCU8_SLICE_SetDeadTimePrescaler())
- Enable the slices to support multichannel mode. (XMC_CCU8_SLICE_EnableMultiChannelMode())
- Capture configuration:
- This section of the LLD provides the configuration structure XMC_CCU8_SLICE_CAPTURE_CONFIG_t and the initialization function XMC_CCU8_SLICE_CaptureInit().
It can be used to:
- Configure the capture functionality. (XMC_CCU8_SLICE_Capture0Config(), XMC_CCU8_SLICE_Capture1Config())
- Read the captured values along with the status, which indicate the value is latest or not. (XMC_CCU8_SLICE_GetCaptureRegisterValue())
- Function/Event configuration:
- This section of the LLD provides the configuration structure XMC_CCU8_SLICE_EVENT_CONFIG_t.
It can be used to:
- Enable and Disable the events. (XMC_CCU8_SLICE_EnableEvent(), XMC_CCU8_SLICE_DisableEvent())
- Configure to start and stop the timer on external events.(XMC_CCU8_SLICE_StartConfig(), XMC_CCU8_SLICE_StopConfig())
- Modulation, external load and Gating of the timer output.(XMC_CCU8_SLICE_ModulationConfig(), XMC_CCU8_SLICE_LoadConfig(), XMC_CCU8_SLICE_GateConfig())
- Control the count direction of the timer based on the external event. (XMC_CCU8_SLICE_DirectionConfig())
- Count the external events.(XMC_CCU8_SLICE_CountConfig())
- External Trap. Which can be used as protective feature.(XMC_CCU8_SLICE_EnableTrap(), XMC_CCU8_SLICE_DisableTrap(), XMC_CCU8_SLICE_TrapConfig())
- Interrupt configuration:
- This section of the LLD provides the function to configure the interrupt node to each event (XMC_CCU8_SLICE_SetInterruptNode())
Typedef Documentation
typedef CCU8_GLOBAL_TypeDef XMC_CCU8_MODULE_t |
Typedef for CCU8 Global data structure
typedef uint8_t XMC_CCU8_SLICE_INPUT_t |
External Event Input list. This list depicts the possible input connections to the CCU8 slice. Interconnects are specific to each device.
typedef CCU8_CC8_TypeDef XMC_CCU8_SLICE_t |
Typedef for CCU8 Slice data structure
Enumeration Type Documentation
enum XMC_CCU8_CLOCK_t |
CCU8 set the shadow transfer type for multichannel mode
enum XMC_CCU8_OUT_PATH_t |
Output selector for CCU8x.OUT0-3
Slice shadow transfer options.
Actions that can be performed upon detection of an external Timer STOP event
External Event trigger criteria - Edge sensitivity
Low pass filter Configuration. The External Event input should be stable for a selected number of clock cycles.
External Event trigger criteria - Level sensitivity
External Function list
Available Interrupt Event Ids
Multi Channel Shadow transfer request configuration options
Compare channel for which modulation has to be applied
Available Interrupt Event Ids, which is added to support multi event APIs
Timer clock Divider
Slice shadow transfer mode options.
- Note
- Not available for XMC4500 series
Service Request Lines for CCU8. Event are mapped to these SR lines and these are used to generate the interrupt.
The compare channel output which is routed to the slice output signal(STy).
Timer clear on capture
Output sources for OUTy0 signal
- Note
- Only available for XMC1400 series
Output sources for OUTy1 signal
- Note
- Only available for XMC1400 series
Output sources for OUTy2 signal
- Note
- Only available for XMC1400 series
Output sources for OUTy3 signal
- Note
- Only available for XMC1400 series
enum XMC_CCU8_STATUS_t |
Function Documentation
void XMC_CCU8_DisableClock | ( | XMC_CCU8_MODULE_t *const | module, |
const uint8_t | slice_number | ||
) |
- Parameters
-
module Constant pointer to CCU8 module slice_number Slice 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.
void XMC_CCU8_DisableModule | ( | XMC_CCU8_MODULE_t *const | module | ) |
- Parameters
-
module Constant pointer to CCU8 module
- Returns
None
- Description:
- Brings the CCU8 module to reset state and enables gating of the clock signal(if applicable depending on the device being selected).
Invoke this API when a CCU8 module needs to be disabled completely. Any operation on the CCU8 module will have no effect after this API is called.
- Related APIs:
- XMC_CCU8_EnableModule()
XMC_CCU8_DisableModule().
void XMC_CCU8_EnableClock | ( | XMC_CCU8_MODULE_t *const | module, |
const uint8_t | slice_number | ||
) |
- Parameters
-
module Constant pointer to CCU8 module slice_number Slice 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. Directly accessed register is GIDLC.
void XMC_CCU8_EnableModule | ( | XMC_CCU8_MODULE_t *const | module | ) |
- Parameters
-
module Constant pointer to CCU8 module
- Returns
None
- Description:
- Enables the CCU8 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 CCU8 module. Invoked from XMC_CCU8_Init().
void XMC_CCU8_EnableMultipleClocks | ( | XMC_CCU8_MODULE_t *const | module, |
const uint8_t | clock_mask | ||
) |
- Parameters
-
module Constant pointer to CCU8 module clock_mask Slices 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_CCU8_EnableClock()
XMC_CCU8_DisableClock().
void XMC_CCU8_EnableShadowTransfer | ( | XMC_CCU8_MODULE_t *const | module, |
const uint32_t | shadow_transfer_msk | ||
) |
- Parameters
-
module Constant pointer to CCU8 module shadow_transfer_msk Shadow transfer request mask for various transfers. Use XMC_CCU8_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_CCU8_SLICE_SetTimerPeriodMatch()
XMC_CCU8_SLICE_SetTimerCompareMatch()
XMC_XMC_CCU8_SLICE_SetPrescaler()
XMC_CCU8_SLICE_CompareInit()
XMC_CCU8_SLICE_CaptureInit(). must be succeeded by this API.
- Related APIs:
- None.
void XMC_CCU8_Init | ( | XMC_CCU8_MODULE_t *const | module, |
const XMC_CCU8_SLICE_MCMS_ACTION_t | mcs_action | ||
) |
- Parameters
-
module Constant pointer to CCU8 module mcs_action multi-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_CCU8_EnableModule(). The API call would bring up the required CCU8 module and also initialize the module for the required multi-channel shadow transfer.
- Related APIs:
- XMC_CCU8_SLICE_CompareInit()
XMC_CCU8_SLICE_CaptureInit().
bool XMC_CCU8_IsPrescalerRunning | ( | XMC_CCU8_MODULE_t *const | module | ) |
- Parameters
-
module Constant pointer to CCU8 module
- Returns
None
- Description:
- Returns the state of the prescaler, by reading GSTAT.PRB bit.
If clock is being supplied to the slices of the module then returns as true.
void XMC_CCU8_SetModuleClock | ( | XMC_CCU8_MODULE_t *const | module, |
const XMC_CCU8_CLOCK_t | clock | ||
) |
- Parameters
-
module Constant pointer to CCU8 module clock Choice 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_CCU8_Init().
- Related APIs:
- None.
void XMC_CCU8_SetMultiChannelShadowTransferMode | ( | XMC_CCU8_MODULE_t *const | module, |
const uint32_t | slice_mode_msk | ||
) |
- Parameters
-
module Constant pointer to CCU8 module slice_mode_msk Slices for which the configuration has to be applied. Use XMC_CCU8_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 CCU8x.MCSS input.
- Related APIs:
- None.
void XMC_CCU8_SLICE_Capture0Config | ( | XMC_CCU8_SLICE_t *const | slice, |
const XMC_CCU8_SLICE_EVENT_t | event | ||
) |
- Parameters
-
slice Constant pointer to CC8 Slice event Map an External event to the Capture-0 Function
- Returns
None
- Description:
- Configures the Capture-0 Function of the slice, by configuring CC8yCMC.CAP0S bit.
Capture function is mapped with one of the 3 events. A CCU8 slice can be configured into capture-0 mode with the selected event. In this mode the CCU8 will capture the timer value into CC8yC0V and CC8yC1V.
- Related APIs:
- XMC_CCU8_SLICE_ConfigureEvent()
XMC_CCU8_SLICE_SetInput().
void XMC_CCU8_SLICE_Capture1Config | ( | XMC_CCU8_SLICE_t *const | slice, |
const XMC_CCU8_SLICE_EVENT_t | event | ||
) |
- Parameters
-
slice Constant pointer to CC8 Slice event Map an External event to the Capture-1 Function
- Returns
None
- Description:
- Configures the Capture-1 Function of the slice, by configuring CC8yCMC.CAP1S bit.
Capture function is mapped with one of the 3 events. A CCU8 slice can be configured into capture-1 mode with the selected event. In this mode the CCU8 will capture the timer value into CC8yC2V and CC8yC3V.
- Related APIs:
- XMC_CCU8_SLICE_ConfigureEvent()
XMC_CCU8_SLICE_SetInput().
void XMC_CCU8_SLICE_CaptureInit | ( | XMC_CCU8_SLICE_t *const | slice, |
const XMC_CCU8_SLICE_CAPTURE_CONFIG_t *const | capture_init | ||
) |
- Parameters
-
slice Constant pointer to CC8 Slice capture_init Pointer to slice configuration structure
- Returns
None
- Description:
- Initialization of a CC8 slice to capture mode, by configuring CC8yTC, CC8yCMC, CC8yPSC,CC8yFPCS registers.
CC8 slice is configured with Capture configurations in this routine. Timer is stopped before initialization by calling XMC_CCU8_SLICE_StopTimer(). After initialization user has to explicitly enable the shadow transfer for the required values by calling XMC_CCU8_EnableShadowTransfer() with appropriate mask.
void XMC_CCU8_SLICE_ClearEvent | ( | XMC_CCU8_SLICE_t *const | slice, |
const XMC_CCU8_SLICE_IRQ_ID_t | event | ||
) |
- Parameters
-
slice Constant pointer to CC8 Slice event Asserted event which must be acknowledged.
- Returns
None
- Description:
- Acknowledges an asserted event, by setting CC8ySWR with respective event flag.
void XMC_CCU8_SLICE_ClearTimer | ( | XMC_CCU8_SLICE_t *const | slice | ) |
- Parameters
-
slice Constant pointer to CC8 Slice
- Returns
None
- Description:
- Resets the timer count to zero, by setting CC8yTCCLR.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_CCU8_SLICE_StartTimer().
void XMC_CCU8_SLICE_CompareInit | ( | XMC_CCU8_SLICE_t *const | slice, |
const XMC_CCU8_SLICE_COMPARE_CONFIG_t *const | compare_init | ||
) |
- Parameters
-
slice Constant pointer to CC8 Slice compare_init Pointer to slice configuration structure
- Returns
None
- Description:
- Initialization of a CC8 slice to compare mode, by configuring CC8yTC, CC8yCMC, CC8yPSC, CC8yDITH, CC8yPSL, CC8yFPCS, CC8yCHC registers.
CC8 slice is configured with Timer configurations in this routine. Timer is stopped before initialization by calling XMC_CCU8_SLICE_StopTimer(). After initialization user has to explicitly enable the shadow transfer for the required values by calling XMC_CCU8_EnableShadowTransfer() with appropriate mask.
- Related APIs:
- None.
void XMC_CCU8_SLICE_ConfigureDeadTime | ( | XMC_CCU8_SLICE_t *const | slice, |
const uint8_t | mask | ||
) |
- Parameters
-
slice Constant pointer to CC8 Slice mask The Dead Time configuration mask. Do a bitwise OR operation on the following values depending on the need. Value 0x1: Dead Time Enable for Compare Channel 1 Value 0x2: Dead Time Enable for Compare Channel 2 Value 0x4: Dead Time Enable for CC8yST1 path is enabled. Value 0x8: Dead Time Enable for Inverted CC8yST1 path is enabled. Value 0x10: Dead Time Enable for CC8yST2 path is enabled. Value 0x20: Dead Time Enable for Inverted CC8yST2 path is enabled. Range: [0x0 to 0x3F]
- Description:
- Activates or deactivates dead time for compare channel and ST path, by configuring CC8y.DC1R, CC8y.DC1R and CC8y.DTC registers.
Use the provided masks to enable/disable the dead time for the compare channels and the ST signals. It is possible to deactivate the dead time for all the options by passing a 0x0 as the mask. Details such as the choice of dead time for channel1, channel2, ST1, Inverted ST1, ST2, Inverted ST2, are programmed by this routine.
void XMC_CCU8_SLICE_ConfigureEvent | ( | XMC_CCU8_SLICE_t *const | slice, |
const XMC_CCU8_SLICE_EVENT_t | event, | ||
const XMC_CCU8_SLICE_EVENT_CONFIG_t * | config | ||
) |
- Parameters
-
slice Constant pointer to CC8 Slice event The External Event which needs to be configured. config Pointer to event configuration data.
- Returns
None
- Description:
- Configures an External Event of the slice, by updating CC8yINS 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_CCU8_SLICE_StartConfig()
XMC_CCU8_SLICE_StopConfig()
XMC_CCU8_SLICE_LoadConfig()
XMC_CCU8_SLICE_ModulationConfig()
XMC_CCU8_SLICE_CountConfig()
XMC_CCU8_SLICE_GateConfig()
XMC_CCU8_SLICE_Capture0Config()
XMC_CCU8_SLICE_Capture1Config()
XMC_CCU8_SLICE_DirectionConfig()
XMC_CCU8_SLICE_StatusBitOverrideConfig()
XMC_CCU8_SLICE_TrapConfig().
void XMC_CCU8_SLICE_ConfigureStatusBitOutput | ( | XMC_CCU8_SLICE_t *const | slice, |
const XMC_CCU8_SLICE_STATUS_t | channel | ||
) |
- Parameters
-
slice Constant pointer to CC8 Slice channel which channel status has to be give as out
- Returns
None
- Description:
- Configures status ST1, ST2 mapping to STy, by configuring CC8yTC.STOS bits.
This routine defines the output STy as a function of ST1 or ST2 or both ST1 & ST2. It is possible to make the CCU8x.STy signal to reflect the CC8y.ST1/CC8y.ST2 or a function of the 2 signals.
- Related APIs:
- None.
void XMC_CCU8_SLICE_ConfigureStatusBitOverrideEvent | ( | XMC_CCU8_SLICE_t *const | slice, |
const XMC_CCU8_SLICE_EVENT_CONFIG_t *const | ev1_config, | ||
const XMC_CCU8_SLICE_EVENT_CONFIG_t *const | ev2_config | ||
) |
- Parameters
-
slice Constant pointer to CC8 Slice ev1_config Pointer to event 1 configuration data ev2_config Pointer to event 2 configuration data
- Returns
None
- Description:
- Map Status bit override function with an Event1 & Event 2 of the slice and configure CC8yINS 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_CCU8_SLICE_StatusBitOverrideConfig().
void XMC_CCU8_SLICE_CountConfig | ( | XMC_CCU8_SLICE_t *const | slice, |
const XMC_CCU8_SLICE_EVENT_t | event | ||
) |
- Parameters
-
slice Constant pointer to CC8 Slice event Map an External event to the External Count Function
- Returns
None
- Description:
- Configures the Count Function of the slice, by configuring CC8yCMC.CNTS bit.
Count function is mapped with one of the 3 events. CCU8 slice can take an external signal to act as the counting event. The CCU8 slice would count the edges present on the event selected.
- Related APIs:
- XMC_CCU8_SLICE_ConfigureEvent()
XMC_CCU8_SLICE_SetInput().
void XMC_CCU8_SLICE_DeadTimeInit | ( | XMC_CCU8_SLICE_t *const | slice, |
const XMC_CCU8_SLICE_DEAD_TIME_CONFIG_t *const | config | ||
) |
- Parameters
-
slice Constant pointer to CC8 Slice config Pointer to dead time configuration data
- Returns
None
- Description:
- Initializes Dead time configuration for the slice outputs, by configuring CC8yDC1R, CC8yDC2R, CC8yDTC registers.
This routine programs dead time delays (rising & falling) and dead time clock prescaler. Details such as the choice of dead time for channel1, channel2, ST1, Inverted ST1, ST2, Inverted ST2, are also programmed by this routine.
void XMC_CCU8_SLICE_DirectionConfig | ( | XMC_CCU8_SLICE_t *const | slice, |
const XMC_CCU8_SLICE_EVENT_t | event | ||
) |
- Parameters
-
slice Constant pointer to CC8 Slice event Map an External event to the External Count Direction Function
- Returns
None
- Description:
- Configures the Count Direction of the slice, by configuring CC8yCMC.UDS bit.
Count direction function is mapped with one of the 3 events. A slice can be configured to change the CC8yTIMER count direction depending on an external signal.
- Related APIs:
- XMC_CCU8_SLICE_ConfigureEvent()
XMC_CCU8_SLICE_SetInput().
void XMC_CCU8_SLICE_DisableAutomaticShadowTransferRequest | ( | XMC_CCU8_SLICE_t *const | slice, |
const uint32_t | automatic_shadow_transfer | ||
) |
- Parameters
-
slice Constant pointer to CC8 Slice automatic_shadow_transfer specify upon which register update, automatic shadow transfer request should not be generated Use :: XMC_CCU8_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_CCU8_SLICE_EnableAutomaticShadowTransferRequest().
- Note
- Only available for XMC1400 series
void XMC_CCU8_SLICE_DisableCascadedShadowTransfer | ( | XMC_CCU8_SLICE_t *const | slice | ) |
- Parameters
-
slice Constant pointer to CC8 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_CCU8_SLICE_EnableCascadedShadowTransfer()
.
- Note
- Not available for XMC4500 series
void XMC_CCU8_SLICE_DisableDithering | ( | XMC_CCU8_SLICE_t *const | slice | ) |
- Parameters
-
slice Constant pointer to CC8 Slice
- Returns
None
- Description:
- Disables dithering of PWM frequency and duty cycle, by clearing CC8yTC.DITHE bits.
This disables the Dither mode that was set in XMC_CCU8_SLICE_EnableDithering(). This API will not clear the dither compare value.
- Related APIs:
- XMC_CCU8_SLICE_EnableDithering().
void XMC_CCU8_SLICE_DisableEvent | ( | XMC_CCU8_SLICE_t *const | slice, |
const XMC_CCU8_SLICE_IRQ_ID_t | event | ||
) |
- Parameters
-
slice Constant pointer to CC8 Slice event Event whose assertion can potentially lead to an interrupt
- Returns
None
- Description:
- Disables the generation of an interrupt pulse for the event, by clearing CC8yINTE register.
Prevents the event from being asserted.
void XMC_CCU8_SLICE_DisableFloatingPrescaler | ( | XMC_CCU8_SLICE_t *const | slice | ) |
- Parameters
-
slice Constant pointer to CC8 Slice
- Returns
None
- Description:
- Disables the floating prescaler, by clearing CC8yTC.FPE bit.
This would return the prescaler to the normal mode. The prescaler that would be applied is the value present in CC8yPSC.
- Related APIs:
- XMC_CCU8_SLICE_EnableFloatingPrescaler().
void XMC_CCU8_SLICE_DisableMultiChannelMode | ( | XMC_CCU8_SLICE_t *const | slice, |
const XMC_CCU8_SLICE_COMPARE_CHANNEL_t | ch_num | ||
) |
- Parameters
-
slice Constant pointer to CC8 Slice ch_num Compare channel for which the multi-channel mode needs to be disabled.
- Returns
None
- Description:
- Disables the multichannel mode, by clearing CC8yTC.MCME1 or CC8yTC.MCME1 bits based on the ch_num.
Returns the slices to the normal operation mode. This takes the slice number as input and configures the multi channel mode for it.
- Related APIs:
- XMC_CCU8_SLICE_EnableMultiChannelMode().
void XMC_CCU8_SLICE_DisableMultipleEvents | ( | XMC_CCU8_SLICE_t *const | slice, |
const uint16_t | mask | ||
) |
- Parameters
-
slice Constant pointer to CC8 Slice mask Event mask such that multiple events can be enabled. Use XMC_CCU8_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 CC8yINTE register.
Prevents selected events of the slice from being asserted.
void XMC_CCU8_SLICE_DisableTrap | ( | XMC_CCU8_SLICE_t *const | slice, |
const uint32_t | out_mask | ||
) |
- Parameters
-
slice Constant pointer to CC8 Slice out_mask Output signals for which the Trap function needs to be deactivated. Use XMC_CCU8_SLICE_OUTPUT_t enum items to create a mask of choice, using a bit wise OR operation. Range: [0x1 to 0xF]
- Returns
None
- Description:
- Disables the trap feature, by clearing CC8yTC.TRAPE0, CC8yTC.TRAPE1, CC8yTC.TRAPE2 and CC8yTC.TRAPE3 bit based on the out_mask.
.
This API will revert the changes done by XMC_CCU8_SLICE_EnableTrap(). This Ensures that the TRAP function has no effect on the output of the CCU8 slice.
- Related APIs:
- XMC_CCU8_SLICE_EnableTrap().
void XMC_CCU8_SLICE_EnableAsymmetricCompareMode | ( | XMC_CCU8_SLICE_t *const | slice | ) |
- Parameters
-
slice Constant pointer to CC8 Slice
- Returns
None
- Description:
- Configures the slice to generate PWM in asymmetric compare mode, by setting CC8yCHC.ASE bit.
In asymmetric compare mode, the compare channels 1 & 2 are grouped to generate the PWM.This would generate an inverted PWM at OUT0 & OUT1. In Edge Aligned mode (counting up), the Status bit is set when a compare match of Compare channel-1 occurs and cleared when a compare match event of Compare channel-2 occurs.
In Center Aligned mode, the status bit is set when a compare match event of Compare channel-1 occurs while counting up and cleared when a compare match event of Compare channel-2 occurs while counting down.
- Note:
- External count direction function is enabled then the asymmetric mode of operation is not possible.
- Related APIs:
- XMC_CCU8_SLICE_EnableSymmetricCompareMode()
void XMC_CCU8_SLICE_EnableAutomaticShadowTransferRequest | ( | XMC_CCU8_SLICE_t *const | slice, |
const uint32_t | automatic_shadow_transfer | ||
) |
- Parameters
-
slice Constant pointer to CC8 Slice automatic_shadow_transfer specify upon which register update, automatic shadow transfer request is generated Use :: XMC_CCU8_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_CCU8_SLICE_DisableAutomaticShadowTransferRequest().
- Note
- Only available for XMC1400 series
void XMC_CCU8_SLICE_EnableCascadedShadowTransfer | ( | XMC_CCU8_SLICE_t *const | slice | ) |
- Parameters
-
slice Constant pointer to CC8 Slice
- Returns
None
- Description:
- Cascades the shadow transfer operation throughout the CCU8 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. CC80 slice is a master to start the operation.
- Note:
- XMC_CCU8_EnableShadowTransfer() must be called to enable the shadow transfer of the all the slices, which needs to be cascaded.
- Note
- Not available for XMC4500 series
void XMC_CCU8_SLICE_EnableDithering | ( | XMC_CCU8_SLICE_t *const | slice, |
const bool | period_dither, | ||
const bool | duty_dither, | ||
const uint8_t | spread | ||
) |
- Parameters
-
slice Constant pointer to CC8 Slice period_dither Boolean instruction on dithering of period match duty_dither Boolean instruction on dithering of compare match spread Dither compare value
- Returns
None
- Description:
- Enables dithering of PWM frequency and duty cycle, by configuring CC8yTC.DITHE and CC8yDITS 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_CCU8_SLICE_SetDitherCompareValue().
- Note:
- After this API call, XMC_CCU8_EnableShadowTransfer() has to be called with appropriate mask to transfer the dither value.
- Related APIs:
- XMC_CCU8_SLICE_DisableDithering().
void XMC_CCU8_SLICE_EnableEvent | ( | XMC_CCU8_SLICE_t *const | slice, |
const XMC_CCU8_SLICE_IRQ_ID_t | event | ||
) |
- Parameters
-
slice Constant pointer to CC8 Slice event Event whose assertion can potentially lead to an interrupt
- Returns
None
- Description:
- Enables the generation of an interrupt pulse for the event, by configuring CC8yINTE 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.
void XMC_CCU8_SLICE_EnableFloatingPrescaler | ( | XMC_CCU8_SLICE_t *const | slice | ) |
- Parameters
-
slice Constant pointer to CC8 Slice
- Returns
None
- Description:
- Enables the floating prescaler, by setting CC8yTC.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_CCU8_SLICE_SetFloatingPrescalerCompareValue()
XMC_CCU8_SLICE_DisableFloatingPrescaler()
XMC_XMC_CCU8_SLICE_SetPrescaler().
void XMC_CCU8_SLICE_EnableMultiChannelMode | ( | XMC_CCU8_SLICE_t *const | slice, |
const XMC_CCU8_SLICE_COMPARE_CHANNEL_t | ch_num | ||
) |
- Parameters
-
slice Constant pointer to CC8 Slice ch_num Compare channel for which the multi-channel mode is needed.
- Returns
None
- Description:
- Enables the multichannel mode, by setting CC8yTC.MCME1 or CC8yTC.MCME1 bits based on the ch_num.
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.
void XMC_CCU8_SLICE_EnableMultipleEvents | ( | XMC_CCU8_SLICE_t *const | slice, |
const uint16_t | mask | ||
) |
- Parameters
-
slice Constant pointer to CC8 Slice mask Event mask such that multiple events can be enabled. Use XMC_CCU8_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 CC8yINTE 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.
void XMC_CCU8_SLICE_EnableSymmetricCompareMode | ( | XMC_CCU8_SLICE_t *const | slice | ) |
- Parameters
-
slice Constant pointer to CC8 Slice
- Returns
None
- Description:
- Configures the slice to generate PWM in symmetric(standard) compare mode, by clearing CC8yCHC.ASE bit.
In symmetric compare mode, the compare channels 1 & 2 are independent of each other & each channel generates the PWM & inverted PWM at OUT0, OUT1, OUT2 & OUT3.
- Related APIs:
- XMC_CCU8_SLICE_EnableAsymmetricCompareMode().
void XMC_CCU8_SLICE_EnableTrap | ( | XMC_CCU8_SLICE_t *const | slice, |
const uint32_t | out_mask | ||
) |
- Parameters
-
slice Constant pointer to CC8 Slice out_mask Output signals for which the Trap function needs to be activated. Use XMC_CCU8_SLICE_OUTPUT_t enum items to create a mask of choice, using a bit wise OR operation Range: [0x1 to 0xF]
- Returns
None
- Description:
- Enables the trap feature, by setting CC8yTC.TRAPE0, CC8yTC.TRAPE1, CC8yTC.TRAPE2 and CC8yTC.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.
void XMC_CCU8_SLICE_GateConfig | ( | XMC_CCU8_SLICE_t *const | slice, |
const XMC_CCU8_SLICE_EVENT_t | event | ||
) |
- Parameters
-
slice Constant pointer to CC8 Slice event Map an External event to the External Gating Function
- Returns
None
- Description:
- Configures the Gating Function of the slice, by configuring CC8yCMC.GATES bit.
Gating function is mapped with one of the 3 events. A CCU8 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_CCU8_SLICE_ConfigureEvent()
XMC_CCU8_SLICE_SetInput().
uint32_t XMC_CCU8_SLICE_GetCapturedValueFromFifo | ( | const XMC_CCU8_SLICE_t *const | slice, |
const XMC_CCU8_SLICE_CAP_REG_SET_t | set | ||
) |
- Parameters
-
slice Constant pointer to CC8 Slice set The 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(CC8yECRD0 and CC8yECRD1).
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_CCU8_SLICE_IsExtendedCapReadEnabled().
- Note
- Defined for XMC4800, XMC4700, XMC4500, XMC4400, XMC4200, XMC4100 devices only. For other devices use XMC_CCU8_GetCapturedValueFromFifo() API
uint32_t XMC_CCU8_SLICE_GetCaptureRegisterValue | ( | const XMC_CCU8_SLICE_t *const | slice, |
const uint8_t | reg_num | ||
) |
- Parameters
-
slice Constant pointer to CC8 Slice reg_num The 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 CC8yCV[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_CCU8_SLICE_GetLastCapturedTimerValue().
XMC_CCU8_SLICE_TIMER_COUNT_DIR_t XMC_CCU8_SLICE_GetCountingDir | ( | const XMC_CCU8_SLICE_t *const | slice | ) |
- Parameters
-
slice Constant pointer to CC8 Slice
- Returns
XMC_CCU8_SLICE_TIMER_COUNT_DIR_t returns the direction in which the timer is counting.
- Description:
- Returns the timer counting direction, by reading CC8yTCST.CDIR bit.
This API will return the direction in which the timer is currently incrementing(XMC_CCU8_SLICE_TIMER_COUNT_DIR_UP) or decrementing (XMC_CCU8_SLICE_TIMER_COUNT_DIR_DOWN).
- Related APIs:
- None.
bool XMC_CCU8_SLICE_GetEvent | ( | const XMC_CCU8_SLICE_t *const | slice, |
const XMC_CCU8_SLICE_IRQ_ID_t | event | ||
) |
- Parameters
-
slice Constant pointer to CC8 Slice event Event 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 CC8yINTS 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_CCU8_SLICE_EnableEvent()
XMC_CCU8_SLICE_SetEvent().
XMC_CCU8_STATUS_t XMC_CCU8_SLICE_GetLastCapturedTimerValue | ( | const XMC_CCU8_SLICE_t *const | slice, |
const XMC_CCU8_SLICE_CAP_REG_SET_t | set, | ||
uint32_t * | val_ptr | ||
) |
- Parameters
-
slice Constant pointer to CC8 Slice set The capture register set, which must be evaluated val_ptr Out Parameter of the API.Stores the captured timer value into this out parameter.
- Returns
XMC_CCU8_STATUS_t Returns XMC_CCU8_STATUS_OK if there was new value present in the capture registers. returns XMC_CCU8_STATUS_ERROR if there was no new value present in the capture registers.
- Description:
- Retrieves the latest captured timer value, by reading CC8yCV 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 8 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_CCU8_SLICE_GetCaptureregisterValue().
XMC_CCU8_SLICE_MODE_t XMC_CCU8_SLICE_GetSliceMode | ( | const XMC_CCU8_SLICE_t *const | slice | ) |
- Parameters
-
slice Constant pointer to CC8 Slice
- Returns
XMC_CCU8_SLICE_MODE_t returns XMC_CCU8_SLICE_MODE_COMPARE if the slice is operating in compare mode returns XMC_CCU8_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 CC8yTC.CMOD bit.
Ensure that before invoking this API the CCU8 slice should be configured otherwise the output of this API is invalid.
- Related APIs:
- None.
uint16_t XMC_CCU8_SLICE_GetTimerCompareMatch | ( | const XMC_CCU8_SLICE_t *const | slice, |
const XMC_CCU8_SLICE_COMPARE_CHANNEL_t | channel | ||
) |
- Parameters
-
slice Constant pointer to CC8 Slice channel Select the compare channel to retrieve from.
- Returns
uint16_t returns the current timer compare value Range: [0x0 to 0xFFFF]
- Description:
- Retrieves the timer compare value currently effective, by reading CC8yCR1S and CC8yCR2S registers.
If the timer is active then the value being returned is currently being for the PWM duty cycle( timer compare value).
- Note:
- The XMC_CCU8_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_CCU8_SLICE_GetTimerCompareMatch() would not reflect the new values until the shadow transfer completes.
- Related APIs:
- XMC_CCU8_SLICE_SetTimerCompareMatch().
XMC_CCU8_SLICE_TIMER_COUNT_MODE_t XMC_CCU8_SLICE_GetTimerCountingMode | ( | const XMC_CCU8_SLICE_t *const | slice | ) |
- Parameters
-
slice Constant pointer to CC8 Slice
- Returns
XMC_CCU8_SLICE_TIMER_COUNT_MODE_t returns XMC_CCU8_SLICE_TIMER_COUNT_MODE_EA if edge aligned mode is selected returns XMC_CCU8_SLICE_TIMER_COUNT_MODE_CA if center aligned mode is selected
- Description:
- Retrieves timer counting mode either Edge aligned or Center Aligned, by reading CC8yTC.TCM bit.
- Related APIs:
- XMC_CCU8_SLICE_SetTimerCountingMode().
uint16_t XMC_CCU8_SLICE_GetTimerPeriodMatch | ( | const XMC_CCU8_SLICE_t *const | slice | ) |
- Parameters
-
slice Constant pointer to CC8 Slice
- Returns
uint16_t returns the current timer period value Range: [0x0 to 0xFFFF]
- Description:
- Retrieves the timer period value currently effective, by reading CC8yPR register.
If the timer is active then the value being returned is currently being used for the PWM period.
- Note:
- The XMC_CCU8_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_CCU8_SLICE_GetTimerPeriodMatch() would not reflect the new values until the shadow transfer completes.
- Related APIs:
- XMC_CCU8_SLICE_SetTimerPeriodMatch().
XMC_CCU8_SLICE_TIMER_REPEAT_MODE_t XMC_CCU8_SLICE_GetTimerRepeatMode | ( | const XMC_CCU8_SLICE_t *const | slice | ) |
- Parameters
-
slice Constant pointer to CC8 Slice
- Returns
XMC_CCU8_SLICE_TIMER_REPEAT_MODE_t returns XMC_CCU8_SLICE_TIMER_REPEAT_MODE_REPEAT if continuous mode is selected returns XMC_CCU8_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 CC8yTC.TSSM bit.
The timer will count upto 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_CCU8_SLICE_SetTimerRepeatMode().
uint16_t XMC_CCU8_SLICE_GetTimerValue | ( | const XMC_CCU8_SLICE_t *const | slice | ) |
- Parameters
-
slice Constant pointer to CC8 Slice
- Returns
uint16_t returns the current timer value Range: [0x0 to 0xFFFF]
- Description:
- Retrieves the latest timer value, from CC8yTIMER register.
- Related APIs:
- XMC_CCU8_SLICE_SetTimerValue().
bool XMC_CCU8_SLICE_IsDeadTimeCntr1Running | ( | const XMC_CCU8_SLICE_t *const | slice | ) |
- Parameters
-
slice Pointer to an instance of CC8 slice
- Returns
bool returns true if the dead time counter of Compare channel-1 is running else it returns false.
- Description:
- Returns the state of the Dead time counter 1 (Either Running or stopped(idle)), by reading CC8yTCST.DTR1 bit. This returns the state of the dead time counter which is linked to Compare channel-1.
- Related APIs:
- XMC_CCU8_SLICE_IsDeadTimeCntr2Running().
bool XMC_CCU8_SLICE_IsDeadTimeCntr2Running | ( | const XMC_CCU8_SLICE_t *const | slice | ) |
- Parameters
-
slice Pointer to an instance of CC8 slice
- Returns
bool returns true if the dead time counter of Compare channel-2 is running else it returns false.
- Description:
- Returns the state of the Dead time counter 2 (Either Running or stopped(idle)), by reading CC8yTCST.DTR2 bit. This returns the state of the dead time counter which is linked to Compare channel-2.
- Related APIs:
- XMC_CCU8_SLICE_IsDeadTimeCntr1Running().
bool XMC_CCU8_SLICE_IsExtendedCapReadEnabled | ( | const XMC_CCU8_SLICE_t *const | slice | ) |
- Parameters
-
slice Constant pointer to CC8 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 CC8yTC.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_CCU8_GetCapturedValueFromFifo().
bool XMC_CCU8_SLICE_IsTimerRunning | ( | const XMC_CCU8_SLICE_t *const | slice | ) |
- Parameters
-
slice Constant pointer to CC8 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 CC8yTCST.TRB bit.
- Related APIs:
- XMC_CCU8_SLICE_StartTimer()
XMC_CCU8_SLICE_StopTimer().
void XMC_CCU8_SLICE_LoadConfig | ( | XMC_CCU8_SLICE_t *const | slice, |
const XMC_CCU8_SLICE_EVENT_t | event | ||
) |
- Parameters
-
slice Constant pointer to CC8 Slice event Map an External event to the External load Function
- Returns
None
- Description:
- Configures the Load Function for the slice, by configuring CC8yCMC.LDS bit.
Load function is mapped with one of the 3 events. Up on occurrence of the event,
if CC8yTCST.CDIR set to 0,CC8yTIMER register is reloaded with the value from compare channel 1 or compare channel 2
if CC8yTCST.CDIR set to 1,CC8yTIMER register is reloaded with the value from period register
- Related APIs:
- XMC_CCU8_SLICE_ConfigureEvent()
XMC_CCU8_SLICE_SetInput().
void XMC_CCU8_SLICE_LoadSelector | ( | XMC_CCU8_SLICE_t *const | slice, |
const XMC_CCU8_SLICE_COMPARE_CHANNEL_t | ch_num | ||
) |
- Parameters
-
slice Constant pointer to CC8 Slice ch_num Select which compare channel value has to be loaded to the Timer register during external load event.
- Returns
None
- Description:
- Up on occurrence of the external load event, if CC8yTCST.CDIR set to 0, CC8yTIMER register can be reloaded
with the value from compare channel 1 or compare channel 2
If CC8yTC.TLS is 0, compare channel 1 value is loaded to the CC8yTIMER register
If CC8yTC.TLS is 1, compare channel 2 value is loaded to the CC8yTIMER register
- Related APIs:
- XMC_CCU8_SLICE_ConfigureEvent()
XMC_CCU8_SLICE_SetInput().
void XMC_CCU8_SLICE_ModulationConfig | ( | XMC_CCU8_SLICE_t *const | slice, |
const XMC_CCU8_SLICE_EVENT_t | event, | ||
const XMC_CCU8_SLICE_MODULATION_MODE_t | mod_mode, | ||
const XMC_CCU8_SLICE_MODULATION_CHANNEL_t | channel, | ||
const bool | synch_with_pwm | ||
) |
- Parameters
-
slice Constant pointer to CC8 Slice event Map an External event to the External Modulation Function mod_mode Desired Modulation mode channel Specify the channel(s) on which the modulation should be applied. synch_with_pwm Option 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 CC8yCMC.MOS, CC8yTC.EMT and CC8yTC.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_CCU8_SLICE_ConfigureEvent()
XMC_CCU8_SLICE_SetInput().
void XMC_CCU8_SLICE_SetDeadTimePrescaler | ( | XMC_CCU8_SLICE_t *const | slice, |
const XMC_CCU8_SLICE_DTC_DIV_t | div_val | ||
) |
- Parameters
-
slice Pointer to an instance of CC8 slice div_val Prescaler divider value
- Returns
None
- Description:
- Configures clock division factor for dead time generator, by configuring CC8yDTC.DTCC bit. The Clock divider works on the timer clock. It is possible to scale the timer clock for the dead time generator by a factor of 1/2/4/8. This selection is passed as an argument to the API.
void XMC_CCU8_SLICE_SetDeadTimeValue | ( | XMC_CCU8_SLICE_t *const | slice, |
const XMC_CCU8_SLICE_COMPARE_CHANNEL_t | channel, | ||
const uint8_t | rise_value, | ||
const uint8_t | fall_value | ||
) |
- Parameters
-
slice Constant pointer to CC8 Slice channel Compare channel number rise_value Programs rising edge delay Range: [0x0 to 0xFF] fall_value Programs falling edge delay Range: [0x0 to 0xFF]
- Returns
None
- Description:
- Configures the dead time for rising and falling edges, by updating CC8y.DC1R, CC8y.DC1R registers.
This API will Configure the delay that is need either when the value changes from 0 to 1 (rising edge) or value changes from 1 to 0(falling edge). Directly accessed registers are CC8yDC1R, CC8yDC2R.
void XMC_CCU8_SLICE_SetDitherCompareValue | ( | XMC_CCU8_SLICE_t *const | slice, |
const uint8_t | comp_val | ||
) |
- Parameters
-
slice Constant pointer to CC8 Slice comp_val Dither compare value Range: [0x0 to 0xF]
- Returns
None
- Description:
- Sets the dither spread/compare value, by setting CC8yDITS.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_CCU8_EnableShadowTransfer() has to be called with appropriate mask.
- Related APIs:
- XMC_CCU8_SLICE_EnableDithering().
void XMC_CCU8_SLICE_SetEvent | ( | XMC_CCU8_SLICE_t *const | slice, |
const XMC_CCU8_SLICE_IRQ_ID_t | event | ||
) |
- Parameters
-
slice Constant pointer to CC8 Slice event Event whose assertion can potentially lead to an interrupt
- Returns
None
- Description:
- Manually asserts the requested event, by setting CC8ySWS 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.
void XMC_CCU8_SLICE_SetFloatingPrescalerCompareValue | ( | XMC_CCU8_SLICE_t *const | slice, |
const uint8_t | cmp_val | ||
) |
- Parameters
-
slice Constant pointer to CC8 Slice cmp_val Prescaler divider compare value Range: [0x0 to 0xF]
- Returns
None
- Description:
- Programs the slice specific prescaler divider compare value, by configuring CC8yFPCS 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_CCU8_EnableShadowTransfer() has to be called with appropriate mask.
- Related APIs:
- XMC_CCU8_SLICE_SetPrescaler().
void XMC_CCU8_SLICE_SetInput | ( | XMC_CCU8_SLICE_t *const | slice, |
const XMC_CCU8_SLICE_EVENT_t | event, | ||
const XMC_CCU8_SLICE_INPUT_t | input | ||
) |
- Parameters
-
slice Constant pointer to CC8 Slice event The External Event which needs to be configured. input One of the 16 inputs meant to be mapped to the desired event
- Returns
None
- Description:
- Selects an input for an external event, by configuring CC8yINS register.
It is possible to select one of the possible 16 input signals for a given Event. This configures the CC8yINS.EVxIS for the selected event.
- Related APIs:
- XMC_CCU8_SLICE_StartConfig()
XMC_CCU8_SLICE_StopConfig()
XMC_CCU8_SLICE_LoadConfig()
XMC_CCU8_SLICE_ModulationConfig()
XMC_CCU8_SLICE_CountConfig()
XMC_CCU8_SLICE_GateConfig()
XMC_CCU8_SLICE_Capture0Config()
XMC_CCU8_SLICE_Capture1Config()
XMC_CCU8_SLICE_DirectionConfig()
XMC_CCU8_SLICE_StatusBitOverrideConfig()
XMC_CCU8_SLICE_TrapConfig().
void XMC_CCU8_SLICE_SetInterruptNode | ( | XMC_CCU8_SLICE_t *const | slice, |
const XMC_CCU8_SLICE_IRQ_ID_t | event, | ||
const XMC_CCU8_SLICE_SR_ID_t | sr | ||
) |
- Parameters
-
slice Constant pointer to CC8 Slice event Event which must be bound to a service request line sr The Service request line which is bound to the event
- Returns
None
- Description:
- Binds requested event to a service request line, by configuring CC8ySRS 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_CCU8_SLICE_EnableEvent()
XMC_CCU8_SLICE_SetEvent().
void XMC_CCU8_SLICE_SetOutPath | ( | XMC_CCU8_SLICE_t *const | slice, |
const uint32_t | out_path_msk | ||
) |
- Parameters
-
slice Constant pointer to CC8 Slice out_path_msk configuration for output path selection. combination of XMC_CCU8_OUT_PATH_t enum items can be used to create a mask.
- Returns
None
- Description:
- Configure the out the path of the two compare channels with specified ST signal, by configuring the ^ CC8yCHC register.
For the two compare channels it is possible to select either direct ST signal or inverted ST signal. out_path_msk is used to set the required out put path.
- Related APIs:
- None
void XMC_CCU8_SLICE_SetPassiveLevel | ( | XMC_CCU8_SLICE_t *const | slice, |
const XMC_CCU8_SLICE_OUTPUT_t | out, | ||
const XMC_CCU8_SLICE_OUTPUT_PASSIVE_LEVEL_t | level | ||
) |
- Parameters
-
slice Constant pointer to CC8 Slice out Output signal for which the passive level needs to be set. level Output passive level for the out signal
- Returns
None
- Description:
- Configures the passive level for the slice output, by setting CC8yPSL 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_CCU8_SLICE_EnableEvent()
XMC_CCU8_SLICE_SetEvent().
void XMC_CCU8_SLICE_SetPrescaler | ( | XMC_CCU8_SLICE_t *const | slice, |
const XMC_CCU8_SLICE_PRESCALER_t | div_val | ||
) |
- Parameters
-
slice Constant pointer to CC8 Slice div_val Prescaler divider value. Accepts enum :: XMC_CCU8_SLICE_PRESCALER_t Range: [0x0 to 0xF]
- Returns
None
- Description:
- Programs the slice specific prescaler divider, by configuring the CC8yPSC and CC8yFPC registers.
The prescaler divider may only be programmed after the prescaler run bit has been cleared by calling XMC_CCU8_StopPrescaler().
- Related APIs:
- XMC_CCU8_SLICE_SetFloatingPrescalerCompareValue().
void XMC_CCU8_SLICE_SetShadowTransferMode | ( | XMC_CCU8_SLICE_t *const | slice, |
const XMC_CCU8_SLICE_SHADOW_TRANSFER_MODE_t | shadow_transfer_mode | ||
) |
- Parameters
-
slice Constant pointer to CC8 Slice shadow_transfer_mode mode to be configured Use :: XMC_CCU8_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_CCU8_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_CCU8_EnableShadowTransfer()
- Note
- Not available for XMC4500 series
void XMC_CCU8_SLICE_SetTimerCompareMatch | ( | XMC_CCU8_SLICE_t *const | slice, |
const XMC_CCU8_SLICE_COMPARE_CHANNEL_t | channel, | ||
const uint16_t | compare_val | ||
) |
- Parameters
-
slice Constant pointer to CC8 Slice channel Select the compare channel to which the compare_val has to programmed. compare_val Timer compare value
- Returns
None
- Description:
- Programs the timer compare value, by writing CC8yCR1S and CC8yCR2S registers.
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_CCU8_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_CCU8_EnableShadowTransfer().
void XMC_CCU8_SLICE_SetTimerCompareMatchChannel1 | ( | XMC_CCU8_SLICE_t *const | slice, |
const uint16_t | compare_val | ||
) |
- Parameters
-
slice Constant pointer to CC8 Slice compare_val Timer compare value
- Returns
None
- Description:
- Programs the timer compare1 value, by writing CC8yCR1S 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_CCU8_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_CCU8_EnableShadowTransfer().
void XMC_CCU8_SLICE_SetTimerCompareMatchChannel2 | ( | XMC_CCU8_SLICE_t *const | slice, |
const uint16_t | compare_val | ||
) |
- Parameters
-
slice Constant pointer to CC8 Slice compare_val Timer compare value
- Returns
None
- Description:
- Programs the timer compare2 value, by writing CC8yCR2S 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_CCU8_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_CCU8_EnableShadowTransfer().
void XMC_CCU8_SLICE_SetTimerCountingMode | ( | XMC_CCU8_SLICE_t *const | slice, |
const XMC_CCU8_SLICE_TIMER_COUNT_MODE_t | mode | ||
) |
- Parameters
-
slice Constant pointer to CC8 Slice mode Desired counting mode (Either Edge Aligned or Center Aligned)
- Returns
None
- Description:
- Configures the timer counting mode either Edge Aligned or Center Aligned, by configuring CC8yTC.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_CCU8_SLICE_GetTimerCountingMode().
void XMC_CCU8_SLICE_SetTimerPeriodMatch | ( | XMC_CCU8_SLICE_t *const | slice, |
const uint16_t | period_val | ||
) |
- Parameters
-
slice Constant pointer to CC8 Slice period_val Timer period value Range: [0x0 to 0xFFFF]
- Returns
None
- Description:
- Programs the timer period, by writing CC8yPRS 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_CCU8_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_CCU8_SLICE_GetTimerPeriodMatch().
void XMC_CCU8_SLICE_SetTimerRepeatMode | ( | XMC_CCU8_SLICE_t *const | slice, |
const XMC_CCU8_SLICE_TIMER_REPEAT_MODE_t | mode | ||
) |
- Parameters
-
slice Constant pointer to CC8 Slice mode Desired repetition mode (Either single shot or Continuous)
- Returns
None
- Description:
- Configures the Timer to either Single shot mode or continuous mode, by configuring CC8yTC.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_CCU8_SLICE_GetTimerRepeatMode().
void XMC_CCU8_SLICE_SetTimerValue | ( | XMC_CCU8_SLICE_t *const | slice, |
const uint16_t | timer_val | ||
) |
- Parameters
-
slice Constant pointer to CC8 Slice timer_val The 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 CC8yTIMER register.
- Note:
- Request to load is ignored if the timer is running.
- Related APIs:
- XMC_CCU8_SLICE_GetTimerValue().
void XMC_CCU8_SLICE_StartConfig | ( | XMC_CCU8_SLICE_t *const | slice, |
const XMC_CCU8_SLICE_EVENT_t | event, | ||
const XMC_CCU8_SLICE_START_MODE_t | start_mode | ||
) |
- Parameters
-
slice Constant pointer to CC8 Slice event Map an External event to the External Start Function start_mode Behaviour of slice when the start function is activated
- Returns
None
- Description:
- Configures the Start Function of the slice, by configuring CC8yCMC.ENDS and CC8yTC.ENDM bits.
Start function is mapped with one of the 3 events. An external signal can control when a CC8 timer should start. Additionally, the behaviour of the slice upon activation of the start function is configured as well.
void XMC_CCU8_SLICE_StartTimer | ( | XMC_CCU8_SLICE_t *const | slice | ) |
- Parameters
-
slice Constant pointer to CC8 Slice
- Returns
None
- Description:
- Starts the timer counting operation, by setting CC8yTCSET.TRBS bit.
It is necessary to have configured the CC8 slice before starting its timer. Before the Timer is started ensure that the clock is provided to the slice.
- Related APIs:
- XMC_CCU8_SLICE_StopTimer().
void XMC_CCU8_SLICE_StatusBitOverrideConfig | ( | XMC_CCU8_SLICE_t *const | slice | ) |
- Parameters
-
slice Constant pointer to CC8 Slice
- Returns
None
- Description:
- Configures the status bit override Function of the slice, by configuring CC8yCMC.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 CC8yST1 signal depending on an external signal.
- Related APIs:
- XMC_CCU8_SLICE_ConfigureStatusBitOverrideEvent().
void XMC_CCU8_SLICE_StopClearTimer | ( | XMC_CCU8_SLICE_t *const | slice | ) |
- Parameters
-
slice Constant pointer to CC8 Slice
- Returns
None
- Description:
- Stops and resets the timer count to zero, by setting CC8yTCCLR.TCC and CC8yTCCLR.TRBC bit.
- Related APIs:
- XMC_CCU8_SLICE_StartTimer().
void XMC_CCU8_SLICE_StopConfig | ( | XMC_CCU8_SLICE_t *const | slice, |
const XMC_CCU8_SLICE_EVENT_t | event, | ||
const XMC_CCU8_SLICE_END_MODE_t | end_mode | ||
) |
- Parameters
-
slice Constant pointer to CC8 Slice event Map an External event to the External Stop Function end_mode Behaviour of slice when the stop function is activated
- Returns
None
- Description:
- Configures the Stop function for the slice, by configuring CC8yCMC.STRTS and CC8yTC.STRM bits.
Stop function is mapped with one of the 3 events. An external signal can control when a CCU8 timer should stop. Additionally, the behaviour of the slice upon activation of the stop function is configured as well.
void XMC_CCU8_SLICE_StopTimer | ( | XMC_CCU8_SLICE_t *const | slice | ) |
- Parameters
-
slice Constant pointer to CC8 Slice
- Returns
None
- Description:
- Stops the Timer.
Timer counting operation can be stopped by invoking this API, by setting CC8yTCCLR.TRBC bit.
- Related APIs:
- XMC_CCU8_SLICE_StartTimer().
void XMC_CCU8_SLICE_TrapConfig | ( | XMC_CCU8_SLICE_t *const | slice, |
const XMC_CCU8_SLICE_TRAP_EXIT_MODE_t | exit_mode, | ||
bool | synch_with_pwm | ||
) |
- Parameters
-
slice Constant pointer to CC8 Slice exit_mode How should a previously logged trap state be exited? synch_with_pwm Should exit of trap state be synchronized with PWM cycle start?
- Returns
None
- Description:
- Configures the Trap Function of the slice, by configuring CC8yCMC.TS, CC8yTC.TRPSE, and CC8yTC.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_CCU8_SLICE_ConfigureEvent()
XMC_CCU8_SLICE_SetInput().
void XMC_CCU8_SLICE_WriteCoherentlyWithPWMCycle | ( | XMC_CCU8_SLICE_t *const | slice, |
const uint32_t | coherent_write | ||
) |
- Parameters
-
slice Constant pointer to CC8 Slice coherent_write specifies for what fields this mode has to be applied Use :: XMC_CCU8_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_CCU8_EnableShadowTransfer(), the value which are written in the respective shadow registers get updated according the configuration done using XMC_CCU8_SLICE_SetShadowTransferMode() API.
- Note:
- Note
- Only available for XMC1400 series
void XMC_CCU8_SLICE_WriteImmediateAfterShadowTransfer | ( | XMC_CCU8_SLICE_t *const | slice, |
const uint32_t | immediate_write | ||
) |
- Parameters
-
slice Constant pointer to CC8 Slice immediate_write specifies for what fields this mode has to be applied Use :: XMC_CCU8_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_CCU8_EnableShadowTransfer() the value which are written in the shadow registers get updated to the actual registers immediately.
- Note:
- Related APIs:
- XMC_CCU8_EnableShadowTransfer()
- Note
- Only available for XMC1400 series
void XMC_CCU8_StartPrescaler | ( | XMC_CCU8_MODULE_t *const | module | ) |
- Parameters
-
module Constant pointer to CCU8 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_CCU8_Init() (Mandatory to fully initialize the module).
void XMC_CCU8_StopPrescaler | ( | XMC_CCU8_MODULE_t *const | module | ) |
- Parameters
-
module Constant pointer to CCU8 module
- Returns
None
- Description:
- Stops the prescaler and blocks clocks to the timer slices, by setting GIDLS.CPRB bit.
Clears the run bit of the prescaler. Ensures that the module clock is not supplied to the slices of the module.
Generated on Mon Aug 7 2017 11:33:57 for XMC Peripheral Library for XMC4000 Family by 1.8.11