XMC Peripheral Library for XMC4000 Family: DSD

XMC Peripheral Library for XMC4000 Family

XMC Peripheral Library for XMC4000 Family  2.1.16

Data Structures

struct  XMC_DSD_CH_AUX_FILTER_CONFIG_t
 
struct  XMC_DSD_CH_CONFIG_t
 
struct  XMC_DSD_CH_FILTER_CONFIG_t
 
struct  XMC_DSD_CH_INTEGRATOR_CONFIG_t
 
struct  XMC_DSD_CH_RECTIFY_CONFIG_t
 
struct  XMC_DSD_CH_TIMESTAMP_CONFIG_t
 
struct  XMC_DSD_GENERATOR_CONFIG_t
 

Typedefs

typedef DSD_CH_TypeDef XMC_DSD_CH_t
 
typedef DSD_GLOBAL_TypeDef XMC_DSD_t
 

Enumerations

Functions

void XMC_DSD_CH_AuxFilter_DisableEvent (XMC_DSD_CH_t *const channel)
 
void XMC_DSD_CH_AuxFilter_EnableEvent (XMC_DSD_CH_t *const channel, XMC_DSD_CH_AUX_EVENT_t event)
 
void XMC_DSD_CH_AuxFilter_Init (XMC_DSD_CH_t *const channel, const XMC_DSD_CH_AUX_FILTER_CONFIG_t *const init)
 
void XMC_DSD_CH_AuxFilter_SetBoundary (XMC_DSD_CH_t *const channel, const int16_t lower_boundary, const int16_t upper_boundary)
 
void XMC_DSD_CH_GetRectifyDelay (XMC_DSD_CH_t *const channel, uint8_t *delay)
 
void XMC_DSD_CH_GetResult (XMC_DSD_CH_t *const channel, int16_t *dsd_Result)
 
void XMC_DSD_CH_GetResult_AUX (XMC_DSD_CH_t *const channel, int16_t *dsd_Result)
 
void XMC_DSD_CH_GetResult_TS (XMC_DSD_CH_t *const channel, int16_t *dsd_Result, uint8_t *dsd_filter_loop, uint8_t *dsd_integration_loop)
 
void XMC_DSD_CH_GetResult_TS_Time (XMC_DSD_CH_t *const channel, int16_t *dsd_Result, uint32_t *time)
 
XMC_DSD_STATUS_t XMC_DSD_CH_Init (XMC_DSD_CH_t *const channel, const XMC_DSD_CH_CONFIG_t *const init)
 
void XMC_DSD_CH_Integrator_Init (XMC_DSD_CH_t *const channel, const XMC_DSD_CH_INTEGRATOR_CONFIG_t *const init)
 
void XMC_DSD_CH_MainFilter_DisableEvent (XMC_DSD_CH_t *const channel)
 
void XMC_DSD_CH_MainFilter_EnableEvent (XMC_DSD_CH_t *const channel)
 
void XMC_DSD_CH_MainFilter_Init (XMC_DSD_CH_t *const channel, const XMC_DSD_CH_FILTER_CONFIG_t *const init)
 
void XMC_DSD_CH_MainFilter_SetOffset (XMC_DSD_CH_t *const channel, const int16_t offset)
 
void XMC_DSD_CH_Rectify_Init (XMC_DSD_CH_t *const channel, const XMC_DSD_CH_RECTIFY_CONFIG_t *const init)
 
void XMC_DSD_CH_Timestamp_Init (XMC_DSD_CH_t *const channel, const XMC_DSD_CH_TIMESTAMP_CONFIG_t *const init)
 
void XMC_DSD_ClearAlarmEventFlag (XMC_DSD_t *const dsd, const uint32_t channel_id)
 
void XMC_DSD_ClearResultEventFlag (XMC_DSD_t *const dsd, const uint32_t channel_id)
 
void XMC_DSD_Disable (XMC_DSD_t *const dsd)
 
void XMC_DSD_DisableClock (XMC_DSD_t *const dsd)
 
void XMC_DSD_Enable (XMC_DSD_t *const dsd)
 
void XMC_DSD_EnableClock (XMC_DSD_t *const dsd)
 
void XMC_DSD_Generator_Init (XMC_DSD_t *const dsd, const XMC_DSD_GENERATOR_CONFIG_t *const init)
 
void XMC_DSD_Generator_Start (XMC_DSD_t *const dsd, const XMC_DSD_GENERATOR_CONFIG_t *const config)
 
void XMC_DSD_Generator_Stop (XMC_DSD_t *const dsd)
 
void XMC_DSD_Init (XMC_DSD_t *const dsd)
 
bool XMC_DSD_IsChannelStarted (XMC_DSD_t *const dsd, const XMC_DSD_CH_ID_t channel)
 
