Hanna
Sourcecode Batteriemanagementsystem
Datenstrukturen | Makrodefinitionen | Aufzählungen | Funktionen
Pll_group

Datenstrukturen

struct  pll_config
 

Makrodefinitionen

#define NR_PLLS   1
 
#define pll_config_defaults(cfg, pll_id)
 
#define pll_get_default_rate(pll_id)
 
#define PLL_MAX_HZ   200000000UL
 
#define PLL_MIN_HZ   10000000UL
 
#define PLL_NR_OPTIONS   0
 

Aufzählungen

enum  pll_source { PLL_SRC_RC2MHZ = OSC_PLLSRC_RC2M_gc, PLL_SRC_RC32MHZ = OSC_PLLSRC_RC32M_gc, PLL_SRC_XOSC = OSC_PLLSRC_XOSC_gc }
 

Funktionen

static void pll_config_init (struct pll_config *cfg, enum pll_source src, unsigned int div, unsigned int mul)
 
static void pll_config_read (struct pll_config *cfg, unsigned int pll_id)
 
static void pll_config_write (const struct pll_config *cfg, unsigned int pll_id)
 
static void pll_disable (unsigned int pll_id)
 
static void pll_enable (const struct pll_config *cfg, unsigned int pll_id)
 
static void pll_enable_config_defaults (unsigned int pll_id)
 
static void pll_enable_source (enum pll_source src)
 
static uint32_t pll_get_default_rate_priv (enum pll_source src, unsigned int mul, unsigned int div)
 Return clock rate for specified PLL settings. Mehr ...
 
static bool pll_is_locked (unsigned int pll_id)
 
static int pll_wait_for_lock (unsigned int pll_id)
 

Ausführliche Beschreibung

Makro-Dokumentation

#define pll_config_defaults (   cfg,
  pll_id 
)
Wert:
CONFIG_PLL##pll_id##_SOURCE, \
CONFIG_PLL##pll_id##_DIV, \
CONFIG_PLL##pll_id##_MUL)
static void pll_config_init(struct pll_config *cfg, enum pll_source src, unsigned int div, unsigned int mul)
Definition: pll.h:138

Definiert in Zeile 153 der Datei pll.h.

#define pll_get_default_rate (   pll_id)
Wert:
pll_get_default_rate_priv(CONFIG_PLL##pll_id##_SOURCE, \
CONFIG_PLL##pll_id##_MUL, \
CONFIG_PLL##pll_id##_DIV)
static uint32_t pll_get_default_rate_priv(enum pll_source src, unsigned int mul, unsigned int div)
Return clock rate for specified PLL settings.
Definition: pll.h:89

Definiert in Zeile 70 der Datei pll.h.

Dokumentation der Aufzählungstypen

enum pll_source
Aufzählungswerte
PLL_SRC_RC2MHZ 

2 MHz Internal RC Oscillator

PLL_SRC_RC32MHZ 

32 MHz Internal RC Oscillator

PLL_SRC_XOSC 

External Clock Source.

Definiert in Zeile 61 der Datei pll.h.

Dokumentation der Funktionen

static void pll_config_init ( struct pll_config cfg,
enum pll_source  src,
unsigned int  div,
unsigned int  mul 
)
inlinestatic
Zu beachten
The XMEGA PLL hardware uses hard-wired input dividers, so the user must ensure that div is set as follows:
  • If src is PLL_SRC_32MHZ, div must be set to 4.
  • Otherwise, div must be set to 1.

Definiert in Zeile 138 der Datei pll.h.

Hier ist ein Graph der zeigt, wo diese Funktion aufgerufen wird:

static void pll_disable ( unsigned int  pll_id)
inlinestatic
Zu beachten
This will not automatically disable the reference oscillator that is configured for the PLL.

Definiert in Zeile 195 der Datei pll.h.

Hier ist ein Graph, der zeigt, was diese Funktion aufruft:

static void pll_enable ( const struct pll_config cfg,
unsigned int  pll_id 
)
inlinestatic
Zu beachten
If a different PLL reference oscillator than those enabled by sysclk_init() is used, the user must ensure that the desired reference is enabled prior to calling this function.

Definiert in Zeile 179 der Datei pll.h.

Hier ist ein Graph der zeigt, wo diese Funktion aufgerufen wird:

static uint32_t pll_get_default_rate_priv ( enum pll_source  src,
unsigned int  mul,
unsigned int  div 
)
inlinestatic

Return clock rate for specified PLL settings.

Zu beachten
Due to the hardware implementation of the PLL, div must be 4 if the 32 MHz RC oscillator is used as reference and 1 otherwise. The reference must be above 440 kHz, and the output between 10 and 200 MHz.
Parameter
srcID of the PLL's reference source oscillator.
mulMultiplier for the PLL.
divDivisor for the PLL.
Rückgabewerte
Outputclock rate from PLL.

Definiert in Zeile 89 der Datei pll.h.