SAMV71 Xplained Ultra Software Package 1.5

pmc.c File Reference

#include "chip.h"
#include <assert.h>

Go to the source code of this file.

Defines

#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.
void PMC_DisablePeripheral (uint32_t dwId)
 Disables the clock of a peripheral. The peripheral ID is used to identify which peripheral is targeted.
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.
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.
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.
void PMC_SetMckSelection (uint32_t clockSource, uint32_t prescaler)
 Selection of Master Clock.
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.
void PMC_EnableXT32KFME (void)
 Configure PLLA as clock input for MCK.
void PMC_ConfigurePCK0 (uint32_t MasterClk, uint32_t prescaler)
 Configure PLLA as clock input for MCK.
void PMC_ConfigurePCK1 (uint32_t MasterClk, uint32_t prescaler)
 Configure PLLA as clock input for MCK.
void PMC_ConfigurePCK2 (uint32_t MasterClk, uint32_t prescaler)
 Configure PLLA as clock input for MCK.

Detailed Description

Purpose

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

Implementation of Power Management Controller (PMC).

Definition in file pmc.c.


Function Documentation

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

Configure PLLA as clock input for MCK.

Parameters:
mul PLL multiplier factor (not shifted, don't minus 1).
div PLL divider factor (not shifted).
prescaler Master Clock prescaler (shifted as in register).

Definition at line 496 of file pmc.c.

Here is the call graph for this function:

void PMC_ConfigurePCK0 ( uint32_t  MasterClk,
uint32_t  prescaler 
)

Configure PLLA as clock input for MCK.

Parameters:
mul PLL multiplier factor (not shifted, don't minus 1).
div PLL divider factor (not shifted).
prescaler Master Clock prescaler (shifted as in register).

Definition at line 545 of file pmc.c.

void PMC_ConfigurePCK1 ( uint32_t  MasterClk,
uint32_t  prescaler 
)

Configure PLLA as clock input for MCK.

Parameters:
mul PLL multiplier factor (not shifted, don't minus 1).
div PLL divider factor (not shifted).
prescaler Master Clock prescaler (shifted as in register).

Definition at line 566 of file pmc.c.

void PMC_ConfigurePCK2 ( uint32_t  MasterClk,
uint32_t  prescaler 
)

Configure PLLA as clock input for MCK.

Parameters:
mul PLL multiplier factor (not shifted, don't minus 1).
div PLL divider factor (not shifted).
prescaler Master Clock prescaler (shifted as in register).

Definition at line 586 of file pmc.c.

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:
id Peripheral ID (ID_xxx).

Definition at line 185 of file pmc.c.

void PMC_EnableIntRC4_8_12MHz ( uint32_t  freqSelect  ) 

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

Parameters:
freqSelect fast RC frequency (FAST_RC_4MHZ, FAST_RC_8MHZ, FAST_RC_12MHZ).

Definition at line 368 of file pmc.c.

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:
id Peripheral ID (ID_xxx).

Definition at line 156 of file pmc.c.

void PMC_EnableXT32KFME ( void   ) 

Configure PLLA as clock input for MCK.

Parameters:
mul PLL multiplier factor (not shifted, don't minus 1).
div PLL divider factor (not shifted).
prescaler Master Clock prescaler (shifted as in register).

Definition at line 520 of file pmc.c.

uint32_t PMC_IsPeriphEnabled ( uint32_t  dwId  ) 

Get Periph Status for the given peripheral ID.

Parameters:
id Peripheral ID (ID_xxx).

Definition at line 243 of file pmc.c.

void PMC_SetMckSelection ( uint32_t  clockSource,
uint32_t  prescaler 
)

Selection of Master Clock.

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

Definition at line 444 of file pmc.c.

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:
mul PLL multiplier factor.
div PLL divider factor.

Definition at line 418 of file pmc.c.

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines