AM62Ax MCU+ SDK  10.01.00
APIs for SDL Dual Clock Comparator(DCC)

Introduction

This module contains APIs for using the DCC module. The APIs can be used to configure the DCC instances on the device.

Data Structures

struct  SDL_DCC_Config
 Structure containing parameters for DCC module configuration. More...
 
struct  SDL_DCC_Status
 Structure containing DCC status. More...
 
struct  SDL_DCC_StaticRegs
 Structure containing DCC Static Registers. More...
 

Functions

int32_t SDL_DCC_configure (SDL_DCC_Inst instance, const SDL_DCC_Config *pConfig)
 This API is used to configure DCC module. More...
 
int32_t SDL_DCC_verifyConfig (SDL_DCC_Inst instance, const SDL_DCC_Config *pConfig)
 This API is used to verify the configuration for DCC module. More...
 
int32_t SDL_DCC_enable (SDL_DCC_Inst instance)
 This API is used to enable the DCC module. More...
 
int32_t SDL_DCC_disable (SDL_DCC_Inst instance)
 This API is used to disable the DCC module. More...
 
int32_t SDL_DCC_getStatus (SDL_DCC_Inst instance, SDL_DCC_Status *pStatus)
 This API is used to get the stauts of DCC module. More...
 
int32_t SDL_DCC_enableIntr (SDL_DCC_Inst instance, SDL_DCC_IntrType intr)
 This API is used to Enable the interrupts. More...
 
int32_t SDL_DCC_disableIntr (SDL_DCC_Inst instance, SDL_DCC_IntrType intr)
 This API is used to Disable the interrupts. More...
 
int32_t SDL_DCC_clearIntr (SDL_DCC_Inst instance, SDL_DCC_IntrType intr)
 This API is used to clear the interrupts. More...
 
int32_t SDL_DCC_getStaticRegs (SDL_DCC_Inst instance, SDL_DCC_StaticRegs *pStaticRegs)
 This API is used to get the value of static registers for DCC module. More...
 

Enumerations

enum  SDL_DCC_Inst {
  SDL_DCC_INST_DCC0, SDL_DCC_INST_DCC1, SDL_DCC_INST_DCC2, SDL_DCC_INST_DCC3,
  SDL_DCC_INST_DCC4, SDL_DCC_INST_DCC5, SDL_DCC_INST_DCC6, SDL_DCC_INST_MCU_DCC0,
  SDL_DCC_INST_MCU_DCC1, SDL_DCC_INVALID_INSTANCE
}
 Enum for different DCC module instances supported. More...
 

Macros

#define DCC_SRC0_COUNT_MAX   (0xFFFFFU)
 Macro defines maximum value of count for clock source 0. More...
 
#define DCC_SRC0_VALID_MAX   (0x0FFFFU)
 Macro defines maximum value of valid count for clock source 0. More...
 
#define DCC_SRC1_COUNT_MAX   (0xFFFFFU)
 Macro defines maximum value of count for clock source 1. More...
 
#define DCC_MIN_CLK0_VLD_SEED   (4u)
 
#define SDL_DCC_CLK0_SRC_NUM   (3u)
 The number of valid Clk0 Src options. More...
 
#define SDL_DCC_CLK1_SRC_NUM   (10u)
 The number of valid clk1 Src options. More...
 
#define SDL_DCC_MODES_NUM   (3u)
 The number of valid mode options. More...
 
#define SDL_DCC_MAX_INSTANCE   (9U)
 MAX number of supported DCC Instances. More...
 

DCC Operation Mode

typedef uint32_t SDL_DCC_Mode
 Enum to select the DCC Operation Mode. DCC can either operate in single shot or continuous mode. More...
 
#define SDL_DCC_MODE_SINGLE_SHOT_1   (SDL_DCC2_DCCGCTRL_SINGLESHOT_MODE1)
 
#define SDL_DCC_MODE_SINGLE_SHOT_2   (SDL_DCC2_DCCGCTRL_SINGLESHOT_MODE2)
 
#define SDL_DCC_MODE_CONTINUOUS   (SDL_DCC2_DCCGCTRL_SINGLESHOT_DISABLE)
 

DCC Clock source of COUNT0

typedef uint32_t SDL_DCC_ClkSrc0
 Enum to select the COUNT0 clock source. More...
 
