Microchip® Advanced Software Framework

dfll.c File Reference

Chip-specific DFLL implementation.

Copyright (c) 2010-2018 Microchip Technology Inc. and its subsidiaries.

#include <compiler.h>
#include <dfll.h>

Macros

#define dfll_write_reg(reg, value)
 

Functions

Interaction with the DFLL hardware
void dfll_enable_open_loop (const struct dfll_config *cfg, unsigned int dfll_id)
 Activate the configuration cfg and enable DFLL dfll_id in open-loop mode. More...
 
void dfll_disable_open_loop (unsigned int dfll_id)
 Disable the DFLL identified by dfll_id. More...
 
void dfll_enable_closed_loop (const struct dfll_config *cfg, unsigned int dfll_id)
 Activate the configuration cfg and enable DFLL dfll_id in closed-loop mode. More...
 
void dfll_disable_closed_loop (unsigned int dfll_id)
 Disable the DFLL identified by dfll_id. More...
 
void dfll_enable_config_defaults (unsigned int dfll_id)
 Enable the dfll with the default configuration. More...
 

#define dfll_write_reg (   reg,
  value 
)
Value:
do { \
while (!(AVR32_SCIF.pclksr & AVR32_SCIF_DFLL0RDY_MASK)); \
irqflags_t ATPASTE2(dfll_flags, __LINE__) = cpu_irq_save(); \
AVR32_SCIF.unlock = \
(AVR32_SCIF_UNLOCK_KEY_VALUE << AVR32_SCIF_UNLOCK_KEY_OFFSET) |\
AVR32_SCIF_##reg; \
*(volatile uint32_t *)(AVR32_SCIF_ADDRESS + AVR32_SCIF_##reg) \
= (value); \
cpu_irq_restore(ATPASTE2(dfll_flags, __LINE__)); \
} while (0)
static irqflags_t cpu_irq_save(void)
Get and clear the global interrupt flags.
Definition: interrupt_avr32.h:197
static void cpu_irq_restore(irqflags_t flags)
Restore global interrupt flags.
Definition: interrupt_avr32.h:212
while(put_bits >=8)
Definition: jchuff.c:321
#define ATPASTE2(a, b)
Definition: tpaste.h:82
uint32_t irqflags_t
Type used for holding state of interrupt flag.
Definition: interrupt_avr32.h:195

Referenced by dfll_disable_closed_loop(), dfll_disable_open_loop(), dfll_enable_closed_loop(), and dfll_enable_open_loop().