bool XMC_DSD_IsEnabled (XMC_DSD_t *const dsd)
 
void XMC_DSD_SetAlarmEventFlag (XMC_DSD_t *const dsd, const uint32_t channel_id)
 
void XMC_DSD_SetResultEventFlag (XMC_DSD_t *const dsd, const uint32_t channel_id)
 
void XMC_DSD_Start (XMC_DSD_t *const dsd, const uint32_t channel)
 
void XMC_DSD_Stop (XMC_DSD_t *const dsd, const uint32_t channel)
 

Detailed Description

The DSD unit provides a series of digital input channels accepting data streams from external modulators using the Delta/Sigma (DS) conversion principle. The on-chip demodulator channels convert these inputs to discrete digital values. DSD unit can be used for isolated current/voltage measurement and for sensor interfaces.

Driver is divided in six DSD functional blocks -

  • Main Filter (APIs prefixed with XMC_DSD_CH_MainFilter),
  • Aux Filter (APIs prefixed with XMC_DSD_CH_AuxFilter),
  • Integrator (APIs prefixed with XMC_DSD_CH_Integrator),
  • Timestamp (APIs prefixed with XMC_DSD_CH_Timestamp),
  • Rectification (APIs prefixed with XMC_DSD_CH_Rectify),
  • Carrier Generator (APIs prefixed with XMC_DSD_Generator)

DSD driver features:

  1. DSD channel Configuration structure XMC_DSD_CH_CONFIG_t initialization function XMC_DSD_CH_Init() to configure all the functional blocks (except carrier generator)
  2. Configuration structure XMC_DSD_GENERATOR_CONFIG_t and initialization function XMC_DSD_Generator_Init() to configure carrier generator
  3. Configuration structure XMC_DSD_CH_FILTER_CONFIG_t and initialization function XMC_DSD_CH_MainFilter_Init() to configure main filter
  4. Configuration structure XMC_DSD_CH_AUX_FILTER_CONFIG_t and initialization function XMC_DSD_CH_AuxFilter_Init() to configure auxilary filter
  5. Configuration structure XMC_DSD_CH_INTEGRATOR_CONFIG_t and initialization function XMC_DSD_CH_Integrator_Init() to configure integrator
  6. Configuration structure XMC_DSD_CH_TIMESTAMP_CONFIG_t and initialization function XMC_DSD_CH_Timestamp_Init() to configure timestamp
  7. Configuration structure XMC_DSD_CH_RECTIFY_CONFIG_t and initialization function XMC_DSD_CH_Rectify_Init() to configure rectifier

Typedef Documentation

typedef DSD_CH_TypeDef XMC_DSD_CH_t

DSD Channel

typedef DSD_GLOBAL_TypeDef XMC_DSD_t

DSD Module

Enumeration Type Documentation

Enumerates the service request generation mode for auxiliary filter. Use type XMC_DSD_CH_AUX_EVENT_t for this enum. Note: This is combined ENUM for SRGA + ESEL bit fields

Enumerator
XMC_DSD_CH_AUX_EVENT_DISABLED 

Service request is disabled

XMC_DSD_CH_AUX_EVENT_EVERY_NEW_RESULT 

Service request generated for aux filter for every new result

XMC_DSD_CH_AUX_EVENT_CAPTURE_SIGN_DELAY 

Service request generated for alternate source

XMC_DSD_CH_AUX_EVENT_INSIDE_BOUNDARY 

Service request generated for aux filter if result is inside boundary

XMC_DSD_CH_AUX_EVENT_OUTSIDE_BOUNDARY 

Service request generated for aux filter if result is outside boundary

Enumerates the divider factor for modulator clock (fMOD). Use divider factor to derive modulator clock frequency(fMOD), from the selected internal clock source(fCLK). Use type XMC_DSD_CH_CLK_t for this enum.

Enumerator
XMC_DSD_CH_CLK_DIV_2 

fMOD = fCLK/2

XMC_DSD_CH_CLK_DIV_4 

fMOD = fCLK/4

XMC_DSD_CH_CLK_DIV_6 

fMOD = fCLK/6

XMC_DSD_CH_CLK_DIV_8 

fMOD = fCLK/8

XMC_DSD_CH_CLK_DIV_10 

fMOD = fCLK/10

XMC_DSD_CH_CLK_DIV_12 

fMOD = fCLK/12

XMC_DSD_CH_CLK_DIV_14 

fMOD = fCLK/14

XMC_DSD_CH_CLK_DIV_16 

fMOD = fCLK/16

XMC_DSD_CH_CLK_DIV_18 

fMOD = fCLK/18

XMC_DSD_CH_CLK_DIV_20 

fMOD = fCLK/20

