Kinetis SDK v.1.3 API Reference Manual  Rev. 0
Freescale Semiconductor, Inc.
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
PCC HAL driver

Overview

Enumerations

enum  clock_ip_src_t {
  kClockIpSrcNone = 0U,
  kClockIpSrcSysOsc = 1U,
  kClockIpSrcSIrc = 2U,
  kClockIpSrcFIrc = 3U,
  kClockIpSrcRtcOsc = 4U,
  kClockIpSrcSysFll = 5U,
  kClockIpSrcSysPll = 6U,
  kClockIpSrcPerPll = 7U,
  kClockIpSrcMax = 8U
}
 Clock source for peripherals that support various clock selections. More...
 

Functions

static void CLOCK_HAL_EnableClock (PCC_Type *base, uint8_t index)
 Enables the clock for an IP module. More...
 
static void CLOCK_HAL_DisableClock (PCC_Type *base, uint8_t index)
 Disables the clock for an IP module. More...
 
static bool CLOCK_HAL_GetGateCmd (PCC_Type *base, uint8_t index)
 Gets the clock gate status on the current core for an IP module. More...
 
static bool CLOCK_HAL_GetGateCmdOnOtherCore (PCC_Type *base, uint8_t index)
 Gets the clock gate status on other core for some IP module. More...
 
static void CLOCK_HAL_SetIpSrc (PCC_Type *base, uint8_t index, clock_ip_src_t src)
 Sets the clock source for an IP module. More...
 
static clock_ip_src_t CLOCK_HAL_GetIpSrc (PCC_Type *base, uint8_t index)
 Gets the clock source for an IP module. More...
 
static void CLOCK_HAL_SetIpDiv (PCC_Type *base, uint8_t index, uint32_t divider)
 Sets the clock divider for an IP module. More...
 
static uint32_t CLOCK_HAL_GetIpDiv (PCC_Type *base, uint8_t index)
 Gets the clock divider for an IP module. More...
 

Enumeration Type Documentation

Enumerator
kClockIpSrcNone 

Clock is off or test clock is enabled.

kClockIpSrcSysOsc 

System Oscillator.

kClockIpSrcSIrc 

Slow IRC (maximum is 8 MHz).

kClockIpSrcFIrc 

Fast IRC (maximum is 48 MHz).

kClockIpSrcRtcOsc 

RTC OSC.

kClockIpSrcSysFll 

System FLL DIV3 or DIV2.

kClockIpSrcSysPll 

System PLL DIV3 or DIV2.

kClockIpSrcPerPll 

Peripheral PLL DIV3 or DIV2.

kClockIpSrcMax 

Maximum value.

Function Documentation

static void CLOCK_HAL_EnableClock ( PCC_Type *  base,
uint8_t  index 
)
inlinestatic

This function enables the clock for a specific IP module. For example, to enable the DMA0 clock, use the function as follows:

CLOCK_HAL_EnableClock(PCC0_BASE, 8);

or use macro like this:

CLOCK_HAL_EnableClock(PCC0_BASE, PCC0_INDEX_DMA0);
Parameters
baseRegister base address for the PCC instance.
indexThe control register index for the IP module in PCC.
static void CLOCK_HAL_DisableClock ( PCC_Type *  base,
uint8_t  index 
)
inlinestatic

This function disables the clock for a specific IP module. For example, to disable the DMA0 clock, use the function as follows:

CLOCK_HAL_DisableClock(PCC0_BASE, 8);

or use macro like this:

CLOCK_HAL_DisableClock(PCC0_BASE, PCC0_INDEX_DMA0);
Parameters
baseRegister base address for the PCC instance.
indexThe control register index for the IP module in PCC.
static bool CLOCK_HAL_GetGateCmd ( PCC_Type *  base,
uint8_t  index 
)
inlinestatic

This function gets the clock gate status on the current core for an IP module. For example, to get the DMA0 clock gate status, use the function as follows:

CLOCK_HAL_GetGateCmd(PCC0_BASE, 8);

or use macro like this:

CLOCK_HAL_GetGateCmd(PCC0_BASE, PCC0_INDEX_DMA0);
Parameters
baseRegister base address for the PCC instance.
indexThe control register index for the IP module in PCC.
Returns
state true - ungated(Enabled), false - gated (Disabled)
static bool CLOCK_HAL_GetGateCmdOnOtherCore ( PCC_Type *  base,
uint8_t  index 
)
inlinestatic

This function gets the clock gate status on other core for some IP module. For example, to get the DMA0 clock gate status, use like this:

or use macro like this:

CLOCK_HAL_GetGateCmdOnOtherCore(PCC0_BASE, PCC0_INDEX_DMA0);
Parameters
baseRegister base address for the PCC instance.
indexThe control register index for the IP module in PCC.
Returns
state true - ungated(Enabled), false - gated (Disabled)
static void CLOCK_HAL_SetIpSrc ( PCC_Type *  base,
uint8_t  index,
clock_ip_src_t  src 
)
inlinestatic

This function sets the clock source for an IP module. For example, to set the clock source for USBFS0 to OSCCLK, use the function as follows:

or use macro like this:

CLOCK_HAL_SetIpSrc(PCC0_BASE, PCC0_INDEX_USBFS0, kClockIpSrcSysOsc);
Parameters
baseRegister base address for the PCC instance.
indexThe control register index for the IP module in PCC.
srcThe clock source to set.
Note
Not all peripherals support various clock sources. See the reference manual for more details.
static clock_ip_src_t CLOCK_HAL_GetIpSrc ( PCC_Type *  base,
uint8_t  index 
)
inlinestatic

This function gets the clock source for an IP module. For example, to get the clock source for USBFS0 to OSCCLK, use the function as follows:

CLOCK_HAL_GetIpSrc(PCC0_BASE, 38);

or use macro like this:

CLOCK_HAL_GetIpSrc(PCC0_BASE, PCC0_INDEX_USBFS0);
Parameters
baseRegister base address for the PCC instance.
indexThe control register index for the IP module in PCC.
Returns
Current clock source for this module.
Note
Not all peripherals support various clock sources. See the reference manual for more details.
static void CLOCK_HAL_SetIpDiv ( PCC_Type *  base,
uint8_t  index,
uint32_t  divider 
)
inlinestatic

This function sets the clock divider for an IP module.

Parameters
baseRegister base address for the PCC instance.
indexThe control register index for the IP module in PCC.
dividerClock divider for this module.
Note
Not all peripherals support this feature. See the reference manual for more details.
static uint32_t CLOCK_HAL_GetIpDiv ( PCC_Type *  base,
uint8_t  index 
)
inlinestatic

This function gets the clock divider for an IP module.

Parameters
baseRegister base address for the PCC instance.
indexThe control register index for the IP module in PCC.
Returns
Current clock divider for this module.
Note
Not all peripherals support this feature. See the reference manual for more details.