45 #include "sw/modules/types/src/types.h"
70 #define CLK_BASE_ADDR (0x00007010)
74 #define CLK_PCLKCR0_HRPWMENCLK_BITS (1 << 0)
78 #define CLK_PCLKCR0_LINAENCLK_BITS (1 << 1)
82 #define CLK_PCLKCR0_TBCLKSYNC_BITS (1 << 2)
86 #define CLK_PCLKCR0_ADCENCLK_BITS (1 << 3)
90 #define CLK_PCLKCR0_I2CAENCLK_BITS (1 << 4)
94 #define CLK_PCLKCR0_SPIAENCLK_BITS (1 << 8)
98 #define CLK_PCLKCR0_SPIBENCLK_BITS (1 << 9)
102 #define CLK_PCLKCR0_SCIAENCLK_BITS (1 << 10)
106 #define CLK_PCLKCR0_SCIBENCLK_BITS (1 << 11)
110 #define CLK_PCLKCR0_ECANAENCLK_BITS (1 << 14)
115 #define CLK_PCLKCR1_EPWM1ENCLK_BITS (1 << 0)
119 #define CLK_PCLKCR1_EPWM2ENCLK_BITS (1 << 1)
123 #define CLK_PCLKCR1_EPWM3ENCLK_BITS (1 << 2)
127 #define CLK_PCLKCR1_EPWM4ENCLK_BITS (1 << 3)
131 #define CLK_PCLKCR1_EPWM5ENCLK_BITS (1 << 4)
135 #define CLK_PCLKCR1_EPWM6ENCLK_BITS (1 << 5)
139 #define CLK_PCLKCR1_EPWM7ENCLK_BITS (1 << 6)
143 #define CLK_PCLKCR1_ECAP1ENCLK_BITS (1 << 8)
147 #define CLK_PCLKCR1_EQEP1ENCLK_BITS (1 << 14)
151 #define CLK_PCLKCR1_EQEP2ENCLK_BITS (1 << 15)
155 #define CLK_PCLKCR3_COMP1ENCLK_BITS (1 << 0)
159 #define CLK_PCLKCR3_COMP2ENCLK_BITS (1 << 1)
163 #define CLK_PCLKCR3_COMP3ENCLK_BITS (1 << 2)
167 #define CLK_PCLKCR3_CPUTIMER0ENCLK_BITS (1 << 8)
171 #define CLK_PCLKCR3_CPUTIMER1ENCLK_BITS (1 << 9)
175 #define CLK_PCLKCR3_CPUTIMER2ENCLK_BITS (1 << 10)
179 #define CLK_PCLKCR3_GPIOINENCLK_BITS (1 << 13)
183 #define CLK_PCLKCR3_CLA1ENCLK_BITS (1 << 14)
188 #define CLK_LOSPCP_LSPCLK_BITS (7 << 0)
193 #define CLK_XCLK_XCLKOUTDIV_BITS (3 << 0)
197 #define CLK_XCLK_XCLKINSEL_BITS (1 << 6)
202 #define CLK_CLKCTL_OSCCLKSRCSEL_BITS (1 << 0)
206 #define CLK_CLKCTL_OSCCLKSRC2SEL_BITS (1 << 1)
210 #define CLK_CLKCTL_WDCLKSRCSEL_BITS (1 << 2)
214 #define CLK_CLKCTL_TMR2CLKSRCSEL_BITS (3 << 3)
218 #define CLK_CLKCTL_TMR2CLKPRESCALE_BITS (7 << 5)
222 #define CLK_CLKCTL_INTOSC1OFF_BITS (1 << 8)
226 #define CLK_CLKCTL_INTOSC1HALTI_BITS (1 << 9)
230 #define CLK_CLKCTL_INTOSC2OFF_BITS (1 << 10)
234 #define CLK_CLKCTL_INTOSC2HALTI_BITS (1 << 11)
238 #define CLK_CLKCTL_WDHALTI_BITS (1 << 12)
242 #define CLK_CLKCTL_XCLKINOFF_BITS (1 << 13)
246 #define CLK_CLKCTL_XTALOSCOFF_BITS (1 << 14)
250 #define CLK_CLKCTL_NMIRESETSEL_BITS (1 << 15)
651 extern CLK_Handle
CLK_init(
void *pMemory,
const size_t numBytes);
710 #endif // end of _CLK_H_ definition
CLK_XClkInSrc_e
Enumeration to define the clock in source.
void CLK_disableCpuTimerClock(CLK_Handle clkHandle, const CLK_CpuTimerNumber_e cpuTimerNumber)
Disables the CPU timer clock.
volatile uint16_t rsvd_2[8]
Reserved.
Denotes Low Speed Clock = SYSCLKOUT/1.
void CLK_disableAdcClock(CLK_Handle clkHandle)
Disables the ADC clock.
Defines the clock (CLK) object.
void CLK_enableSpiaClock(CLK_Handle clkHandle)
Enables the SPI-A clock.
CLK_Osc2Src_e
Enumeration to define the clock oscillator 2 source.
Contains public interface to various functions related to the pulse width modulation (PWM) object...
Denotes the watchdog clock source is internal oscillator 1.
void CLK_disableSpibClock(CLK_Handle clkHandle)
Disables the SPI-B clock.
void CLK_setXClkInSrc(CLK_Handle clkHandle, const CLK_XClkInSrc_e src)
Sets the XCLKIN Clock Source.
Denotes Low Speed Clock = SYSCLKOUT/14.
void CLK_disableTbClockSync(CLK_Handle clkHandle)
Disables the ePWM module time base clock sync signal.
Denotes an external oscillator source.
void CLK_enableTbClockSync(CLK_Handle clkHandle)
Enables the ePWM module time base clock sync signal.
void CLK_disableEqep1Clock(CLK_Handle clkHandle)
Disables the EQEP1 clock.
void CLK_setOscSrc(CLK_Handle clkHandle, const CLK_OscSrc_e src)
Sets the oscillator clock source.
Denotes a CPU timer 2 clock pre-scaler value of divide by 16.
void CLK_setWatchDogSrc(CLK_Handle clkHandle, const CLK_WdClkSrc_e src)
Sets the watchdog clock source.
void CLK_enableClkIn(CLK_Handle clkHandle)
Enables the XCLKIN oscillator input.
Denotes the CPU timer 2 clock source is external oscillator.
void CLK_disableEcanaClock(CLK_Handle clkHandle)
Disables the ECANA clock.
Denotes Low Speed Clock = SYSCLKOUT/12.
void CLK_enableSciaClock(CLK_Handle clkHandle)
Enables the SCI-A clock.
Denotes comparator number 1.
Denotes an internal oscillator 2 source.
void CLK_enableCpuTimerClock(CLK_Handle clkHandle, const CLK_CpuTimerNumber_e cpuTimerNumber)
Enables the CPU timer clock.
void CLK_enableWatchDogHaltMode(CLK_Handle clkHandle)
Enables the watchdog halt mode ignore.
CLK_LowSpdPreScaler_e
Enumeration to define the low speed clock prescaler, which sets the clock frequency.
void CLK_setTimer2PreScaler(CLK_Handle clkHandle, const CLK_Timer2PreScaler_e preScaler)
Sets the timer 2 clock prescaler.
struct _CLK_Obj_ CLK_Obj
Defines the clock (CLK) object.
Denotes Low Speed Clock = SYSCLKOUT/10.
Denotes CPU timer number 0.
Denotes the CPU timer 2 clock source is SYSCLKOUT.
void CLK_disableScibClock(CLK_Handle clkHandle)
Disables the SCI-B clock.
void CLK_enableCompClock(CLK_Handle clkHandle, const CLK_CompNumber_e compNumber)
Enables the comparator clock.
Denotes a CPU timer 2 clock pre-scaler value of divide by 4.
void CLK_enableOsc2(CLK_Handle clkHandle)
Enables internal oscillator 2.
void CLK_disableClkIn(CLK_Handle clkHandle)
Disables the XCLKIN oscillator input.
void CLK_enableScibClock(CLK_Handle clkHandle)
Enables the SCI-B clock.
CLK_Handle CLK_init(void *pMemory, const size_t numBytes)
Initializes the clock (CLK) object handle.
volatile uint16_t rsvd_3[2]
Reserved.
Denotes Low Speed Clock = SYSCLKOUT/6.
Denotes XCLKOUT = SYSCLKOUT/4.
void CLK_enableClaClock(CLK_Handle clkHandle)
Enables the CLA clock.
void CLK_setTimer2Src(CLK_Handle clkHandle, const CLK_Timer2Src_e src)
Sets the timer 2 clock source.
volatile uint16_t LOSPCP
Low-Speed Peripheral Clock Pre-Scaler Register.
void CLK_setOsc2Src(CLK_Handle clkHandle, const CLK_Osc2Src_e src)
Sets the oscillator 2 clock source.
CLK_CompNumber_e
Enumeration to define the comparator numbers.
Denotes a CPU timer 2 clock pre-scaler value of divide by 2.
Denotes Low Speed Clock = SYSCLKOUT/4.
CLK_ClkOutPreScaler_e
Enumeration to define the external clock output frequency.
struct _CLK_Obj_ * CLK_Handle
Defines the clock (CLK) handle.
void CLK_enableSpibClock(CLK_Handle clkHandle)
Enables the SPI-B clock.
void CLK_enableGpioInputClock(CLK_Handle clkHandle)
Enables the GPIO input clock.
CLK_Timer2PreScaler_e
Enumeration to define the timer 2 prescaler, which sets the timer 2 frequency.
void CLK_enableEqep2Clock(CLK_Handle clkHandle)
Enables the EQEP2 clock.
Denotes an internal oscillator source.
void CLK_disableOsc2HaltMode(CLK_Handle clkHandle)
Disables internal oscillator 2 halt mode ignore.
void CLK_disablePwmClock(CLK_Handle clkHandle, const PWM_Number_e pwmNumber)
Disables the pwm clock.
void CLK_enableEqep1Clock(CLK_Handle clkHandle)
Enables the EQEP1 clock.
void CLK_enableLinAClock(CLK_Handle clkHandle)
Enables the LIN-A clock.
Denotes comparator number 3.
void CLK_setLowSpdPreScaler(CLK_Handle clkHandle, const CLK_LowSpdPreScaler_e preScaler)
Sets the low speed peripheral clock prescaler.
void CLK_disableI2cClock(CLK_Handle clkHandle)
Disables the I2C clock.
CLK_Timer2Src_e
Enumeration to define the timer 2 source.
volatile uint16_t XCLK
XCLKOUT/XCLKIN Control.
void CLK_disableSpiaClock(CLK_Handle clkHandle)
Disables the SPI-A clock.
void CLK_enableOsc1(CLK_Handle clkHandle)
Enables internal oscillator 1.
void CLK_enableEcap1Clock(CLK_Handle clkHandle)
Enables the ECAP1 clock.
void CLK_disableOsc1HaltMode(CLK_Handle clkHandle)
Disables internal oscillator 1 halt mode ignore.
Denotes XCLKOUT = SYSCLKOUT/2.
Denotes Low Speed Clock = SYSCLKOUT/8.
void CLK_disableSciaClock(CLK_Handle clkHandle)
Disables the SCI-A clock.
Contains public interface to various functions related to the central processing unit (CPU) object...
void CLK_enableEcanaClock(CLK_Handle clkHandle)
Enables the ECANA clock.
void CLK_disableEqep2Clock(CLK_Handle clkHandle)
Disables the EQEP2 clock.
volatile uint16_t PCLKCR1
Peripheral Clock Control Register 1.
void CLK_disableClaClock(CLK_Handle clkHandle)
Disables the CLA clock.
Denotes a CPU timer 2 clock pre-scaler value of divide by 1.
Denotes the watchdog clock source is external oscillator or internal oscillator 2.
Denotes the CPU timer 2 clock source is internal oscillator 1.
CLK_WdClkSrc_e
Enumeration to define the watchdog clock source.
void CLK_disableEcap1Clock(CLK_Handle clkHandle)
Disables the ECAP1 clock.
Denotes the CPU timer 2 clock source is internal oscillator 2.
void CLK_enableI2cClock(CLK_Handle clkHandle)
Enables the I2C clock.
volatile uint16_t CLKCTL
Clock Control Register.
Denotes CPU timer number 1.
void CLK_enableOsc1HaltMode(CLK_Handle clkHandle)
Enables internal oscillator 1 halt mode ignore.
Denotes CPU timer number 2.
void CLK_enableCrystalOsc(CLK_Handle clkHandle)
Enables the crystal oscillator.
volatile uint16_t rsvd_1
Reserved.
Denotes comparator number 2.
void CLK_disableLinAClock(CLK_Handle clkHandle)
Disables the LIN-A clock.
void CLK_disableGpioInputClock(CLK_Handle clkHandle)
Disables the GPIO input clock.
void CLK_setClkOutPreScaler(CLK_Handle clkHandle, const CLK_ClkOutPreScaler_e preScaler)
Sets the external clock out prescaler.
void CLK_disableWatchDogHaltMode(CLK_Handle clkHandle)
Disables the watchdog halt mode ignore.
volatile uint16_t PCLKCR3
Peripheral Clock Control Register 3.
void CLK_disableCompClock(CLK_Handle clkHandle, const CLK_CompNumber_e compNumber)
Disables the comparator clock.
volatile uint16_t PCLKCR0
Peripheral Clock Control Register 0.
void CLK_enableOsc2HaltMode(CLK_Handle clkHandle)
Enables internal oscillator 2 halt mode ignore.
CLK_CpuTimerNumber_e
Enumeration to define the CPU timer numbers.
void CLK_enableAdcClock(CLK_Handle clkHandle)
Enables the ADC clock.
PWM_Number_e
Enumeration to define the pulse width modulation (PWM) numbers.
void CLK_disableOsc2(CLK_Handle clkHandle)
Disables internal oscillator 2.
void CLK_enablePwmClock(CLK_Handle clkHandle, const PWM_Number_e pwmNumber)
Enables the pwm clock.
void CLK_disableHrPwmClock(CLK_Handle clkHandle)
Disables the HRPWM clock.
CLK_OscSrc_e
Enumeration to define the clock oscillator source.
Denotes an external oscillator 2 source.
Denotes a CPU timer 2 clock pre-scaler value of divide by 8.
void CLK_disableCrystalOsc(CLK_Handle clkHandle)
Disables the crystal oscillator.
Denotes XCLKOUT = SYSCLKOUT/1.
Denotes Low Speed Clock = SYSCLKOUT/2.
void CLK_enableHrPwmClock(CLK_Handle clkHandle)
Enables the HRPWM clock.
void CLK_disableOsc1(CLK_Handle clkHandle)
Disables internal oscillator 1.