RTEMS: bsps/arm/atsam/contrib/libraries/libchip/source/pmc.c File Reference

| RTEMS 5.4-rc2

Loading...
Searching...
No Matches
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.
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).

## Function Documentation

## ◆ PMC_ConfigureMckWithPlla()

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).

## ◆ PMC_ConfigurePCK0()

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).

## ◆ PMC_ConfigurePCK1()

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).

## ◆ PMC_ConfigurePCK2()

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).

## ◆ 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

  id | Peripheral 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

  freqSelect | fast 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

  id | Peripheral ID (ID_xxx).

## ◆ PMC_EnableXT32KFME()

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).

## ◆ PMC_IsPeriphEnabled()

uint32_t PMC_IsPeriphEnabled | ( | uint32_t | dwId | ) |

Get Periph Status for the given peripheral ID.

Parameters

  id | Peripheral ID (ID_xxx).

## ◆ PMC_SetMckSelection()

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).

## ◆ 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

  mul | PLL multiplier factor.
  div | PLL divider factor.