AM243x Motor Control SDK  09.01.00

Introduction

Here is the list of APIs used for Sigma Delta interface

Functions

sdfm_handle SDFM_init (uint8_t pru_id, uint8_t coreId)
 Initialize SDFM instance. More...
 
void SDFM_configIepCount (sdfm_handle h_sdfm, uint32_t epwm_out_freq)
 Configure iep increment & iep count in one epwm cycle. More...
 
void SDFM_configEcap (sdfm_handle h_sdfm, uint8_t ecap_divider)
 Configure ecap parameters for generate 20MHz SD clock. More...
 
void SDFM_setEnableChannel (sdfm_handle h_sdfm, uint8_t channel_number)
 Enable the channel specified by the channel number parameter. More...
 
void SDFM_setCompFilterOverSamplingRatio (sdfm_handle h_sdfm, uint8_t ch_id, uint16_t osr)
 Configure comparator filter (over current) sampling ratio. More...
 
void SDFM_enable (sdfm_handle h_sdfm)
 SDFM global enable. More...
 
void SDFM_setCompFilterThresholds (sdfm_handle h_sdfm, uint8_t ch_id, SDFM_ThresholdParms thresholdParms)
 configuration of SDFM threshold values More...
 
void SDFM_setSampleTriggerTime (sdfm_handle h_sdfm, float samp_trig_time)
 configuration of single sample trigger time one Epwm cycle More...
 
void SDFM_enableDoubleSampling (sdfm_handle h_sdfm, float samp_trig_time)
 configuration and enable second normal current sample starting time one Epwm cycle More...
 
void SDFM_disableDoubleSampling (sdfm_handle h_sdfm)
 Disable double normal current update/sampling. More...
 
void SDFM_configDataFilter (sdfm_handle h_sdfm, uint8_t ch_id, uint8_t filter)
 configuration of SDFM channel Acc source (sync filter type).
Current SDFM firmware implementation support only SYNC3 filter
More...
 
void SDFM_selectClockSource (sdfm_handle h_sdfm, uint8_t ch_id, SDFM_ClkSourceParms clkPrams)
 configuration of SDFM channel clock source & clock inversion More...
 
void SDFM_enableComparator (sdfm_handle h_sdfm, uint8_t ch)
 This API enables the Comparator for the selected channel. More...
 
void SDFM_disableComparator (sdfm_handle h_sdfm, uint8_t ch)
 This API disables the Comparator for the selected channel. More...
 
void SDFM_configComparatorGpioPins (sdfm_handle h_sdfm, uint8_t ch, uint32_t gpio_base_addr, uint32_t pin_number)
 configure GPIO pin number and address for associate Channel Number More...
 
uint32_t SDFM_getFilterData (sdfm_handle h_sdfm, uint8_t ch)
 get sample data from DMEM More...
 
void SDFM_setFilterOverSamplingRatio (sdfm_handle h_sdfm, uint16_t nc_osr)
 Configure iep count for normal current sampling. More...
 
uint32_t SDFM_getFirmwareVersion (sdfm_handle h_sdfm)
 Return Firmware version. More...
 
void SDFM_configFastDetect (sdfm_handle h_sdfm, uint8_t ch, uint8_t *fdParms)
 This API Configure Fast detect block fields. More...
 
int32_t SDFM_getFastDetectErrorStatus (sdfm_handle h_sdfm, uint8_t chNum)
 This API returns the fast detect error status for specified SDFM channel number. More...
 
int32_t SDFM_clearPwmTripStatus (sdfm_handle h_sdfm, uint8_t chNum)
 Clear PWM trip status of the corresponding PWM trip zone block for specified SDFM channel number. More...
 
void SDFM_enableContinuousNormalCurrent (sdfm_handle h_sdfm)
 This API enables continuous normal current sampling. More...
 
void SDFM_enableLoadShareMode (sdfm_handle h_sdfm, uint8_t sliceId)
 This API enables load share mode. More...
 
void SDFM_measureClockPhaseDelay (sdfm_handle h_sdfm, uint16_t clEdg)
 Measure Clock phase compensation. More...
 
float SDFM_getClockPhaseDelay (sdfm_handle h_sdfm)
 This API returns Clock phase compensation. More...
 
uint8_t SDFM_getLowThresholdStatus (sdfm_handle h_sdfm, uint8_t chNum)
 This API returns Low threshold Status for specified SDFM channel number. More...
 
uint8_t SDFM_getHighThresholdStatus (sdfm_handle h_sdfm, uint8_t chNum)
 This API returns high threshold Status for specified SDFM channel number. More...
 
int32_t SDFM_clearOverCurrentError (sdfm_handle h_sdfm, uint8_t chNum)
 This API clears Overcurrent error bit of corresponding PWM register for specified SDFM channel number. More...
 
void SDFM_enableZeroCrossDetection (sdfm_handle h_sdfm, uint8_t chNum, uint32_t zcThr)
 This API enables zero cross detection for specified SDFM channel number. More...
 
uint8_t SDFM_getZeroCrossThresholdStatus (sdfm_handle h_sdfm, uint8_t chNum)
 This API returns Zero cross Status for specified SDFM channel number. More...
 
void SDFM_disableZeroCrossDetection (sdfm_handle h_sdfm, uint8_t chNum)
 This API disbales zero cross detection for specified SDFM channel number. More...
 

Typedefs

typedef SDFMsdfm_handle
 

Macros

#define NUM_PRU   ( 2 )
 
#define PRU_ID_0   ( 0 ) /* PRU 0 ID */
 
#define PRU_ID_1   ( 1 ) /* PRU 1 ID */
 
#define PRUx_DMEM_BASE_ADD   (0x00)
 
#define RTUx_DMEM_BASE_ADD   (0x200)
 
#define TXPRUx_DMEM_BASE_ADD   (0x400)
 
#define NUM_SD_CH   ( ICSSG_NUM_SD_CH )
 
#define SDFM_EVT   ( TRIGGER_HOST_SDFM_EVT )
 

Macro Definition Documentation

◆ NUM_PRU

#define NUM_PRU   ( 2 )

◆ PRU_ID_0

#define PRU_ID_0   ( 0 ) /* PRU 0 ID */

◆ PRU_ID_1

#define PRU_ID_1   ( 1 ) /* PRU 1 ID */

◆ PRUx_DMEM_BASE_ADD

#define PRUx_DMEM_BASE_ADD   (0x00)

◆ RTUx_DMEM_BASE_ADD

#define RTUx_DMEM_BASE_ADD   (0x200)

◆ TXPRUx_DMEM_BASE_ADD

#define TXPRUx_DMEM_BASE_ADD   (0x400)

◆ NUM_SD_CH

#define NUM_SD_CH   ( ICSSG_NUM_SD_CH )

◆ SDFM_EVT

#define SDFM_EVT   ( TRIGGER_HOST_SDFM_EVT )

Typedef Documentation

◆ sdfm_handle

typedef SDFM* sdfm_handle

Function Documentation

◆ SDFM_init()

sdfm_handle SDFM_init ( uint8_t  pru_id,
uint8_t  coreId 
)

Initialize SDFM instance.

Parameters
[in]pru_idPru slice id
[in]coreIdPru core id
Return values
sdfmSDFM instance handle

◆ SDFM_configIepCount()

void SDFM_configIepCount ( sdfm_handle  h_sdfm,
uint32_t  epwm_out_freq 
)

Configure iep increment & iep count in one epwm cycle.

Parameters
[in]h_sdfmSDFM handle
[in]epwm_out_freqepwm output frequency

◆ SDFM_configEcap()

void SDFM_configEcap ( sdfm_handle  h_sdfm,
uint8_t  ecap_divider 
)

Configure ecap parameters for generate 20MHz SD clock.

Parameters
[in]h_sdfmSDFM handle
[in]ecap_dividerecap divider for sdfm clock

◆ SDFM_setEnableChannel()

void SDFM_setEnableChannel ( sdfm_handle  h_sdfm,
uint8_t  channel_number 
)

Enable the channel specified by the channel number parameter.

Parameters
[in]h_sdfmSDFM handle
[in]channel_numberchannel number

◆ SDFM_setCompFilterOverSamplingRatio()

void SDFM_setCompFilterOverSamplingRatio ( sdfm_handle  h_sdfm,
uint8_t  ch_id,
uint16_t  osr 
)

Configure comparator filter (over current) sampling ratio.

Parameters
[in]h_sdfmSDFM handle
[in]ch_idcurrent ch number
[in]osrcomparator filter/Over current sampling ratio

◆ SDFM_enable()

void SDFM_enable ( sdfm_handle  h_sdfm)

SDFM global enable.

Parameters
[in]h_sdfmSDFM handle

◆ SDFM_setCompFilterThresholds()