XMC_DSD_CH_CLK_DIV_22 

fMOD = fCLK/22

XMC_DSD_CH_CLK_DIV_24 

fMOD = fCLK/24

XMC_DSD_CH_CLK_DIV_26 

fMOD = fCLK/26

XMC_DSD_CH_CLK_DIV_28 

fMOD = fCLK/28

XMC_DSD_CH_CLK_DIV_30 

fMOD = fCLK/30

XMC_DSD_CH_CLK_DIV_32 

fMOD = fCLK/32

Enumerates the sample clock source select. Use type XMC_DSD_CH_CLOCK_SOURCE_t for this enum.

Enumerator
XMC_DSD_CH_CLOCK_SOURCE_A 

External source, from input A

XMC_DSD_CH_CLOCK_SOURCE_B 

External source, from input B

XMC_DSD_CH_CLOCK_SOURCE_C 

External source, from input C

XMC_DSD_CH_CLOCK_SOURCE_D 

External source, from input D

XMC_DSD_CH_CLOCK_SOURCE_INTERN 

Internal clock source

Enumerates the input data source select. Use type XMC_DSD_CH_DATA_SOURCE_t for this enum.

Enumerator
XMC_DSD_CH_DATA_SOURCE_DISCONNECT 

Disconnected

XMC_DSD_CH_DATA_SOURCE_A_DIRECT 

External source, from input A, direct

XMC_DSD_CH_DATA_SOURCE_A_INVERTED 

External source, from input A, inverted

XMC_DSD_CH_DATA_SOURCE_B_DIRECT 

External source, from input B, direct

XMC_DSD_CH_DATA_SOURCE_B_INVERTED 

External source, from input B, inverted

Enumerates the CIC(cyclic integrating comb) filter type. Use type XMC_DSD_CH_FILTER_TYPE_t for this enum.

Enumerator
XMC_DSD_CH_FILTER_TYPE_CIC1 

CIC1 filter

XMC_DSD_CH_FILTER_TYPE_CIC2 

CIC2 filter

XMC_DSD_CH_FILTER_TYPE_CIC3 

CIC3 filter

XMC_DSD_CH_FILTER_TYPE_CICF 

CICF filter

Enumerates the channel run control bit register value in global run control register. Use type XMC_DSD_CH_ID_t for this enum.

Enumerator
XMC_DSD_CH_ID_0 

Register value for channel 0

XMC_DSD_CH_ID_1 

Register value for channel 1

XMC_DSD_CH_ID_2 

Register value for channel 2

XMC_DSD_CH_ID_3 

Register value for channel 3

Enumerates the integrator trigger mode. Use type XMC_DSD_CH_INTEGRATOR_START_t for this enum.

Enumerator
XMC_DSD_CH_INTEGRATOR_START_OFF 

No integration trigger

XMC_DSD_CH_INTEGRATOR_START_TRIGGER_FALL 

Trigger event upon a falling edge

XMC_DSD_CH_INTEGRATOR_START_TRIGGER_RISE 

Trigger event upon a rising edge

XMC_DSD_CH_INTEGRATOR_START_ALLWAYS_ON 

No trigger, integrator active all the time

Enumerates the integration enable. Use type XMC_DSD_CH_INTEGRATOR_STOP_t for this enum.

Enumerator
XMC_DSD_CH_INTEGRATOR_STOP_END_OF_LOOPS 

Integration stopped upon the inverse trigger event

XMC_DSD_CH_INTEGRATOR_STOP_ENDLESS_OR_INVERSE_TRIGGER 

Integration enabled upon the defined trigger event.

Enumerates the service request generation for main chain filter. Use type XMC_DSD_CH_RESULT_EVENT_t for this enum.

Enumerator
XMC_DSD_CH_RESULT_EVENT_DISABLE 

Disable service request

XMC_DSD_CH_RESULT_EVENT_ENABLE 

Enable service request for each new result value

Enumerates the carrier generation mode. Use type XMC_DSD_CH_SIGN_SOURCE_t for this enum.

Enumerator
XMC_DSD_CH_SIGN_SOURCE_ON_CHIP_GENERATOR 

Carrier is generated internally by DSD

XMC_DSD_CH_SIGN_SOURCE_NEXT_CHANNEL 

Carrier sign signal is generated internally by next channel

XMC_DSD_CH_SIGN_SOURCE_EXTERNAL_A 

Carrier is generated externally, External sign signal A

XMC_DSD_CH_SIGN_SOURCE_EXTERNAL_B 

Carrier is generated externally, External sign signal B

Enumerates the data strobe generation Mode. Use type XMC_DSD_CH_STROBE_t for this enum.

Enumerates the timestamp trigger mode. Use type XMC_DSD_CH_TIMESTAMP_TRIGGER_t for this enum.

