RTEMS  5.1
Macros | Functions
pmc.c File Reference
#include "chip.h"
#include <assert.h>

Macros

#define MASK_STATUS0   0xFFFFFFFC
 
#define MASK_STATUS1   0xFFFFFFFF
 

Functions

void PMC_EnablePeripheral (uint32_t dwId)
 Enables the clock of a peripheral. The peripheral ID is used to identify which peripheral is targeted. More...
 
void PMC_DisablePeripheral (uint32_t dwId)
 Disables the clock of a peripheral. The peripheral ID is used to identify which peripheral is targeted. More...
 
void PMC_EnableAllPeripherals (void)
 Enable all the periph clock via PMC.
 
void PMC_DisableAllPeripherals (void)
 Disable all the periph clock via PMC.
 
uint32_t PMC_IsPeriphEnabled (uint32_t dwId)
 Get Periph Status for the given peripheral ID. More...
 
void PMC_EnableExtOsc (void)
 Enable external oscillator as main clock input.
 
void PMC_DisableExtOsc (void)
 Disable external 12MHz oscillator.
 
void PMC_SelectExtOsc (void)
 Select external OSC.
 
void PMC_SelectExtBypassOsc (void)
 Select external OSC.
 
void PMC_EnableIntRC4_8_12MHz (uint32_t freqSelect)
 Enable internal 4/8/12MHz fast RC as main clock input. More...
 
void PMC_DisableIntRC4_8_12MHz (void)
 Disable internal 4/8/12MHz fast RC.
 
void PMC_SetPllaClock (uint32_t mul, uint32_t div)
 Configure PLLA clock by giving MUL and DIV. Disable PLLA when 'mul' set to 0. More...
 
void PMC_SetMckSelection (uint32_t clockSource, uint32_t prescaler)
 Selection of Master Clock. More...
 
void PMC_DisableAllClocks (void)
 Disable all clocks.
 
void PMC_ConfigureMckWithPlla (uint32_t mul, uint32_t div, uint32_t prescaler)
 Configure PLLA as clock input for MCK. More...
 
void PMC_EnableXT32KFME (void)
 Configure PLLA as clock input for MCK. More...
 
void PMC_ConfigurePCK0 (uint32_t MasterClk, uint32_t prescaler)
 Configure PLLA as clock input for MCK. More...
 
void PMC_ConfigurePCK1 (uint32_t MasterClk, uint32_t prescaler)
 Configure PLLA as clock input for MCK. More...
 
void PMC_ConfigurePCK2 (uint32_t MasterClk, uint32_t prescaler)
 Configure PLLA as clock input for MCK. More...
 

Detailed Description

Purpose

Interface for configuring and using Power Management Controller (PMC) peripherals.

Implementation of Power Management Controller (PMC).

Function Documentation

◆ PMC_ConfigureMckWithPlla()

void PMC_ConfigureMckWithPlla ( uint32_t  mul,
uint32_t  div,
uint32_t  prescaler 
)

Configure PLLA as clock input for MCK.

Parameters
mulPLL multiplier factor (not shifted, don't minus 1).
divPLL divider factor (not shifted).
prescalerMaster Clock prescaler (shifted as in register).

◆ PMC_ConfigurePCK0()

void PMC_ConfigurePCK0 ( uint32_t  MasterClk,
uint32_t  prescaler 
)

Configure PLLA as clock input for MCK.

Parameters
mulPLL multiplier factor (not shifted, don't minus 1).
divPLL divider factor (not shifted).
prescalerMaster Clock prescaler (shifted as in register).

◆ PMC_ConfigurePCK1()

void PMC_ConfigurePCK1 ( uint32_t  MasterClk,
uint32_t  prescaler 
)

Configure PLLA as clock input for MCK.

Parameters
mulPLL multiplier factor (not shifted, don't minus 1).
divPLL divider factor (not shifted).
prescalerMaster Clock prescaler (shifted as in register).

◆ PMC_ConfigurePCK2()

void PMC_ConfigurePCK2 ( uint32_t  MasterClk,
uint32_t  prescaler 
)

Configure PLLA as clock input for MCK.

Parameters
mulPLL multiplier factor (not shifted, don't minus 1).
divPLL divider factor (not shifted).
prescalerMaster Clock prescaler (shifted as in register).

◆ PMC_DisablePeripheral()

void PMC_DisablePeripheral ( uint32_t  dwId)

Disables the clock of a peripheral. The peripheral ID is used to identify which peripheral is targeted.

Note
The ID must NOT be shifted (i.e. 1 << ID_xxx).
Parameters
idPeripheral ID (ID_xxx).

◆ PMC_EnableIntRC4_8_12MHz()

void PMC_EnableIntRC4_8_12MHz ( uint32_t  freqSelect)

Enable internal 4/8/12MHz fast RC as main clock input.

Parameters
freqSelectfast RC frequency (FAST_RC_4MHZ, FAST_RC_8MHZ, FAST_RC_12MHZ).

◆ PMC_EnablePeripheral()

void PMC_EnablePeripheral ( uint32_t  dwId)

Enables the clock of a peripheral. The peripheral ID is used to identify which peripheral is targeted.

Note
The ID must NOT be shifted (i.e. 1 << ID_xxx).
Parameters
idPeripheral ID (ID_xxx).

◆ PMC_EnableXT32KFME()

void PMC_EnableXT32KFME ( void  )

Configure PLLA as clock input for MCK.

Parameters
mulPLL multiplier factor (not shifted, don't minus 1).
divPLL divider factor (not shifted).
prescalerMaster Clock prescaler (shifted as in register).

◆ PMC_IsPeriphEnabled()

uint32_t PMC_IsPeriphEnabled ( uint32_t  dwId)

Get Periph Status for the given peripheral ID.

Parameters
idPeripheral ID (ID_xxx).

◆ PMC_SetMckSelection()

void PMC_SetMckSelection ( uint32_t  clockSource,
uint32_t  prescaler 
)

Selection of Master Clock.

Parameters
clockSourceMaster Clock source.
prescalerMaster Clock prescaler.
Note
The PMC_MCKR register must not be programmed in a single write operation (see. Product Data Sheet).

◆ PMC_SetPllaClock()

void PMC_SetPllaClock ( uint32_t  mul,
uint32_t  div 
)

Configure PLLA clock by giving MUL and DIV. Disable PLLA when 'mul' set to 0.

Parameters
mulPLL multiplier factor.
divPLL divider factor.