Microchip® Advanced Software Framework

dfll.c File Reference

Chip-specific DFLL implementation.

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

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

Macros

#define dfll_write_reg(reg, value)
 

Functions

void dfll_disable_closed_loop (uint32_t dfll_id)
 
void dfll_disable_open_loop (uint32_t dfll_id)
 
void dfll_enable_closed_loop (const struct dfll_config *cfg, uint32_t dfll_id)
 
void dfll_enable_config_defaults (uint32_t dfll_id)
 
void dfll_enable_open_loop (const struct dfll_config *cfg, uint32_t dfll_id)
 

#define dfll_write_reg (   reg,
  value 
)
Value:
do { \
while (!(SCIF->SCIF_PCLKSR & SCIF_PCLKSR_DFLL0RDY)); \
irqflags_t ATPASTE2(dfll_flags, __LINE__) = cpu_irq_save(); \
SCIF->SCIF_UNLOCK = SCIF_UNLOCK_KEY(0xAAUL) \
| SCIF_UNLOCK_ADDR((uint32_t)&SCIF->SCIF_##reg - (uint32_t)SCIF);\
SCIF->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_sam_nvic.h:141
#define ATPASTE2(a, b)
Definition: tpaste.h:80
static void cpu_irq_restore(irqflags_t flags)
Restore global interrupt flags.
Definition: interrupt_sam_nvic.h:153
uint8_t value
Definition: ui.c:49
uint32_t irqflags_t
Type used for holding state of interrupt flag.
Definition: interrupt_sam_nvic.h:130

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