Enumerator
XMC_DSD_CH_TIMESTAMP_TRIGGER_DISABLE 

No trigger event

XMC_DSD_CH_TIMESTAMP_TRIGGER_FALL 

Trigger event upon a falling edge

XMC_DSD_CH_TIMESTAMP_TRIGGER_RISE 

Trigger event upon a rising edge

XMC_DSD_CH_TIMESTAMP_TRIGGER_BOTH_EDGES 

Trigger event upon both the edge

Enumerates the trigger signal. Use type XMC_DSD_CH_TRIGGER_SOURCE_t for this enum.

Enumerator
XMC_DSD_CH_TRIGGER_SOURCE_A 

Trigger signal,input A

XMC_DSD_CH_TRIGGER_SOURCE_B 

Trigger signal,input B

XMC_DSD_CH_TRIGGER_SOURCE_C 

Trigger signal,input C

XMC_DSD_CH_TRIGGER_SOURCE_D 

Trigger signal,input D

XMC_DSD_CH_TRIGGER_SOURCE_E 

Trigger signal,input E

XMC_DSD_CH_TRIGGER_SOURCE_F 

Trigger signal,input F

XMC_DSD_CH_TRIGGER_SOURCE_G 

Trigger signal,input G

XMC_DSD_CH_TRIGGER_SOURCE_H 

Trigger signal,input H

Enumerates the divider factor for the PWM pattern signal generator. Use divider factor to derive input frequency of the carrier signal generator(fCG), from the selected internal clock source(fCLK). Use type XMC_DSD_GENERATOR_CLKDIV_t for this enum.

Enumerator
XMC_DSD_GENERATOR_CLKDIV_2048 

fCG = (fCLK/2)/1024

XMC_DSD_GENERATOR_CLKDIV_4096 

fCG = (fCLK/4)/1024

XMC_DSD_GENERATOR_CLKDIV_6144 

fCG = (fCLK/6)/1024

XMC_DSD_GENERATOR_CLKDIV_8192 

fCG = (fCLK/8)/1024

XMC_DSD_GENERATOR_CLKDIV_10240 

fCG = (fCLK/10)/1024

XMC_DSD_GENERATOR_CLKDIV_12288 

fCG = (fCLK/12)/1024

XMC_DSD_GENERATOR_CLKDIV_14336 

fCG = (fCLK/14)/1024

XMC_DSD_GENERATOR_CLKDIV_16384 

fCG = (fCLK/16)/1024

XMC_DSD_GENERATOR_CLKDIV_18432 

fCG = (fCLK/18)/1024

XMC_DSD_GENERATOR_CLKDIV_20480 

fCG = (fCLK/20)/1024

XMC_DSD_GENERATOR_CLKDIV_22528 

fCG = (fCLK/22)/1024

XMC_DSD_GENERATOR_CLKDIV_24576 

fCG = (fCLK/24)/1024

XMC_DSD_GENERATOR_CLKDIV_26624 

fCG = (fCLK/26)/1024

XMC_DSD_GENERATOR_CLKDIV_28672 

fCG = (fCLK/28)/1024

XMC_DSD_GENERATOR_CLKDIV_30720 

fCG = (fCLK/30)/1024

XMC_DSD_GENERATOR_CLKDIV_32768 

fCG = (fCLK/32)/1024

Enumerates the carrier generator operating mode. Use type XMC_DSD_GENERATOR_MODE_t for this enum.

Enumerator
XMC_DSD_GENERATOR_MODE_STOPPED 

Stopped

XMC_DSD_GENERATOR_MODE_RECTANGLE 

Square wave

XMC_DSD_GENERATOR_MODE_TRIANGLE 

Triangle

XMC_DSD_GENERATOR_MODE_SINE 

Sine wave

Return types of the API's.Use type XMC_DSD_STATUS_t for this enum.

Enumerator
XMC_DSD_STATUS_OK 

API fulfills request

XMC_DSD_STATUS_ERROR 

Error detected

Function Documentation