void SDFM_setCompFilterThresholds ( sdfm_handle  h_sdfm,
uint8_t  ch_id,
SDFM_ThresholdParms  thresholdParms 
)

configuration of SDFM threshold values

Parameters
[in]h_sdfmSDFM handle
[in]ch_idcurrent ch number
[in]thresholdParmsthresholds parametrs (High and Low )

◆ SDFM_setSampleTriggerTime()

void SDFM_setSampleTriggerTime ( sdfm_handle  h_sdfm,
float  samp_trig_time 
)

configuration of single sample trigger time one Epwm cycle

Parameters
[in]h_sdfmSDFM handle
[in]samp_trig_timefirst sample trigger time in one pwm cycle

◆ SDFM_enableDoubleSampling()

void SDFM_enableDoubleSampling ( sdfm_handle  h_sdfm,
float  samp_trig_time 
)

configuration and enable second normal current sample starting time one Epwm cycle

Parameters
[in]h_sdfmSDFM handle
[in]samp_trig_timesecond sample trigger time in one PWM cycle

◆ SDFM_disableDoubleSampling()

void SDFM_disableDoubleSampling ( sdfm_handle  h_sdfm)

Disable double normal current update/sampling.

Parameters
[in]h_sdfmSDFM handle

◆ SDFM_configDataFilter()

void SDFM_configDataFilter ( sdfm_handle  h_sdfm,
uint8_t  ch_id,
uint8_t  filter 
)

configuration of SDFM channel Acc source (sync filter type).
Current SDFM firmware implementation support only SYNC3 filter

Parameters
[in]h_sdfmSDFM handle
[in]ch_idcurrent ch number
[in]filterfilter type (acc source)

◆ SDFM_selectClockSource()

void SDFM_selectClockSource ( sdfm_handle  h_sdfm,
uint8_t  ch_id,
SDFM_ClkSourceParms  clkPrams 
)

configuration of SDFM channel clock source & clock inversion

Parameters
[in]h_sdfmSDFM handle
[in]ch_idcurrent ch number
[in]clkPramschannel clock source type & clock inversion

◆ SDFM_enableComparator()

void SDFM_enableComparator ( sdfm_handle  h_sdfm,
uint8_t  ch 
)

This API enables the Comparator for the selected channel.

Parameters
[in]h_sdfmSDFM handle
[in]chcurrent ch number

◆ SDFM_disableComparator()

void SDFM_disableComparator ( sdfm_handle  h_sdfm,
uint8_t  ch 
)

This API disables the Comparator for the selected channel.

Parameters
[in]h_sdfmSDFM handle
[in]chcurrent ch number

◆ SDFM_configComparatorGpioPins()

void SDFM_configComparatorGpioPins ( sdfm_handle  h_sdfm,
uint8_t  ch,
uint32_t  gpio_base_addr,
uint32_t  pin_number 
)

configure GPIO pin number and address for associate Channel Number

Parameters
[in]h_sdfmSDFM handle
[in]chcurrent ch number
[in]gpio_base_addrGPIO bas address
[in]pin_numberGPIO PIN number

◆ SDFM_getFilterData()

uint32_t SDFM_getFilterData ( sdfm_handle  h_sdfm,
uint8_t  ch 
)

get sample data from DMEM

Parameters
[in]h_sdfmSDFM handle
[in]chcurrent ch number
Return values
currentsample value

◆ SDFM_setFilterOverSamplingRatio()

void SDFM_setFilterOverSamplingRatio ( sdfm_handle  h_sdfm,
uint16_t  nc_osr 
)

Configure iep count for normal current sampling.

Parameters
[in]h_sdfmSDFM handle
[in]nc_osrNormal current osr value

◆ SDFM_getFirmwareVersion()

uint32_t SDFM_getFirmwareVersion ( sdfm_handle  h_sdfm)

Return Firmware version.

Parameters
[in]h_sdfmSDFM handle
Return values
firmwareVersionrelease vesrion of firmware

◆ SDFM_configFastDetect()

void SDFM_configFastDetect ( sdfm_handle  h_sdfm,
uint8_t  ch,
uint8_t *  fdParms 
)

This API Configure Fast detect block fields.

Parameters
[in]h_sdfmSDFM handle
[in]chcurrent ch number
[in]fdParmsarray of fast detect fields. {window size, zero max count, zero min count, one max count, one min count}

◆ SDFM_getFastDetectErrorStatus()