#define SDL_DCC_CLK0_SRC_CLOCK0_0   (SDL_DCC2_DCCCLKSRC0_CLKSRC0_0)
 
#define SDL_DCC_CLK0_SRC_CLOCK0_1   (SDL_DCC2_DCCCLKSRC0_CLKSRC0_1)
 
#define SDL_DCC_CLK0_SRC_CLOCK0_2   (SDL_DCC2_DCCCLKSRC0_CLKSRC0_2)
 
#define SDL_DCC_CLK0_SRC_CLOCK0_3   (SDL_DCC2_DCCCLKSRC0_CLKSRC0_3)
 

DCC Clock source of COUNT1

typedef uint32_t SDL_DCC_ClkSrc1
 Enum to select the COUNT1 clock source. More...
 
#define SDL_DCC_CLK1_SRC_CLOCK1   (SDL_DCC2_DCCCLKSRC1_CLKSRC_0)
 
#define SDL_DCC_CLK1_SRC_CLOCKSRC0   (SDL_DCC2_DCCCLKSRC1_CLKSRC_1)
 
#define SDL_DCC_CLK1_SRC_CLOCKSRC1   (SDL_DCC2_DCCCLKSRC1_CLKSRC_2)
 
#define SDL_DCC_CLK1_SRC_CLOCKSRC2   (SDL_DCC2_DCCCLKSRC1_CLKSRC_3)
 
#define SDL_DCC_CLK1_SRC_CLOCKSRC3   (SDL_DCC2_DCCCLKSRC1_CLKSRC_4)
 
#define SDL_DCC_CLK1_SRC_CLOCKSRC4   (SDL_DCC2_DCCCLKSRC1_CLKSRC_5)
 
#define SDL_DCC_CLK1_SRC_CLOCKSRC5   (SDL_DCC2_DCCCLKSRC1_CLKSRC_6)
 
#define SDL_DCC_CLK1_SRC_CLOCKSRC6   (SDL_DCC2_DCCCLKSRC1_CLKSRC_7)
 
#define SDL_DCC_CLK1_SRC_CLOCKSRC7   (SDL_DCC2_DCCCLKSRC1_CLKSRC_8)
 
#define SDL_DCC_CLK1_SRC_FICLK   (SDL_DCC2_DCCCLKSRC1_CLKSRC_OTHER)
 

DCC Interrupt type

typedef uint32_t SDL_DCC_IntrType
 Enum for DCC interrupts. More...
 
#define SDL_DCC_INTERRUPT_ERR   (0x0U)
 
#define SDL_DCC_INTERRUPT_DONE   (0x1U)
 

Macro Definition Documentation

◆ DCC_SRC0_COUNT_MAX

#define DCC_SRC0_COUNT_MAX   (0xFFFFFU)

Macro defines maximum value of count for clock source 0.

◆ DCC_SRC0_VALID_MAX

#define DCC_SRC0_VALID_MAX   (0x0FFFFU)

Macro defines maximum value of valid count for clock source 0.

◆ DCC_SRC1_COUNT_MAX

#define DCC_SRC1_COUNT_MAX   (0xFFFFFU)

Macro defines maximum value of count for clock source 1.

◆ DCC_MIN_CLK0_VLD_SEED

#define DCC_MIN_CLK0_VLD_SEED   (4u)

◆ SDL_DCC_CLK0_SRC_NUM

#define SDL_DCC_CLK0_SRC_NUM   (3u)

The number of valid Clk0 Src options.

◆ SDL_DCC_CLK1_SRC_NUM

#define SDL_DCC_CLK1_SRC_NUM   (10u)

The number of valid clk1 Src options.

◆ SDL_DCC_MODES_NUM

#define SDL_DCC_MODES_NUM   (3u)

The number of valid mode options.

◆ SDL_DCC_MODE_SINGLE_SHOT_1

#define SDL_DCC_MODE_SINGLE_SHOT_1   (SDL_DCC2_DCCGCTRL_SINGLESHOT_MODE1)

Stop counting when counter0 and valid0 both reach zero

◆ SDL_DCC_MODE_SINGLE_SHOT_2

#define SDL_DCC_MODE_SINGLE_SHOT_2   (SDL_DCC2_DCCGCTRL_SINGLESHOT_MODE2)

Stop counting when counter1 reaches zero

◆ SDL_DCC_MODE_CONTINUOUS