void XMC_DSD_CH_AuxFilter_DisableEvent ( XMC_DSD_CH_t *const  channel)
Parameters
channelPointer to an instance of DSD channel of type XMC_DSD_CH_t
Returns
None
Description
This API disable the auxiliary filter service request generation for this channel. Clear the bit fields SRGA and ESEL of register FCFGA.
void XMC_DSD_CH_AuxFilter_EnableEvent ( XMC_DSD_CH_t *const  channel,
XMC_DSD_CH_AUX_EVENT_t  event 
)
Parameters
channelPointer to an instance of DSD channel of type XMC_DSD_CH_t
eventto select the type of event which will be enabled of type XMC_DSD_CH_AUX_EVENT_t
Returns
None
Description
This API enable the service request generation for this channel. Result events are generated at the output rate of the configured auxiliary filter chain. Configure bit field SRGA and ESEL of register FCFGA
void XMC_DSD_CH_AuxFilter_Init ( XMC_DSD_CH_t *const  channel,
const XMC_DSD_CH_AUX_FILTER_CONFIG_t *const  init 
)
Parameters
channelPointer to an instance of DSD channel of type XMC_DSD_CH_t
initPointer to an instance of data structure of type XMC_DSD_CH_AUX_FILTER_CONFIG_t
Returns
None
Description
This API initialize auxiliary filter module with init. The auxiliary Filter is mainly used as fast filter.
Adding the auxiliary filter to the system structure helps by defining the boundaries and filter configurations.
Note
It is internally called by XMC_DSD_CH_Init().
Related APIs:
XMC_DSD_CH_Init()


void XMC_DSD_CH_AuxFilter_SetBoundary ( XMC_DSD_CH_t *const  channel,
const int16_t  lower_boundary,
const int16_t  upper_boundary 
)
Parameters
channelPointer to an instance of DSD channel of type XMC_DSD_CH_t
lower_boundarylower boundary value for limit checking
upper_boundaryupper boundary value for limit checking
Returns
None
Description
Invoke this API, to set the lower and upper boundary for limit checking for this channel. This (two’s complement) value is compared to the results of the parallel filter. Configure bit fields BOUNDARYU and BOUNDARYL of register BOUNDSEL.
Note
Lower and upper boundaries are internally configured by function XMC_DSD_CH_AuxFilter_Init().
Related APIs:
XMC_DSD_CH_AuxFilter_Init()


void XMC_DSD_CH_GetRectifyDelay ( XMC_DSD_CH_t *const  channel,
uint8_t *  delay 
)
Parameters
channelPointer to an instance of DSD channel of type XMC_DSD_CH_t
delayCaptured value
Returns
uint8_t
Description
This API, capture sign delay value for DSD channel. Captured value indicates the values counted between the begin of the positive halfwave of the carrier signal and the first received positive value. Read bit field SDCAP of register CGSYNC
void XMC_DSD_CH_GetResult ( XMC_DSD_CH_t *const  channel,
int16_t *  dsd_Result 
)
Parameters
channelPointer to an instance of DSD channel of type XMC_DSD_CH_t
dsd_Resultpointer point to the address of 16 bit variable
Returns
None
Description:
Returns the result of most recent conversion associated with this channel.
A call to this API would access the register bit field RESMx.RESULT (x = 0 - 3).
Related APIs:
XMC_DSD_CH_GetResult_TS()


void XMC_DSD_CH_GetResult_AUX ( XMC_DSD_CH_t *const  channel,
int16_t *  dsd_Result 
)
Parameters
channelPointer to an instance of DSD channel of type XMC_DSD_CH_t
dsd_Resultpointer point to the address of 16 bit variable
Returns
None
Description:
Returns the most recent conversion result values of the auxiliary filter associated with this channel.
A call to this API would access the register bit field RESAx.RESULT (x = 0 - 3).
Related APIs:
XMC_DSD_CH_GetResult_TS()


void XMC_DSD_CH_GetResult_TS ( XMC_DSD_CH_t *const  channel,
int16_t *  dsd_Result,
uint8_t *  dsd_filter_loop,
uint8_t *  dsd_integration_loop 
)
Parameters
channelPointer to an instance of DSD channel of type XMC_DSD_CH_t
dsd_Resultpointer point to the address of 16 bit variable holds result value
dsd_filter_looppointer point to the address of 8 bit variable holds decimation counter value
dsd_integration_looppointer point to the address of 8 bit integration counter variable holds value
Returns
None
Description:
API to get the result of the last conversion associated with this channel with CIC filter decimation counter and number of values counted.
A call to this API would access the register bit field TSTMPx.RESULT TSTMPx.CFMDCNT and TSTMPx.NVALCNT where (x = 0 - 3).
Related APIs:
XMC_DSD_CH_GetResult(),XMC_DSD_CH_GetResult_TS_Time()


void XMC_DSD_CH_GetResult_TS_Time ( XMC_DSD_CH_t *const  channel,
int16_t *  dsd_Result,
uint32_t *  time 
)
Parameters
channelPointer to an instance of DSD channel of type XMC_DSD_CH_t
dsd_Resultpointer point to the address of 16 bit variable holds result value
timepointer point to the address of 32 bit variable holds the time
Returns
None
Description:
API to get the result of the last conversion with the time, associated with this channel.
Related APIs:
XMC_DSD_CH_GetResult(),XMC_DSD_CH_GetResult_TS()