int32_t SDFM_getFastDetectErrorStatus ( sdfm_handle  h_sdfm,
uint8_t  chNum 
)

This API returns the fast detect error status for specified SDFM channel number.

Parameters
[in]h_sdfmSDFM handle
[in]chNumSDFM channel number : Channel0-Channel8
Return values
stautsof fd error: 1 means error available & 0 means no error, SystemP_FAILURE on not expected API parameters

◆ SDFM_clearPwmTripStatus()

int32_t SDFM_clearPwmTripStatus ( sdfm_handle  h_sdfm,
uint8_t  chNum 
)

Clear PWM trip status of the corresponding PWM trip zone block for specified SDFM channel number.

Parameters
[in]h_sdfmSDFM handle
[in]chNumSDFM channel number : Channel0-Channel8
Return values
SystemP_SUCCESSon success, SystemP_FAILURE on error or not expected API parameters

◆ SDFM_enableContinuousNormalCurrent()

void SDFM_enableContinuousNormalCurrent ( sdfm_handle  h_sdfm)

This API enables continuous normal current sampling.

Parameters
[in]h_sdfmSDFM handle

◆ SDFM_enableLoadShareMode()

void SDFM_enableLoadShareMode ( sdfm_handle  h_sdfm,
uint8_t  sliceId 
)

This API enables load share mode.

Parameters
[in]h_sdfmSDFM handle
[in]sliceIdslice ID

◆ SDFM_measureClockPhaseDelay()

void SDFM_measureClockPhaseDelay ( sdfm_handle  h_sdfm,
uint16_t  clEdg 
)

Measure Clock phase compensation.

Parameters
[in]h_sdfmSDFM handle
[in]clEdgClock polarity: 1 -> falling edge, 0 -> raising edge

◆ SDFM_getClockPhaseDelay()

float SDFM_getClockPhaseDelay ( sdfm_handle  h_sdfm)

This API returns Clock phase compensation.

Parameters
[in]h_sdfmSDFM handle
Return values
Phasedelay in nano sec

◆ SDFM_getLowThresholdStatus()

uint8_t SDFM_getLowThresholdStatus ( sdfm_handle  h_sdfm,
uint8_t  chNum 
)

This API returns Low threshold Status for specified SDFM channel number.

Parameters
[in]h_sdfmSDFM handle
[in]chNumSDFM channel number : Channel0-Channel8
Return values
Statusof Over current error for Low threshold

◆ SDFM_getHighThresholdStatus()

uint8_t SDFM_getHighThresholdStatus ( sdfm_handle  h_sdfm,
uint8_t  chNum 
)

This API returns high threshold Status for specified SDFM channel number.

Parameters
[in]h_sdfmSDFM handle
[in]chNumSDFM channel number : Channel0-Channel8
Return values
Statusof over current error for High Threshold

◆ SDFM_clearOverCurrentError()

int32_t SDFM_clearOverCurrentError ( sdfm_handle  h_sdfm,
uint8_t  chNum 
)

This API clears Overcurrent error bit of corresponding PWM register for specified SDFM channel number.

Parameters
[in]h_sdfmSDFM handle
[in]chNumSDFM channel number : Channel0-Channel8
Return values
SystemP_SUCCESSon success, SystemP_FAILURE on not expected API parameters

◆ SDFM_enableZeroCrossDetection()

void SDFM_enableZeroCrossDetection ( sdfm_handle  h_sdfm,
uint8_t  chNum,
uint32_t  zcThr 
)

This API enables zero cross detection for specified SDFM channel number.

Parameters
[in]h_sdfmSDFM handle
[in]chNumSDFM channel number : Channel0-Channel8
[in]zcThrzero cross threshold

◆ SDFM_getZeroCrossThresholdStatus()

uint8_t SDFM_getZeroCrossThresholdStatus ( sdfm_handle  h_sdfm,
uint8_t  chNum 
)

This API returns Zero cross Status for specified SDFM channel number.

Parameters
[in]h_sdfmSDFM handle
[in]chNumSDFM channel number : Channel0-Channel8
Return values
Statusof zero cross

◆ SDFM_disableZeroCrossDetection()

void SDFM_disableZeroCrossDetection ( sdfm_handle  h_sdfm,
uint8_t  chNum 
)

This API disbales zero cross detection for specified SDFM channel number.

Parameters
[in]h_sdfmSDFM handle
[in]chNumSDFM channel number : Channel0-Channel8