#define SDL_DCC_MODE_CONTINUOUS   (SDL_DCC2_DCCGCTRL_SINGLESHOT_DISABLE)

Continuously repeat (until error)

◆ SDL_DCC_CLK0_SRC_CLOCK0_0

#define SDL_DCC_CLK0_SRC_CLOCK0_0   (SDL_DCC2_DCCCLKSRC0_CLKSRC0_0)

SYS_CLK1 is selected as source for COUNT0

◆ SDL_DCC_CLK0_SRC_CLOCK0_1

#define SDL_DCC_CLK0_SRC_CLOCK0_1   (SDL_DCC2_DCCCLKSRC0_CLKSRC0_1)

SYS_CLK2 is selected as source for COUNT0

◆ SDL_DCC_CLK0_SRC_CLOCK0_2

#define SDL_DCC_CLK0_SRC_CLOCK0_2   (SDL_DCC2_DCCCLKSRC0_CLKSRC0_2)

XREF_CLK is selected as source for COUNT0

◆ SDL_DCC_CLK0_SRC_CLOCK0_3

#define SDL_DCC_CLK0_SRC_CLOCK0_3   (SDL_DCC2_DCCCLKSRC0_CLKSRC0_3)

FICLK is selected as source for COUNT0

◆ SDL_DCC_CLK1_SRC_CLOCK1

#define SDL_DCC_CLK1_SRC_CLOCK1   (SDL_DCC2_DCCCLKSRC1_CLKSRC_0)

TEST_CLK1 is selected as source for COUNT1

◆ SDL_DCC_CLK1_SRC_CLOCKSRC0

#define SDL_DCC_CLK1_SRC_CLOCKSRC0   (SDL_DCC2_DCCCLKSRC1_CLKSRC_1)

TEST_CLK0 is selected as source for COUNT1

◆ SDL_DCC_CLK1_SRC_CLOCKSRC1

#define SDL_DCC_CLK1_SRC_CLOCKSRC1   (SDL_DCC2_DCCCLKSRC1_CLKSRC_2)

TEST_CLK1 is selected as source for COUNT1

◆ SDL_DCC_CLK1_SRC_CLOCKSRC2

#define SDL_DCC_CLK1_SRC_CLOCKSRC2   (SDL_DCC2_DCCCLKSRC1_CLKSRC_3)

TEST_CLK2 is selected as source for COUNT1

◆ SDL_DCC_CLK1_SRC_CLOCKSRC3

#define SDL_DCC_CLK1_SRC_CLOCKSRC3   (SDL_DCC2_DCCCLKSRC1_CLKSRC_4)

TEST_CLK3 is selected as source for COUNT1

◆ SDL_DCC_CLK1_SRC_CLOCKSRC4

#define SDL_DCC_CLK1_SRC_CLOCKSRC4   (SDL_DCC2_DCCCLKSRC1_CLKSRC_5)

TEST_CLK4 is selected as source for COUNT1

◆ SDL_DCC_CLK1_SRC_CLOCKSRC5

#define SDL_DCC_CLK1_SRC_CLOCKSRC5   (SDL_DCC2_DCCCLKSRC1_CLKSRC_6)

TEST_CLK5 is selected as source for COUNT1

◆ SDL_DCC_CLK1_SRC_CLOCKSRC6

#define SDL_DCC_CLK1_SRC_CLOCKSRC6   (SDL_DCC2_DCCCLKSRC1_CLKSRC_7)

TEST_CLK6 is selected as source for COUNT1

◆ SDL_DCC_CLK1_SRC_CLOCKSRC7

#define SDL_DCC_CLK1_SRC_CLOCKSRC7   (SDL_DCC2_DCCCLKSRC1_CLKSRC_8)

TEST_CLK7 is selected as source for COUNT1

◆ SDL_DCC_CLK1_SRC_FICLK

#define SDL_DCC_CLK1_SRC_FICLK   (SDL_DCC2_DCCCLKSRC1_CLKSRC_OTHER)

FICLK is selected as source for COUNT1

◆ SDL_DCC_INTERRUPT_ERR

#define SDL_DCC_INTERRUPT_ERR   (0x0U)

The error signal

◆ SDL_DCC_INTERRUPT_DONE

#define SDL_DCC_INTERRUPT_DONE   (0x1U)

Done interrupt signal

◆ SDL_DCC_MAX_INSTANCE