XMC_DSD_STATUS_t XMC_DSD_CH_Init ( XMC_DSD_CH_t *const  channel,
const XMC_DSD_CH_CONFIG_t *const  init 
)
Parameters
channelPointer to an instance of DSD channel of type XMC_DSD_CH_t
initPointer to an instance of data structure of type XMC_DSD_CH_CONFIG_t
Returns
XMC_DSD_STATUS_t if success Returns XMC_DSD_STATUS_OK else return XMC_DSD_STATUS_ERROR.
Description
Initialize main filter,auxiliary filter,integrator, rectifier and timestamp of DSD module with init.
Internally this API invoke main filter, auxiliary filter, integrator, rectifier and timestamp init API.
Related APIs:
XMC_DSD_CH_MainFilter_Init(),XMC_DSD_CH_AuxFilter_Init(),XMC_DSD_CH_Integrator_Init(), XMC_DSD_CH_Rectify_Init(),XMC_DSD_CH_Timestamp_Init()


void XMC_DSD_CH_Integrator_Init ( XMC_DSD_CH_t *const  channel,
const XMC_DSD_CH_INTEGRATOR_CONFIG_t *const  init 
)
Parameters
channelPointer to an instance of DSD channel of type XMC_DSD_CH_t
initPointer to an instance of data structure of type XMC_DSD_CH_INTEGRATOR_CONFIG_t
Returns
None
Description
Initialize integrator of DSD module.The integrator is mainly used for resolver feedback but can also be used for high accurate measurement. This API configures number of integration loops, number of results are discarded before integration starts, integrator stop condition, number of integrator loop to get integration result and trigger mode.
Note
Trigger source for timestamp and integrator are shared. It is internally called by XMC_DSD_CH_Init().
Related APIs:
XMC_DSD_CH_Init()


void XMC_DSD_CH_MainFilter_DisableEvent ( XMC_DSD_CH_t *const  channel)
Parameters
channelPointer to an instance of DSD channel of type XMC_DSD_CH_t
Returns
None
Description
This API disable the service request generation for result of this channel. Configure bit field SRGM of register FCFGC
void XMC_DSD_CH_MainFilter_EnableEvent ( XMC_DSD_CH_t *const  channel)
Parameters
channelPointer to an instance of DSD channel of type XMC_DSD_CH_t
Returns
None
Description
This API enable the service request generation for result of this channel. Result events are generated at the output rate of the configured main filter chain. Configure bit field SRGM of register FCFGC
void XMC_DSD_CH_MainFilter_Init ( XMC_DSD_CH_t *const  channel,
const XMC_DSD_CH_FILTER_CONFIG_t *const  init 
)
Parameters
channelPointer to an instance of DSD channel of type XMC_DSD_CH_t
initPointer to an instance of data structure of type XMC_DSD_CH_FILTER_CONFIG_t
Returns
None
Description
This API initialize main filter module with init. The filter demodulates the incoming bit stream from the delta sigma modulator to a 16 bit result.
Note
It is internally called by XMC_DSD_CH_Init().
Related APIs:
XMC_DSD_CH_Init()


void XMC_DSD_CH_MainFilter_SetOffset ( XMC_DSD_CH_t *const  channel,
const int16_t  offset 
)
Parameters
channelPointer to an instance of DSD channel of type XMC_DSD_CH_t
offsetSigned Offset value to be set
Returns
None
Description
API set the signed offset value for this channel. This offset value is subtracted from each result before being written to the corresponding result register RESMx.
Note
The offset value is measured for each channel separately.
void XMC_DSD_CH_Rectify_Init ( XMC_DSD_CH_t *const  channel,
const XMC_DSD_CH_RECTIFY_CONFIG_t *const  init 
)
Parameters
channelPointer to an instance of DSD channel of type XMC_DSD_CH_t
initPointer to an instance of data structure of type XMC_DSD_CH_RECTIFY_CONFIG_t
Returns
None
Description
Initialize rectification for this channel. In a resolver feedback system, rectifier is used to rectify the result from the integrator. Configure bit field RFEN and SSRC of register RECTCFG. Also configure sign delay value for positive halfwave(SDPOS) and negative halfwave(SDNEG).
Note
For the operational capability of rectifier the filter and the integrator is mandatory. It is internally called by XMC_DSD_CH_Init().
Related APIs:
XMC_DSD_CH_Init()


void XMC_DSD_CH_Timestamp_Init ( XMC_DSD_CH_t *const  channel,
const XMC_DSD_CH_TIMESTAMP_CONFIG_t *const  init 
)
Parameters
channelPointer to an instance of DSD channel of type XMC_DSD_CH_t
initPointer to an instance of data structure of type XMC_DSD_CH_TIMESTAMP_CONFIG_t
Returns
None
Description
Initialize timestamp mode of DSD module with init.
Configures bits TRSEL and TSTRMODE of register DICFG .
Note
Trigger source for timestamp and integrator are shared. It is internally called by XMC_DSD_CH_Init().
Related APIs:
XMC_DSD_CH_Init()


