XMC Peripheral Library for XMC4000 Family
2.1.16
|
Data Structures | |
struct | XMC_HRPWM_CSG_CMP_t |
struct | XMC_HRPWM_CSG_CONFIG_t |
struct | XMC_HRPWM_CSG_DAC_t |
struct | XMC_HRPWM_CSG_INPUT_CONFIG_t |
struct | XMC_HRPWM_CSG_SGEN_t |
struct | XMC_HRPWM_HRC_CONFIG_t |
struct | XMC_HRPWM_HRC_SRC_CONFIG_t |
Typedefs | |
typedef HRPWM0_CSG_Type | XMC_HRPWM_CSG_t |
typedef HRPWM0_HRC_Type | XMC_HRPWM_HRC_t |
typedef HRPWM0_Type | XMC_HRPWM_t |
Enumerations |
Detailed Description
The HRPWM extends the capabilities of the associated Capture/Compare Unit(CCU8), that simplifies the design various of SMPS. It allows easy and fast implementation of control loop, reduced total number of external components, avoid susceptibility to environmental and process variations there by reducing the size of the power supply.
Comparator Slope Generator(CSG)
HRPWM module consists 3 Comparator Slope Generator(CSG) units. Each CSG unit comprised of one High Speed Comparator, a dedicated 10 bit 30 MS/s DAC and one hardware controlled Slope Compensation module.
CSG features include:
-
3 High Speed Comparators, that can be use to compare an external signal against the DAC value
-
3 (30MS/s) 10 bit DAC
-
3 Slope generation blocks, that are used to generate the DAC input value
-
different slope generations schemes, for a flexible and automated DAC voltage generation
-
2 DAC reference values, to allow flexible hysteretic mode control
-
Input multiplexer for the inverting comparator input, allowing several analog inputs to be connected to each comparator and also dynamic input switching.
-
blanking compare mode, to avoid premature switch OFF due to noise
-
a dedicated output per Comparator
-
programmable clock prescaler
-
programmable clock pulse swallower for slope linearization with uneven clock scale
-
different slope generation schemes:
– incrementing mode
– decrementing mode
– triangular mode
-
shadow transfer for one DAC reference value
-
external trigger for the DAC
-
external control for the DAC reference values
-
four dedicated service request lines
High Resolution Channel unit(HRC)
It also has 4 High Resolution Channel unit(HRC) that upgrades 4 compare channels of a Capture/Compare unit (CCU8), enabling generation of PWM with 150ps resolution. ie; the rise time and/or fall time of PWM can be changed in steps of 150ps.
HRC features include:
-
Upgrade up to 4 PWM signals of CCU8 outputs for high resolution positioning.
-
Independent control of PWM set and reset.
-
Delay the PWM rise time in steps of 150ps. This does not insert dead time.
-
Extent the fall time of PWM in steps of 150ps. This does not insert dead time.
-
Dead time insertion on complementary signals
-
Passive level selection on outputs.
Typedef Documentation
typedef HRPWM0_CSG_Type XMC_HRPWM_CSG_t |
Typedef for CSG unit registers data structure
typedef HRPWM0_HRC_Type XMC_HRPWM_HRC_t |
Typedef for HRPWM high resolution channel registers data structure
typedef HRPWM0_Type XMC_HRPWM_t |
Typedef for HRPWM Global registers data structure
Enumeration Type Documentation
enum XMC_HRPWM_CLK_FREQ_t |
HRPWM CSG - Slope Generation clock selection
enum XMC_HRPWM_CSG_CLK_t |
HRPWM CSG - Comparator output filter window
HRPWM CSG - Selection of edge sensitivity
Input list to CSG
HRPWM CSG - IRQ Event Id The enum is used to access the bitfields of registers CSGySRE, CSGySRS, CSGySWS, CSGySWC, CSGyISTAT
HRPWM CSG - Prescaler external start configuration
HRPWM CSG - Prescaler external stop configuration
DAC, Comparator start controls & Comparator clamped state control The enum is used to access the bitfields of registers CSGSETG, CSGCLRG, CSGSTATG
HRPWM CSG - Slope Generation control mode
HRPWM CSG - Slope Generation external start configuration
HRPWM CGS - Slope Generation external stop configuration
HRPWM CSG - Slope step gain
CSG comparator input switch request
enum XMC_HRPWM_CSG_SWSM_t |
HRPWM CSG - Initial DAC start mode
enum XMC_HRPWM_HR_LOGIC_t |
enum XMC_HRPWM_HR_PATH_t |
HRPWM HRC High Resolution mode configuration
Shadow transfer for HRC values The enum is used to access the bitfields of registers HRCSTRG, HRCCTRG, HRCSTSG
HR source selector edge configuration (GSEL)
enum XMC_HRPWM_LR_PATH_t |
HRPWM CSG - DAC shadow transfer values
enum XMC_HRPWM_STATUS_t |
Function Documentation
void XMC_HRPWM_ClampComparatorOutput | ( | XMC_HRPWM_t *const | hrpwm, |
const uint32_t | mask | ||
) |
- Parameters
-
hrpwm Constant pointer to XMC_HRPWM_t, pointing to the HRPWM module base address mask masked values of selected CSG modules. Use the enum type XMC_HRPWM_CSG_RUN_BIT_t to generate the mask.
- Returns
- None
- Description
Set the comparator output to clamp state
Sets the comparator to clamped state via software by setting CSGSETG.SC0P bit. The output of comparator is now not dependent on its inputs pins. The clamped state is defined by comparator output passive level value. Output passive level can be set to high or low.
void XMC_HRPWM_ClearPreScaler | ( | XMC_HRPWM_t *const | hrpwm, |
const uint32_t | mask | ||
) |
- Parameters
-
hrpwm Constant pointer to XMC_HRPWM_t, pointing to the HRPWM module base address mask masked values of selected CSG modules. Use the enum type XMC_HRPWM_CSG_PRESCALER_STATUS_t to generate the mask.
- Returns
- None
- Description
Clears the prescaler registers of DACs selected by mask
Clears the prescaler registers of DACs selected by mask, by setting CSGFCG.PS0CLR bit.
- Related APIs:
- XMC_HRPWM_IsPrescalerRunning()
void XMC_HRPWM_CSG_ClrEventSW | ( | XMC_HRPWM_CSG_t *const | csg, |
XMC_HRPWM_CSG_IRQ_ID_t | event | ||
) |
- Parameters
-
csg Constant pointer to XMC_HRPWM_CSG_t, pointing to the CSG channel base address event Event selected for software trigger.
- Returns
- None
- Description
Cancel software request for selected event
Cancel the Event trigger request performed via software.
void XMC_HRPWM_CSG_DACRefValSwitchingConfig | ( | XMC_HRPWM_CSG_t *const | csg, |
const XMC_HRPWM_CSG_INPUT_CONFIG_t *const | config | ||
) |
- Parameters
-
csg Constant pointer to XMC_HRPWM_CSG_t, pointing to the CSG channel base address config Pointer to configuration structure.
- Returns
- None
- Description
Configure input selection for switching DAC value between DSV1 and DSV2.
Configure the signal used to switch DAC value between DSV1 and DSV2.
It configures the signal source, required edge or level.
void XMC_HRPWM_CSG_DisableEvent | ( | XMC_HRPWM_CSG_t *const | csg, |
XMC_HRPWM_CSG_IRQ_ID_t | event | ||
) |
- Parameters
-
csg Constant pointer to XMC_HRPWM_CSG_t, pointing to the CSG channel base address event Event selected for interrupt.
- Returns
- None
- Description
Disables the interrupt
Disables the selected interrupt request which may be forwarded to service node.
void XMC_HRPWM_CSG_EnableEvent | ( | XMC_HRPWM_CSG_t *const | csg, |
XMC_HRPWM_CSG_IRQ_ID_t | event | ||
) |
- Parameters
-
csg Constant pointer to XMC_HRPWM_CSG_t, pointing to the CSG channel base address event Event selected for interrupt.
- Returns
- None
- Description
Enables the interrupt
Enables the selected interrupt request which may be forwarded to service node. The enabled event may be connected to any of the four service nodes.
uint32_t XMC_HRPWM_CSG_GetEventStatus | ( | XMC_HRPWM_CSG_t *const | csg, |
const uint32_t | mask | ||
) |
- Parameters
-
csg Constant pointer to XMC_HRPWM_CSG_t, pointing to the CSG channel base address mask masked values of selected CSG modules. Use the enum type XMC_HRPWM_CSG_IRQ_ID_t to generate the input.
- Returns
- uint32_t
- Description
Returns the bit encoded status of selected events
Checks the status of selected events. The return value is non-zero is the status is set.
- Related APIs:
- XMC_HRPWM_CSG_EnableEvent()
XMC_HRPWM_CSG_SetSRNode()
void XMC_HRPWM_CSG_Init | ( | XMC_HRPWM_CSG_t *const | csg, |
const XMC_HRPWM_CSG_CONFIG_t *const | config | ||
) |
- Parameters
-
csg Constant pointer to XMC_HRPWM_CSG_t, pointing to the CSG channel base address config Pointer to configuration structure.
- Returns
- None
- Description
Initializes the CSG channel.
This function is used to initialize the CSG channel.
These include:
1) Comparator setup.
2) DAC Configuration.
3) Slope generation configuration.
void XMC_HRPWM_CSG_SelBlankingInput | ( | XMC_HRPWM_CSG_t *const | csg, |
const XMC_HRPWM_CSG_INPUT_CONFIG_t *const | config | ||
) |
- Parameters
-
csg Constant pointer to XMC_HRPWM_CSG_t, pointing to the CSG channel base address config Pointer to configuration structure.
- Returns
- None
- Description
Configures the input signal to blank the comparator output
Configures the input signal that is used as trigger signal to blank the comparator output.
It configures the signal source, required edge or level. The comparator output is blanked and set to passive level.
void XMC_HRPWM_CSG_SelClampingInput | ( | XMC_HRPWM_CSG_t *const | csg, |
const XMC_HRPWM_CSG_INPUT_CONFIG_t *const | config | ||
) |
- Parameters
-
csg Constant pointer to XMC_HRPWM_CSG_t, pointing to the CSG channel base address config Pointer to configuration structure.
- Returns
- None
- Description
Configures the input signal to clamp the comparator output
Configures the input signal that is used as level signal to clamp the comparator output.
It configures the signal source and required level.
void XMC_HRPWM_CSG_SelSlopeGenClkInput | ( | XMC_HRPWM_CSG_t *const | csg, |
const XMC_HRPWM_CSG_CLK_INPUT_t | input_clk | ||
) |
- Parameters
-
csg Constant pointer to XMC_HRPWM_CSG_t, pointing to the CSG channel base address input_clk Clock selection.
- Returns
- None
- Description
Select the clock for slope generation
Selects the clock source used for slope generation.
These are :
module clock
external clock A
external clock B
external clock C
void XMC_HRPWM_CSG_SetCMPInput | ( | XMC_HRPWM_CSG_t *const | csg, |
const XMC_HRPWM_CSG_CMP_INPUT_t | input | ||
) |
- Parameters
-
csg Constant pointer to XMC_HRPWM_CSG_t, pointing to the CSG channel base address input Input to comparator. Use the enum type XMC_HRPWM_CSG_CMP_INPUT_t to generate the input.
- Returns
- None
- Description
Configures the input connection to inverting pin of comparator
Selects the HW pin that gets connected to inverting pin of comparator.
Either CINA or CINB can be set. The non-inverting pin is connected to DAC output.
- Related APIs:
- XMC_HRPWM_GetCMPInput()
void XMC_HRPWM_CSG_SetEventSW | ( | XMC_HRPWM_CSG_t *const | csg, |
XMC_HRPWM_CSG_IRQ_ID_t | event | ||
) |
- Parameters
-
csg Constant pointer to XMC_HRPWM_CSG_t, pointing to the CSG channel base address event Event selected for software trigger.
- Returns
- None
- Description
Software request for selected event
Perform a software request for selected event.This overrides any hardware trigger.
void XMC_HRPWM_CSG_SetSRNode | ( | XMC_HRPWM_CSG_t *const | csg, |
const XMC_HRPWM_CSG_IRQ_ID_t | event, | ||
const XMC_HRPWM_CSG_IRQ_SR_LINE_t | sr | ||
) |
- Parameters
-
csg Constant pointer to XMC_HRPWM_CSG_t, pointing to the CSG channel base address event Event selected for interrupt. sr Service request node.
- Returns
- None
- Description
Connects the interrupt request to serve node
Enables the connection between interrupt request and serve node.
Each event may be connected to any of four service node available. Each event/interrupt needs to be enabled individually.
- Related APIs:
- XMC_HRPWM_CSG_EnableEvent()
XMC_HRPWM_CSG_GetEventStatus()
void XMC_HRPWM_CSG_StartSlopeGenConfig | ( | XMC_HRPWM_CSG_t *const | csg, |
const XMC_HRPWM_CSG_INPUT_CONFIG_t *const | config | ||
) |
- Parameters
-
csg Constant pointer to XMC_HRPWM_CSG_t, pointing to the CSG channel base address config Pointer to configuration structure.
- Returns
- None
- Description
Configures the input signal to start the DAC slope generation
Configures the input signal that is used as trigger signal to start the slope generation.
It configures the signal source, required edge or level.
- Related APIs:
- XMC_HRPWM_CSG_StopSlopeGenConfig()
void XMC_HRPWM_CSG_StopSlopeGenConfig | ( | XMC_HRPWM_CSG_t *const | csg, |
const XMC_HRPWM_CSG_INPUT_CONFIG_t *const | config | ||
) |
- Parameters
-
csg Constant pointer to XMC_HRPWM_CSG_t, pointing to the CSG channel base address config Pointer to configuration structure.
- Returns
- None
- Description
Configures the input signal to stop the DAC slope generation
Configures the input that is used as trigger signal to stop the slope generation.
It configures the signal source, required edge or level.
- Related APIs:
- XMC_HRPWM_CSG_StartSlopeGenConfig()
void XMC_HRPWM_CSG_TriggerDACConvConfig | ( | XMC_HRPWM_CSG_t *const | csg, |
const XMC_HRPWM_CSG_INPUT_CONFIG_t *const | config | ||
) |
- Parameters
-
csg Constant pointer to XMC_HRPWM_CSG_t, pointing to the CSG channel base address config Pointer to configuration structure.
- Returns
- None
- Description
Configures the input signal to trigger the DAC conversion
Configures the input signal that is used as trigger signal to perform the DAC conversion.
It configures the signal source, required edge or level.
This is used when DAC is configured in static mode.
void XMC_HRPWM_CSG_TriggerShadowXferConfig | ( | XMC_HRPWM_CSG_t *const | csg, |
const XMC_HRPWM_CSG_INPUT_CONFIG_t *const | config | ||
) |
- Parameters
-
csg Constant pointer to XMC_HRPWM_CSG_t, pointing to the CSG channel base address config Pointer to configuration structure.
- Returns
- None
- Description
Configure input selection for triggering shadow transfer
Configure the signal used to triggering shadow transfer.
It configures the signal source, required edge or level.
void XMC_HRPWM_CSG_UpdateBlankingValue | ( | XMC_HRPWM_CSG_t *const | csg, |
uint8_t | value | ||
) |
- Parameters
-
csg Constant pointer to XMC_HRPWM_CSG_t, pointing to the CSG channel base address value Value to be written to blanking register.
- Returns
- None
- Description
Updates the BLV register
Updates the blanking register.
Note BLV register does not have shadow register.
void XMC_HRPWM_CSG_UpdateDACPrescaler | ( | XMC_HRPWM_CSG_t *const | csg, |
XMC_HRPWM_CSG_PRESCALER_DIVISION_t | div_value | ||
) |
- Parameters
-
csg Constant pointer to XMC_HRPWM_CSG_t, pointing to the CSG channel base address div_value Prescaler value.
- Returns
- None
- Description
Updates the prescaler value of slope generation
Updates the prescaler value of slope generation by setting SC.PSV The rate of DAC value update is determined by prescaler.
- Related APIs:
- XMC_HRPWM_CSG_UpdateDACStepGain()
void XMC_HRPWM_CSG_UpdateDACRefDSV1 | ( | XMC_HRPWM_CSG_t *const | csg, |
uint32_t | value | ||
) |
- Parameters
-
csg Constant pointer to XMC_HRPWM_CSG_t, pointing to the CSG channel base address value Value to be written to DSV1 shadow register.
- Returns
- None
- Description
Updates the DSV1 shadow register
Update the DSV1 shadow register.
Call the shadow transfer update API. A shadow transfer request in corresponding CCU8 slice may also be required.
void XMC_HRPWM_CSG_UpdateDACRefDSV2 | ( | XMC_HRPWM_CSG_t *const | csg, |
uint32_t | value | ||
) |
- Parameters
-
csg Constant pointer to XMC_HRPWM_CSG_t, pointing to the CSG channel base address value Value to be written to DSV2 register.
- Returns
- None
- Description
Updates the DSV2 register
Updates the DSV2 register.
Note DSV2 register does not have shadow register.
- Related APIs:
- XMC_HRPWM_CSG_UpdateDACRefDSV1()
void XMC_HRPWM_CSG_UpdateDACStepGain | ( | XMC_HRPWM_CSG_t *const | csg, |
XMC_HRPWM_CSG_SLOPE_STEP_GAIN_t | gain | ||
) |
- Parameters
-
csg Constant pointer to XMC_HRPWM_CSG_t, pointing to the CSG channel base address gain Gain value.
- Returns
- None
- Description
Updates the gain value of slope generation
Updates the gain value of slope generation by setting SC.GCFG bits. The value by which DAC increments/decrements is determined by the step gain.
- Related APIs:
- XMC_HRPWM_CSG_UpdateDACPrescaler()
void XMC_HRPWM_CSG_UpdateFilterWindow | ( | XMC_HRPWM_CSG_t *const | csg, |
XMC_HRPWM_CSG_CMP_FILTER_WINDOW_t | window | ||
) |
- Parameters
-
csg Constant pointer to XMC_HRPWM_CSG_t, pointing to the CSG channel base address window Size of filter window.
- Returns
- None
- Description
Updates the filter window size
Updates the filter window size used for pulse swallowing, in slope generation.
This value is used in slope generation when filter window is enabled. A certain no of clock pulses in the filter window are swallowed and applied to slope generation. The pulse swallowed are determined by "Pulse swallow value"
- Related APIs:
- XMC_HRPWM_CSG_UpdatePulseClk()
void XMC_HRPWM_CSG_UpdatePulseClk | ( | XMC_HRPWM_CSG_t *const | csg, |
uint32_t | value | ||
) |
- Parameters
-
csg Constant pointer to XMC_HRPWM_CSG_t, pointing to the CSG channel base address value No of clock pulses to be swallowed in the filter window.
- Returns
- None
- Description
Updates the no of clock pulses to be swallowed in the filter window
Update the pulse swallow value.
This value is used in slope generation when filter window is enabled for slope generation. No of clock pulse swallow is determined by this value.
- Related APIs:
- XMC_HRPWM_CSG_UpdateFilterWindow()
void XMC_HRPWM_DisableBias | ( | XMC_HRPWM_t *const | hrpwm | ) |
- Parameters
-
hrpwm Constant pointer to XMC_HRPWM_t, pointing to the HRPWM module base address
- Returns
- None
- Description
Disables the bias generation
Disables the bias generation of high resolution generation by clearing HRBSC.HRBE bit.
- Related APIs:
- XMC_HRPWM_EnableBias()
void XMC_HRPWM_DisableComparatorShadowTransfer | ( | XMC_HRPWM_t *const | hrpwm, |
uint32_t | mask | ||
) |
- Parameters
-
hrpwm Constant pointer to XMC_HRPWM_t, pointing to the HRPWM module base address mask masked values of selected CSG modules. Use the enum type XMC_HRPWM_SHADOW_TX_DAC_t to generate the mask.
- Returns
- None
- Description
Cancels the shadow transfer of DSV1 and pulse swallow registers
Cancels the shadow transfer of DSV1 and pulse swallow registers by setting CSGTRC.D0SEC bit. The transfer request is canceled. Needs to be called before the next shadow transfer trigger.
void XMC_HRPWM_DisableCsgClock | ( | XMC_HRPWM_t *const | hrpwm, |
const uint32_t | mask | ||
) |
- Parameters
-
hrpwm Constant pointer to XMC_HRPWM_t, pointing to the HRPWM module base address mask masked values of selected CSG modules. Use the enum type XMC_HRPWM_CSG_CLK_t to generate the mask.
- Returns
- None
- Description
Disables the clock of selected CSG subunits
Disables the clock of selected CSG subunits by setting the CSGCFG.C0CD bit.
- Related APIs:
void XMC_HRPWM_DisableGlobalHR | ( | XMC_HRPWM_t *const | hrpwm | ) |
- Parameters
-
hrpwm Constant pointer to XMC_HRPWM_t, pointing to the HRPWM module base address
- Returns
- None
- Description
Disable global high resolution generation
Disables global high resolution generation by clearing GLBANA.GHREN bit.
- Related APIs:
- XMC_HRPWM_EnableGlobalHR()
void XMC_HRPWM_DisableHighResolutionPath | ( | XMC_HRPWM_t *const | hrpwm, |
const uint32_t | mask | ||
) |
- Parameters
-
hrpwm Constant pointer to XMC_HRPWM_t, pointing to the HRPWM module base address mask masked values of selected HRC modules. Use the enum type XMC_HRPWM_HR_PATH_t to generate the mask.
- Returns
- None
- Description
Disables the high resolution path
Disables the high resolution path determined by passed mask value, by clearing HRCCFG.HRC0E bit.
void XMC_HRPWM_DisableHighResolutionShadowTransfer | ( | XMC_HRPWM_t *const | hrpwm, |
const uint32_t | mask | ||
) |
- Parameters
-
hrpwm Constant pointer to XMC_HRPWM_t, pointing to the HRPWM module base address mask masked values of selected HRC modules. Use the enum type XMC_HRPWM_HRC_SHADOW_TX_t to generate the mask.
- Returns
- None
- Description
Disables the high resolution shadow transfer
Disables the high resolution shadow transfer determined by passed mask value, by setting HRCCTRG.H0EC, HRCCTRG.H0DEC bits. It cancels shadow transfer request by XMC_HRPWM_EnableHighResolutionShadowTransfer(), provided the shadow transfer has not occurred.
- Related APIs:
- XMC_HRPWM_EnableHighResolutionShadowTransfer()
void XMC_HRPWM_DisableHRPowerMode | ( | XMC_HRPWM_t *const | hrpwm | ) |
- Parameters
-
hrpwm Constant pointer to XMC_HRPWM_t, pointing to the HRPWM module base address
- Returns
- None
- Description
Turns OFF the power to all HR and LR path
Turns OFF the power to all HR and LR path by clearing HRCCFG.HRCPM bit. This disables all HR and LR paths.
- Related APIs:
- XMC_HRPWM_EnableHRPowerMode()
void XMC_HRPWM_DisableLowResolutionPath | ( | XMC_HRPWM_t *const | hrpwm, |
const uint32_t | mask | ||
) |
- Parameters
-
hrpwm Constant pointer to XMC_HRPWM_t, pointing to the HRPWM module base address mask masked values of selected HRC modules. Use the enum type XMC_HRPWM_LR_PATH_t to generate the mask.
- Returns
- None
- Description
Disables the low resolution path
Disables the low resolution path determined by passed mask value, by clearing HRCCFG.LRC0E bit.
void XMC_HRPWM_EnableBias | ( | XMC_HRPWM_t *const | hrpwm | ) |
- Parameters
-
hrpwm Constant pointer to XMC_HRPWM_t, pointing to the HRPWM module base address
- Returns
- None
- Description
Enables the bias generation
Enables the bias generation of high resolution generation by setting HRBSC.HRBE bit.
- Related APIs:
- XMC_HRPWM_DisableBias()
void XMC_HRPWM_EnableComparatorShadowTransfer | ( | XMC_HRPWM_t *const | hrpwm, |
const uint32_t | mask | ||
) |
- Parameters
-
hrpwm Constant pointer to XMC_HRPWM_t, pointing to the HRPWM module base address mask masked values of selected HRC modules. Use the enum type XMC_HRPWM_SHADOW_TX_DAC_t to generate the mask.
- Returns
- None
- Description
Enables the shadow transfer of DSV1 and pulse swallow registers of DACs selected by mask
Enables the shadow transfer of DSV1 and pulse swallow registers of DACs selected by mask by setting CSGTRG.D0SES bit. The transfer is done at the next shadow transfer trigger.
void XMC_HRPWM_EnableGlobalHR | ( | XMC_HRPWM_t *const | hrpwm | ) |
- Parameters
-
hrpwm Constant pointer to XMC_HRPWM_t, pointing to the HRPWM module base address
- Returns
- None
- Description
Enable global high resolution generation
Enables global high resolution generation by setting GLBANA.GHREN bit.
- Related APIs:
- XMC_HRPWM_DisableGlobalHR()
void XMC_HRPWM_EnableHighResolutionPath | ( | XMC_HRPWM_t *const | hrpwm, |
const uint32_t | mask | ||
) |
- Parameters
-
hrpwm Constant pointer to XMC_HRPWM_t, pointing to the HRPWM module base address mask masked values of selected HRC modules. Use the enum type XMC_HRPWM_HR_PATH_t to generate the mask.
- Returns
- None
- Description
Enables the high resolution path.
Enables the high resolution path determined by passed mask value, by setting HRCCFG.HRC0E bit. By default signals from source selector 0 are linked to HR path and signals from source selector 1 are linked to LR path. This connections can be reversed at runtime, if bit HRCySC.ST is set to 1.
void XMC_HRPWM_EnableHighResolutionShadowTransfer | ( | XMC_HRPWM_t *const | hrpwm, |
const uint32_t | mask | ||
) |
- Parameters
-
hrpwm Constant pointer to XMC_HRPWM_t, pointing to the HRPWM module base address mask masked values of selected HRC modules. Use the enum type XMC_HRPWM_HRC_SHADOW_TX_t to generate the mask.
- Returns
- None
- Description
Enables the high resolution shadow transfer
Enables the high resolution shadow transfer determined by passed mask value, by setting HRCSTRG.H0ES, HRCSTRG.H0DES bits. The input for trigger for shadow transfer needs to be configured correctly.
void XMC_HRPWM_EnableHRPowerMode | ( | XMC_HRPWM_t *const | hrpwm | ) |
- Parameters
-
hrpwm Constant pointer to XMC_HRPWM_t, pointing to the HRPWM module base address
- Returns
- None
- Description
Turns ON the power to all HR and LR path
Turns ON the power to all HR and LR path by setting HRCCFG.HRCPM bit. Enable the HR and LR paths as per requirement by calling following API XMC_HRPWM_EnableHighResolutionPath() and XMC_HRPWM_EnableLowResolutionPath().
void XMC_HRPWM_EnableLowResolutionPath | ( | XMC_HRPWM_t *const | hrpwm, |
const uint32_t | mask | ||
) |
- Parameters
-
hrpwm Constant pointer to XMC_HRPWM_t, pointing to the HRPWM module base address mask masked values of selected HRC modules. Use the enum type XMC_HRPWM_LR_PATH_t to generate the mask.
- Returns
- None
- Description
Enables the low resolution path
Enables the low resolution path determined by passed mask value, by setting HRCCFG.LRC0E bit. By default signals from source selector 0 are linked to HR path and signals from source selector 1 are linked to LR path. This connections can be reversed at runtime, if bit HRCySC.ST is set to 1.
uint32_t XMC_HRPWM_GetCMPInput | ( | XMC_HRPWM_t *const | hrpwm, |
const uint32_t | mask | ||
) |
- Parameters
-
hrpwm Constant pointer to XMC_HRPWM_t, pointing to the HRPWM module base address mask masked values of selected CSG modules. Use the enum type XMC_HRPWM_CSG_SWITCH_CMP_INPUT_t to generate the mask.
- Returns
- uint32_t
- Description
Returns the bit encoded status of HW pin connected to comparator inverting pin
Returns the bit encoded status of HW pin connected to comparator inverting pin by checking CSGTRSG.SW0ST bit. The bit position is set to 1 if CINB is connected, else its CINA.
- Related APIs:
- XMC_HRPWM_CSG_SetCMPInput()
uint32_t XMC_HRPWM_GetComparatorShadowTransferStatus | ( | XMC_HRPWM_t *const | hrpwm | ) |
- Parameters
-
hrpwm Constant pointer to XMC_HRPWM_t, pointing to the HRPWM module base address
- Returns
- uint32_t
- Description
Gets the shadow transfer status of DSV1 and pulse swallow registers of all the DACs
Gets the shadow transfer status of DSV1 and pulse swallow registers of all the DACs by checking the register CSGTRSG The return value is not zero if shadow transfer has been requested, but is still pending completion.
uint32_t XMC_HRPWM_GetHighResolutionShadowTransferStatus | ( | XMC_HRPWM_t *const | hrpwm, |
const uint32_t | mask | ||
) |
- Parameters
-
hrpwm Constant pointer to XMC_HRPWM_t, pointing to the HRPWM module base address mask masked values of selected HRC modules. Use the enum type XMC_HRPWM_HRC_SHADOW_TX_t to generate the mask.
- Returns
- uint32_t
- Description
Returns the shadow transfer request status
Returns the shadow transfer request status, by checking HRCSTSG.H0STE, HRCSTSG.H0DSTE bits. Returns a non zero value if corresponding shadow transfer request has been performed.
- Related APIs:
- XMC_HRPWM_EnableHighResolutionShadowTransfer()
XMC_HRPWM_HR_LOGIC_t XMC_HRPWM_GetHRGenReadyStatus | ( | XMC_HRPWM_t *const | hrpwm | ) |
- Parameters
-
hrpwm Constant pointer to XMC_HRPWM_t, pointing to the HRPWM module base address
- Returns
- XMC_HRPWM_HR_LOGIC_t
- Description
Returns the status of the high resolution logic.
Returns status of the high resolution logic by checking HRGHRS.HRGR bit. The return value should be XMC_HRPWM_HR_LOGIC_WORKING for proper generation of high resolution signal positioning.
uint32_t XMC_HRPWM_GetRunBitStatus | ( | XMC_HRPWM_t *const | hrpwm, |
const uint32_t | mask | ||
) |
- Parameters
-
hrpwm Constant pointer to XMC_HRPWM_t, pointing to the HRPWM module base address mask masked values of selected CSG modules. Use the enum type XMC_HRPWM_CSG_RUN_BIT_t to generate the mask.
- Returns
- uint32_t
- Description
Returns bit encoded status of multiple DACs and Comparators, defined by the mask.
Returns bit encoded status of multiple DACs and Comparators from register CSGSTATG, defined by the mask. The mask is generated by bitwise ORing multiple Enums.
mask = (uint32_t) (XMC_HRPWM_CSG_RUN_BIT_CMP0 | XMC_HRPWM_CSG_RUN_BIT_DAC0 | XMC_HRPWM_CSG_RUN_BIT_CMP0_PSL);
- Related APIs:
- XMC_HRPWM_IsDacRunning()
XMC_HRPWM_IsComparatorClamped()
void XMC_HRPWM_HRC_ConfigSourceSelect0 | ( | XMC_HRPWM_HRC_t *const | hrc, |
const XMC_HRPWM_HRC_SRC_CONFIG_t *const | config | ||
) |
- Parameters
-
hrc Constant pointer to XMC_HRPWM_HRC_t, pointing to the HRC channel base address config Pointer to configuration structure.
- Returns
- None
- Description
Initializes the source 0 of HRC channel.
Initialize the source 0 functionality of HRC channel.
This include:
1) general configuration for source 0 HRC channel.
2) Configuration of which inputs are being used to generate the set and clear for the latch and therefore controlling the generation of the output PWM signal.
3) Configuration for which timer from the Capture/Compare Unit is used for the Source Selector 0 and Source Selector 1.
- Related APIs:
- XMC_HRPWM_HRC_ConfigSourceSelect1()
void XMC_HRPWM_HRC_ConfigSourceSelect1 | ( | XMC_HRPWM_HRC_t *const | hrc, |
const XMC_HRPWM_HRC_SRC_CONFIG_t *const | config | ||
) |
- Parameters
-
hrc Constant pointer to XMC_HRPWM_HRC_t, pointing to the HRC channel base address config Pointer to configuration structure.
- Returns
- None
- Description
Initializes the source 1 of HRC channel.
Initialize the source 1 functionality of HRC channel.
This include:
1) general configuration for source 1 HRC channel.
2) Configuration of which inputs are being used to generate the set and clear for the latch and therefore controlling the generation of the output PWM signal.
3) Configuration for which timer from the Capture/Compare Unit is used for the Source Selector 0 and Source Selector 1.
- Related APIs:
- XMC_HRPWM_HRC_ConfigSourceSelect0()
void XMC_HRPWM_HRC_Init | ( | XMC_HRPWM_HRC_t *const | hrc, |
const XMC_HRPWM_HRC_CONFIG_t *const | config | ||
) |
- Parameters
-
hrc Constant pointer to XMC_HRPWM_HRC_t, pointing to the HRC channel base address config Pointer to configuration structure.
- Returns
- None
- Description
Initializes the HRC channel.
Initializes the HRC channel functionality.
These include:
1) Dead time configuration.
3) Trap Configuration.
4) Shadow transfer configuration.
5) Output inversion configuration.
6) Passive levels of HRC outputs.
void XMC_HRPWM_HRC_Set_HR_Source | ( | XMC_HRPWM_HRC_t *const | hrc, |
XMC_HRPWM_HRC_SOURCE_t | source | ||
) |
- Parameters
-
hrc Constant pointer to XMC_HRPWM_HRC_t, pointing to the HRC channel base address source Source connected to high resolution channel.
- Returns
- None
- Description
Sets the source to high resolution channel
Sets the shadow transfer register deciding the source connected to high resolution channel. This also affects the CCU8 timer used for linking shadow transfer trigger. Call the shadow transfer update API. A shadow transfer request in corresponding CCU8 slice may also be required.
- Related APIs:
- XMC_HRPWM_EnableHighResolutionShadowTransfer()
void XMC_HRPWM_HRC_SetCompare1 | ( | XMC_HRPWM_HRC_t *const | hrc, |
const uint8_t | cr1_value | ||
) |
- Parameters
-
hrc Constant pointer to XMC_HRPWM_HRC_t, pointing to the HRC channel base address cr1_value high resolution positioning value.
- Returns
- None
- Description
Sets the shadow transfer register of high resolution positioning for rising edge
Call the shadow transfer update API for transfer to CR1 register. A shadow transfer request in corresponding CCU8 slice may also be required.
void XMC_HRPWM_HRC_SetCompare2 | ( | XMC_HRPWM_HRC_t *const | hrc, |
const uint8_t | cr2_value | ||
) |
- Parameters
-
hrc Constant pointer to XMC_HRPWM_HRC_t, pointing to the HRC channel base address cr2_value high resolution positioning value.
- Returns
- None
- Description
Sets the shadow transfer register of high resolution positioning for falling edge
Call the shadow transfer update API for transfer to CR2 register. A shadow transfer request in corresponding CCU8 slice may also be required.
void XMC_HRPWM_HRC_SetDeadTimeFalling | ( | XMC_HRPWM_HRC_t *const | hrc, |
uint16_t | dcf_value | ||
) |
- Parameters
-
hrc Constant pointer to XMC_HRPWM_HRC_t, pointing to the HRC channel base address dcf_value Falling edge dead time value.
- Returns
- None
- Description
Sets the shadow transfer register of falling edge dead time.
Call the shadow transfer update API for transfer to DCR register. A shadow transfer request in corresponding CCU8 slice may also be required.
void XMC_HRPWM_HRC_SetDeadTimeRising | ( | XMC_HRPWM_HRC_t *const | hrc, |
uint16_t | dcr_value | ||
) |
- Parameters
-
hrc Constant pointer to XMC_HRPWM_HRC_t, pointing to the HRC channel base address dcr_value Rising edge dead time value.
- Returns
- None
- Description
Sets the shadow transfer register of rising edge dead time.
Call the shadow transfer update API for transfer to DCR register. A shadow transfer request in corresponding CCU8 slice may also be required.
XMC_HRPWM_STATUS_t XMC_HRPWM_Init | ( | XMC_HRPWM_t *const | hrpwm | ) |
- Parameters
-
hrpwm Constant pointer to XMC_HRPWM_t, pointing to the HRPWM module base address
- Returns
- XMC_HRPWM_STATUS_t
- Description
HRPWM Init
This function initializes the HRPWM global registers. It configures the CSG trimming data. This is the first function that needs to be called in initializing HRC or CSG modules.
- Related APIs:
- XMC_SDMMC_TriggerEvent()
uint32_t XMC_HRPWM_IsComparatorClamped | ( | XMC_HRPWM_t *const | hrpwm, |
const uint32_t | mask | ||
) |
- Parameters
-
hrpwm Constant pointer to XMC_HRPWM_t, pointing to the HRPWM module base address mask masked values of selected CSG modules. Use the enum type XMC_HRPWM_CSG_RUN_BIT_t to generate the mask.
- Returns
- uint32_t
- Description
Checks if comparator is in clamped state
Checks if comparator is in clamped state by checking CSGSTATG.PSLS0 bit. Returns bit encoded status if comparator is set to clamped state via software.
bool XMC_HRPWM_IsComparatorRunning | ( | XMC_HRPWM_t *const | hrpwm, |
const uint32_t | mask | ||
) |
- Parameters
-
hrpwm Constant pointer to XMC_HRPWM_t, pointing to the HRPWM module base address mask masked values of selected CSG modules. Use the enum type XMC_HRPWM_CSG_RUN_BIT_t to generate the mask.
- Returns
- bool
- Description
Checks if comparator is enabled
Checks if comparator is enabled by checking CSGSTATG.C0RB bit. Returns true if comparator run bit is set, else returns false.
- Related APIs:
- XMC_HRPWM_StartComparator()
XMC_HRPWM_StopComparator()
uint32_t XMC_HRPWM_IsDacRunning | ( | XMC_HRPWM_t *const | hrpwm, |
const uint32_t | mask | ||
) |
- Parameters
-
hrpwm Constant pointer to XMC_HRPWM_t, pointing to the HRPWM module base address mask masked values of selected CSG modules. Use the enum type XMC_HRPWM_CSG_RUN_BIT_t to generate the mask.
- Returns
- uint32_t
- Description
Checks if CSG DAC is operational
Checks if CSG DAC is operational by checking CSGSTATG.D0RB bit.
- Related APIs:
- XMC_HRPWM_StartDac()
XMC_HRPWM_StopDac()
uint32_t XMC_HRPWM_IsPrescalerRunning | ( | XMC_HRPWM_t *const | hrpwm, |
const uint32_t | mask | ||
) |
- Parameters
-
hrpwm Constant pointer to XMC_HRPWM_t, pointing to the HRPWM module base address mask masked values of selected CSG modules. Use the enum type XMC_HRPWM_CSG_PRESCALER_STATUS_t to generate the mask.
- Returns
- uint32_t
- Description
Checks the prescaler status of DACs selected by mask
Checks the prescaler status of DACs selected by mask, by checking CSGFCG.P0RB bit. Returns the bit encoded status information of prescaler.
- Related APIs:
- XMC_HRPWM_ClearPreScaler()
XMC_HRPWM_StartSlopeGeneration()
bool XMC_HRPWM_IsSlopeGenerationRunning | ( | XMC_HRPWM_t *const | hrpwm, |
const uint32_t | mask | ||
) |
- Parameters
-
hrpwm Constant pointer to XMC_HRPWM_t, pointing to the HRPWM module base address mask masked values of selected CSG modules. Use the enum type XMC_HRPWM_CSG_RUN_BIT_t to generate the mask.
- Returns
- bool
- Description
Checks if Prescaler & slope generation is running
Checks if Prescaler & slope generation is running by checking CSGFSG.S0RB CSGFSG.P0RB bits. The mask is generated by bitwise ORing multiple Enums.
mask = (uint32_t) (XMC_HRPWM_CSG_SLOPE_START_DAC0 | XMC_HRPWM_CSG_PRESCALER_START_CSG0);
void XMC_HRPWM_ModuleClkFreq | ( | XMC_HRPWM_t *const | hrpwm, |
const XMC_HRPWM_CLK_FREQ_t | clk_freq | ||
) |
- Parameters
-
hrpwm Constant pointer to XMC_HRPWM_t, pointing to the HRPWM module base address clk_freq The operating clock frequency of HRPWM module. Use the enum type XMC_HRPWM_CLK_FREQ_t to generate the mask.
- Returns
- None
- Description
Configures the clock frequency of operation of HRPWM module
Configures the clock frequency of operation of HRPWM module by configuring HRCCFG.CLKC bits. The clock is generally selected based on the device type selected.
void XMC_HRPWM_SetCsgPowerMode | ( | XMC_HRPWM_t *const | hrpwm, |
const XMC_HRPWM_CSG_SLICE_t | slice, | ||
const XMC_HRPWM_CSG_POWER_MODE_t | power_mode | ||
) |
- Parameters
-
hrpwm Constant pointer to XMC_HRPWM_t, pointing to the HRPWM module base address slice Slice NO. power_mode The mode to be put in.
- Returns
- None
- Description
Sets the DAC in OFF, Low speed or High speed mode
Sets the DAC in OFF, Low speed or High speed mode, by setting CSGCFG.C0PM bits.
- Related APIs:
void XMC_HRPWM_StartComparator | ( | XMC_HRPWM_t *const | hrpwm, |
const uint32_t | mask | ||
) |
- Parameters
-
hrpwm Constant pointer to XMC_HRPWM_t, pointing to the HRPWM module base address mask masked values of selected CSG modules. Use the enum type XMC_HRPWM_CSG_RUN_BIT_t to generate the mask.
- Returns
- None
- Description
Enables the operation of comparator
Enables the operation of comparator by setting CSGSETG.SC0R bit.
- Related APIs:
- XMC_HRPWM_StopComparator()
XMC_HRPWM_IsComparatorRunning()
void XMC_HRPWM_StartDac | ( | XMC_HRPWM_t *const | hrpwm, |
const uint32_t | mask | ||
) |
- Parameters
-
hrpwm Constant pointer to XMC_HRPWM_t, pointing to the HRPWM module base address mask masked values of selected CSG modules. Use the enum type XMC_HRPWM_CSG_RUN_BIT_t to generate the mask.
- Returns
- None
- Description
Enables the operation of CSG DAC
Enables the operation of CSG DAC by setting CSGSETG.SD0R bit. The DAC operation is enabled. Either the value in DSV1 or DSV2 is sent to DAC, based on configuration.
- Related APIs:
- XMC_HRPWM_StopDac()
XMC_HRPWM_IsDacRunning()
void XMC_HRPWM_StartSlopeGeneration | ( | XMC_HRPWM_t *const | hrpwm, |
const uint32_t | mask | ||
) |
- Parameters
-
hrpwm Constant pointer to XMC_HRPWM_t, pointing to the HRPWM module base address mask masked values of selected CSG modules. Use the enum type XMC_HRPWM_CSG_RUN_BIT_t to generate the mask.
- Returns
- None
- Description
Start the prescaler & slope generation of DAC
Start the prescaler & slope generation of DAC by setting CSGFCG.S0STR and CSGFCG.PS0STR bits. The mask is generated by bitwise ORing multiple Enums.
mask = (uint32_t) (XMC_HRPWM_CSG_SLOPE_START_DAC0 | XMC_HRPWM_CSG_PRESCALER_START_CSG0);
void XMC_HRPWM_StopComparator | ( | XMC_HRPWM_t *const | hrpwm, |
const uint32_t | mask | ||
) |
- Parameters
-
hrpwm Constant pointer to XMC_HRPWM_t, pointing to the HRPWM module base address mask masked values of selected CSG modules. Use the enum type XMC_HRPWM_CSG_RUN_BIT_t to generate the mask.
- Returns
- None
- Description
Disables the operation of comparator
Disables the operation of comparator by setting CSGCLRG.CC0R bit.
- Related APIs:
- XMC_HRPWM_StartComparator()
XMC_HRPWM_IsComparatorRunning()
void XMC_HRPWM_StopDac | ( | XMC_HRPWM_t *const | hrpwm, |
const uint32_t | mask | ||
) |
- Parameters
-
hrpwm Constant pointer to XMC_HRPWM_t, pointing to the HRPWM module base address mask masked values of selected CSG modules. Use the enum type XMC_HRPWM_CSG_RUN_BIT_t to generate the mask.
- Returns
- None
- Description
Disables the operation of CSG DAC
Disables the operation of CSG DAC by setting CSGCLRG.CD0R bit.
- Related APIs:
- XMC_HRPWM_StartDac()
XMC_HRPWM_IsDacRunning()
void XMC_HRPWM_StopSlopeGeneration | ( | XMC_HRPWM_t *const | hrpwm, |
const uint32_t | mask | ||
) |
- Parameters
-
hrpwm Constant pointer to XMC_HRPWM_t, pointing to the HRPWM module base address mask masked values of selected CSG modules. Use the enum type XMC_HRPWM_CSG_RUN_BIT_t to generate the mask.
- Returns
- None
- Description
Stops the prescaler & slope generation of DAC
Stops the prescaler & slope generation of DAC by setting CSGFCG.S0STP and CSGFCG.PS0STP bits. The mask is generated by bitwise ORing multiple Enums.
mask = (uint32_t) (XMC_HRPWM_CSG_SLOPE_START_DAC0 | XMC_HRPWM_CSG_PRESCALER_START_CSG0);
void XMC_HRPWM_UnClampComparatorOutput | ( | XMC_HRPWM_t *const | hrpwm, |
const uint32_t | mask | ||
) |
- Parameters
-
hrpwm Constant pointer to XMC_HRPWM_t, pointing to the HRPWM module base address mask masked values of selected CSG modules. Use the enum type XMC_HRPWM_CSG_RUN_BIT_t to generate the mask.
- Returns
- None
- Description
Clear the comparator output from clamp state
Un-clamps the output of comparator from clamped state set via software by setting CSGCLRG.CC0P bit. The output of comparator is now dependent on the inputs of comparator.
Generated on Mon Aug 7 2017 11:33:57 for XMC Peripheral Library for XMC4000 Family by 1.8.11