#define SDL_DCC_MAX_INSTANCE   (9U)

MAX number of supported DCC Instances.

Typedef Documentation

◆ SDL_DCC_Mode

typedef uint32_t SDL_DCC_Mode

Enum to select the DCC Operation Mode. DCC can either operate in single shot or continuous mode.

◆ SDL_DCC_ClkSrc0

typedef uint32_t SDL_DCC_ClkSrc0

Enum to select the COUNT0 clock source.

◆ SDL_DCC_ClkSrc1

typedef uint32_t SDL_DCC_ClkSrc1

Enum to select the COUNT1 clock source.

◆ SDL_DCC_IntrType

typedef uint32_t SDL_DCC_IntrType

Enum for DCC interrupts.

Enumeration Type Documentation

◆ SDL_DCC_Inst

Enum for different DCC module instances supported.

Enumerator
SDL_DCC_INST_DCC0 

DCC0 Instance

SDL_DCC_INST_DCC1 

DCC1 Instance

SDL_DCC_INST_DCC2 

DCC2 Instance

SDL_DCC_INST_DCC3 

DCC3 Instance

SDL_DCC_INST_DCC4 

DCC4 Instance

SDL_DCC_INST_DCC5 

DCC5 Instance

SDL_DCC_INST_DCC6 

DCC5 Instance

SDL_DCC_INST_MCU_DCC0 

MCU DCC0 Instance

SDL_DCC_INST_MCU_DCC1 

MCU DCC0 Instance

SDL_DCC_INVALID_INSTANCE 

Invalid Instance

Function Documentation

◆ SDL_DCC_configure()

int32_t SDL_DCC_configure ( SDL_DCC_Inst  instance,
const SDL_DCC_Config pConfig 
)

This API is used to configure DCC module.

Parameters
instanceHolds the instance for DCC module.
pConfigpointer to the DCC config structure

NOTE: If the value of 'seedValid0' is less then 4 then it will programmed as 4. Since minimum programmable value of the 'seedValid0' is 4.

◆ SDL_DCC_verifyConfig()

int32_t SDL_DCC_verifyConfig ( SDL_DCC_Inst  instance,
const SDL_DCC_Config pConfig 
)

This API is used to verify the configuration for DCC module.

Parameters
instanceHolds the instance for DCC module.
pConfigpointer to the DCC config structure

◆ SDL_DCC_enable()

int32_t SDL_DCC_enable ( SDL_DCC_Inst  instance)

This API is used to enable the DCC module.

Parameters
instanceHolds the instance for DCC module.

◆ SDL_DCC_disable()

int32_t SDL_DCC_disable ( SDL_DCC_Inst  instance)

This API is used to disable the DCC module.

Parameters
instanceHolds the instance for DCC module.

◆ SDL_DCC_getStatus()

int32_t SDL_DCC_getStatus ( SDL_DCC_Inst  instance,
SDL_DCC_Status pStatus 
)

This API is used to get the stauts of DCC module.

Parameters
instanceHolds the instance for DCC module.
pStatuspointer to the SDL_DCC_status structure

◆ SDL_DCC_enableIntr()

int32_t SDL_DCC_enableIntr ( SDL_DCC_Inst  instance,
SDL_DCC_IntrType  intr 
)

This API is used to Enable the interrupts.

Parameters
instanceHolds the instance for DCC module.
intrInterrupts to be enabled.

◆ SDL_DCC_disableIntr()

int32_t SDL_DCC_disableIntr ( SDL_DCC_Inst  instance,
SDL_DCC_IntrType  intr 
)

This API is used to Disable the interrupts.

Parameters
instanceHolds the instance for DCC module.
intrInterrupts to be enabled.

◆ SDL_DCC_clearIntr()

int32_t SDL_DCC_clearIntr ( SDL_DCC_Inst  instance,
SDL_DCC_IntrType  intr 
)

This API is used to clear the interrupts.

Parameters
instanceHolds the instance for DCC module.
intrInterrupts to disable.

◆ SDL_DCC_getStaticRegs()

int32_t SDL_DCC_getStaticRegs ( SDL_DCC_Inst  instance,
SDL_DCC_StaticRegs pStaticRegs 
)

This API is used to get the value of static registers for DCC module.

Parameters
instanceHolds the instance for DCC module.
pStaticRegsPointer to the SDL_DCC_StaticRegs structure.