void XMC_DSD_ClearAlarmEventFlag ( XMC_DSD_t *const  dsd,
const uint32_t  channel_id 
)
Parameters
dsdPointer to an instance of DSD module of type XMC_DSD_t
channel_idChannel number register value of type XMC_DSD_CH_ID_t
Returns
None
Description
Clear the result event flag.
Set bit fields ALECx of register EVFLAGCLR.Clearing these bits has no effect.
Note
API call for channel-0 : XMC_DSD_ClearResultEventFlag(DSD,(uint32_t)XMC_DSD_CH_ID_0); API call for channel-0 and 1: XMC_DSD_ClearResultEventFlag(DSD,(uint32_t)(XMC_DSD_CH_ID_0|XMC_DSD_CH_ID_1));
Related APIs:
XMC_DSD_SetAlarmEventFlag()


void XMC_DSD_ClearResultEventFlag ( XMC_DSD_t *const  dsd,
const uint32_t  channel_id 
)
Parameters
dsdPointer to an instance of DSD module of type XMC_DSD_t
channel_idChannel number register value of type XMC_DSD_CH_ID_t
Returns
None
Description
Clear the result event flag.
Set bit fields RESECx of register EVFLAGCLR.Clearing these bits has no effect.
Note
API call for channel-0 : XMC_DSD_ClearResultEventFlag(DSD,(uint32_t)XMC_DSD_CH_ID_0); API call for channel-0 and 1: XMC_DSD_ClearResultEventFlag(DSD,(uint32_t)(XMC_DSD_CH_ID_0|XMC_DSD_CH_ID_1));
Related APIs:
XMC_DSD_SetResultEventFlag()


void XMC_DSD_Disable ( XMC_DSD_t *const  dsd)
Parameters
dsdPointer to an instance of DSD module of type XMC_DSD_t
Returns
None
Description
Asserts the DSD module into reset.
Configures PRSET0 register's DSDRS bit field. If running on XMC44/XMC48 device then it will gate the peripheral clock.
Related APIs:
XMC_DSD_Enable()


void XMC_DSD_DisableClock ( XMC_DSD_t *const  dsd)
Parameters
dsdPointer to an instance of DSD module of type XMC_DSD_t
Returns
None
Description
Stop the module clock and disable internal module clock for DSD.
Configures bit field MCSEL of register GLOBCFG and bit field DISR of register CLC.
Related APIs:
XMC_DSD_DisableClock()


void XMC_DSD_Enable ( XMC_DSD_t *const  dsd)
Parameters
dsdPointer to an instance of DSD module of type XMC_DSD_t
Returns
None
Description
De-asserts the DSD module from reset.
Configures PRCLR0 register's DSDRS bit field. If running on XMC44/XMC48 device then it will ungate the peripheral clock.
Note
It is internally called by XMC_DSD_Init().
Related APIs:
XMC_DSD_Disable(),XMC_DSD_Init()


void XMC_DSD_EnableClock ( XMC_DSD_t *const  dsd)
Parameters
dsdPointer to an instance of DSD module of type XMC_DSD_t
Returns
None
Description
Enable the module clock and internal module clock for DSD.
Configures bit field MCSEL of register GLOBCFG and bit field DISR of register CLC.
Note
It is internally called by XMC_DSD_Init().
Related APIs:
XMC_DSD_DisableClock(),XMC_DSD_Init()


void XMC_DSD_Generator_Init ( XMC_DSD_t *const  dsd,
const XMC_DSD_GENERATOR_CONFIG_t *const  init 
)
Parameters
dsdPointer to an instance of DSD module of type XMC_DSD_t
initPointer to an instance of data structure of type XMC_DSD_GENERATOR_CONFIG_t
Returns
None
Description
This API initialize generator module with init, to generate a wave for a resolver. Three types of waveforms can be generated: Rectangle, Triangle and Sine.
void XMC_DSD_Generator_Start ( XMC_DSD_t *const  dsd,
const XMC_DSD_GENERATOR_CONFIG_t *const  config 
)
Parameters
dsdPointer to an instance of DSD module of type XMC_DSD_t
configPointer to an instance of data structure of type XMC_DSD_GENERATOR_CONFIG_t
Returns
None
Description
Start carrier generator by configuring operating mode. Configures bit field CGMOD of register CGCFG.
Related APIs:
XMC_DSD_Generator_Stop()


void XMC_DSD_Generator_Stop ( XMC_DSD_t *const  dsd)
Parameters
dsdPointer to an instance of DSD module of type XMC_DSD_t
Returns
None
Description
Stop carrier generator by configuring operating mode. Reset bit field CGMOD of register CGCFG.
Note
Stopping the carrier generator terminates the PWM output after completion of the current period.
Related APIs:
XMC_DSD_Generator_Start()


void XMC_DSD_Init ( XMC_DSD_t *const  dsd)
Parameters
dsdPointer to an instance of DSD module of type XMC_DSD_t
Returns
None
Description
Enable the DSD module and clock.
Note
This is the first API which application must invoke to configure DSD.
Related APIs:
XMC_DSD_Enable(),XMC_DSD_EnableClock()


bool XMC_DSD_IsChannelStarted ( XMC_DSD_t *const  dsd,
const XMC_DSD_CH_ID_t  channel 
)
Parameters
dsdPointer to an instance of DSD module of type XMC_DSD_t
channelChannel run control bit register value of type XMC_DSD_CH_ID_t
Returns
bool Return 1 if started else 0.
Description
Find out if particular demodulator channel is started or not.
Related APIs:
XMC_DSD_Start(),XMC_DSD_Stop()


bool XMC_DSD_IsEnabled ( XMC_DSD_t *const  dsd)
Parameters
dsdPointer to an instance of DSD module of type XMC_DSD_t
Returns
bool Return 1 if success else 0.
Description
Find out if the DSD reset is asserted.
Read PRSTAT0 register's DSDRS bit field.


void XMC_DSD_SetAlarmEventFlag ( XMC_DSD_t *const  dsd,
const uint32_t  channel_id 
)
Parameters
dsdPointer to an instance of DSD module of type XMC_DSD_t
channel_idChannel number register value of type XMC_DSD_CH_ID_t
Returns
None
Description
Set the alarm event flag.
Set bit fields ALEVx of register EVFLAG.Clearing these bits has no effect.
Note
API call for channel-0 : XMC_DSD_SetAlarmEventFlag(DSD,(uint32_t)XMC_DSD_CH_ID_0); API call for channel-0 and 1: XMC_DSD_SetAlarmEventFlag(DSD,(uint32_t)(XMC_DSD_CH_ID_0|XMC_DSD_CH_ID_1));
Related APIs:
XMC_DSD_ClearAlarmEventFlag()


void XMC_DSD_SetResultEventFlag ( XMC_DSD_t *const  dsd,
const uint32_t  channel_id 
)
Parameters
dsdPointer to an instance of DSD module of type XMC_DSD_t
channel_idChannel number register value of type XMC_DSD_CH_ID_t
Returns
None
Description
Set the result event flag and trigger the corresponding event.
Set bit fields RESEVx of register EVFLAG.Clearing these bits has no effect.
Note
API call for channel-0 : XMC_DSD_SetResultEventFlag(DSD,(uint32_t)XMC_DSD_CH_ID_0); API call for channel-0 and 1: XMC_DSD_SetResultEventFlag(DSD,(uint32_t)(XMC_DSD_CH_ID_0|XMC_DSD_CH_ID_1));
Related APIs:
XMC_DSD_ClearResultEventFlag()


void XMC_DSD_Start ( XMC_DSD_t *const  dsd,
const uint32_t  channel 
)
Parameters
dsdPointer to an instance of DSD module of type XMC_DSD_t
channelChannel run control bit register value
Returns
None
Description
Start demodulator channel by enabling run control bit. Multiple channel can be start at a time. For an example: To start all four channel, call this function as XMC_DSD_Start(DSD,(uint32_t)(XMC_DSD_CH_ID_0|XMC_DSD_CH_ID_1|XMC_DSD_CH_ID_2|XMC_DSD_CH_ID_3));
Note
All filter blocks are cleared when CHxRUN is set.
Related APIs:
XMC_DSD_Stop(),XMC_DSD_IsChannelStarted()


void XMC_DSD_Stop ( XMC_DSD_t *const  dsd,
const uint32_t  channel 
)
Parameters
dsdPointer to an instance of DSD module of type XMC_DSD_t
channelChannel run control bit register value
Returns
None
Description
Stop demodulator channel by resetting run control bit. Multiple channel can be stop at a time. For an example: To stop all four channel, call this function as XMC_DSD_Stop(DSD,(uint32_t)(XMC_DSD_CH_ID_0|XMC_DSD_CH_ID_1|XMC_DSD_CH_ID_2|XMC_DSD_CH_ID_3));
Related APIs:
XMC_DSD_Start(),XMC_DSD_IsChannelStarted()


Generated on Mon Aug 7 2017 11:33:57 for XMC Peripheral Library for XMC4000 Family by   doxygen 1.8.11