#include "compiler.h"
Data Structures | |
struct | scif_gclk_opt_t |
Generic clock generation settings. More... | |
struct | scif_osc32_opt_t |
OSC32 startup options. More... | |
struct | scif_osc_opt_t |
OSC0/OSC1 startup options. More... | |
struct | scif_pll_opt_t |
PLL0/PLL1 startup options. More... | |
Macros | |
#define | AVR32_SCIF_OSCCTRL1 0x00000028 |
#define | SCIF_EXT_CRYSTAL_MAX_FREQ_HZ 20000000 |
#define | SCIF_EXT_CRYSTAL_MIN_FREQ_HZ 4000000 |
Device-specific data. More... | |
#define | SCIF_NOT_SUPPORTED (-10000) |
Define "not supported" for the chosen implementation. More... | |
#define | SCIF_POLL_TIMEOUT 100000 |
The timeguard used for polling in ticks. More... | |
#define | SCIF_UNLOCK(reg) (AVR32_SCIF.unlock = (AVR32_SCIF_UNLOCK_KEY_VALUE << AVR32_SCIF_UNLOCK_KEY_OFFSET)|(reg)) |
Unlock SCIF register macro. More... | |
Enumerations | |
enum | scif_gcctrl_oscsel_t { SCIF_GCCTRL_SLOWCLOCK = AVR32_SCIF_GC_USES_CLK_SLOW, SCIF_GCCTRL_OSC32K = AVR32_SCIF_GC_USES_CLK_32, SCIF_GCCTRL_OSC0 = AVR32_SCIF_GC_USES_OSC0, SCIF_GCCTRL_OSC1 = AVR32_SCIF_GC_USES_OSC1, SCIF_GCCTRL_PLL0 = AVR32_SCIF_GC_USES_PLL0, SCIF_GCCTRL_PLL1 = AVR32_SCIF_GC_USES_PLL1, SCIF_GCCTRL_RC8M = AVR32_SCIF_GC_USES_RCOSC8, SCIF_GCCTRL_CPUCLOCK = AVR32_SCIF_GC_USES_CLK_CPU, SCIF_GCCTRL_HSBCLOCK = AVR32_SCIF_GC_USES_CLK_HSB, SCIF_GCCTRL_PBACLOCK = AVR32_SCIF_GC_USES_CLK_PBA, SCIF_GCCTRL_PBBCLOCK = AVR32_SCIF_GC_USES_CLK_PBB, SCIF_GCCTRL_PBCCLOCK = AVR32_SCIF_GC_USES_CLK_PBC, SCIF_GCCTRL_OSCSEL_INVALID } |
The different clock source for the generic clocks. More... | |
enum | scif_osc_mode_t { SCIF_OSC_MODE_EXT_CLK = 0, SCIF_OSC_MODE_2PIN_CRYSTAL = 1, SCIF_OSC_MODE_2PIN_CRYSTAL_HICUR = 2 } |
The different oscillator modes. More... | |
enum | scif_osc_t { SCIF_OSC0 = 0, SCIF_OSC1 = 1 } |
The different oscillators. More... | |
enum | scif_pll_t { SCIF_PLL0 = 0, SCIF_PLL1 = 1 } |
The different plls. More... | |
Functions | |
Interrupt Functions | |
static __always_inline void | scif_enable_interrupts (unsigned long mask) |
Enable SCIF interrupts. More... | |
static __always_inline void | scif_disable_interrupts (unsigned long mask) |
Disable SCIF interrupts. More... | |
static __always_inline unsigned long | scif_get_enabled_interrupts (void) |
Read the SCIF currently enabled interrupts. More... | |
static __always_inline unsigned long | scif_get_interrupts_status (void) |
Read the interrupt status of the SCIF. More... | |
static __always_inline void | scif_clear_interrupts_status (unsigned long mask) |
Clear raised interrupts from the SCIF. More... | |
Power and Clocks Status Functions | |
static __always_inline unsigned long | scif_get_pclk_status (void) |
Read the Power and Clocks Status of the SCIF. More... | |
OSC0/OSC1 Functions | |
long int | scif_start_osc (scif_osc_t osc, const scif_osc_opt_t *opt, bool wait_for_ready) |
Configure and start an OSC0/OSC1 oscillator. More... | |
bool | scif_is_osc_ready (scif_osc_t osc) |
Is an oscillator stable and ready to be used as clock source? More... | |
long int | scif_stop_osc (scif_osc_t osc) |
Stop an oscillator. More... | |
long int | scif_configure_osc_crystalmode (scif_osc_t osc, unsigned int fcrystal) |
Configure an oscillator in crystal mode. More... | |
long int | scif_configure_osc_extmode (scif_osc_t osc) |
Configure an external clock as input clock. More... | |
long int | scif_enable_osc (scif_osc_t osc, unsigned int startup, bool wait_for_ready) |
Enable an oscillator with a given startup time. More... | |
long int | scif_enable_extosc (scif_osc_t osc) |
Enable external clock. More... | |
PLL0/PLL1 Functions | |
long int | scif_pll_setup (scif_pll_t pll, const scif_pll_opt_t *opt) |
This function will setup a PLL. More... | |
long int | scif_pll_enable (scif_pll_t pll) |
This function will enable a PLL. More... | |
long int | scif_pll_disable (scif_pll_t pll) |
This function will disable a PLL. More... | |
long int | scif_wait_for_pll_locked (scif_pll_t pll) |
This function will wait for PLL locked. More... | |
OSC32 Functions | |
long int | scif_start_osc32 (const scif_osc32_opt_t *opt, bool wait_for_ready) |
Configure and start the OSC32 oscillator. More... | |
static __always_inline bool | scif_is_osc32_ready (void) |
Is OSC32 stable and ready to be used as clock source? More... | |
long int | scif_stop_osc32 (void) |
Stop the OSC32 oscillator. More... | |
Calibration Functions | |
void | scif_bod18_enable_irq (void) |
Enables the 1.8V Brown-Out Detector interrupt. More... | |
void | scif_bod18_disable_irq (void) |
Disables the 1.8V Brown-Out Detector interrupt. More... | |
void | scif_bod18_clear_irq (void) |
Clears the 1.8V Brown-Out Detector interrupt flag. More... | |
unsigned long | scif_bod18_get_irq_status (void) |
Gets the 1.8V Brown-Out Detector interrupt flag. More... | |
unsigned long | scif_bod18_get_irq_enable_bit (void) |
Gets the 1.8V Brown-Out Detector interrupt enable status. More... | |
unsigned long | scif_bod18_get_level (void) |
Gets the triggering threshold of the 1.8V Brown-Out Detector. More... | |
void | scif_bod33_enable_irq (void) |
Enables the 3.3V Brown-Out Detector interrupt. More... | |
void | scif_bod33_disable_irq (void) |
Disables the 3.3V Brown-Out Detector interrupt. More... | |
void | scif_bod33_clear_irq (void) |
Clears the 3.3V Brown-Out Detector interrupt flag. More... | |
unsigned long | scif_bod33_get_irq_status (void) |
Gets the 3.3V Brown-Out Detector interrupt flag. More... | |
unsigned long | scif_bod33_get_irq_enable_bit (void) |
Gets the 3.3V Brown-Out Detector interrupt enable status. More... | |
unsigned long | scif_bod33_get_level (void) |
Gets the triggering threshold of the 3.3V Brown-Out Detector. More... | |
void | scif_bod50_enable_irq (void) |
Enables the 5.0V Brown-Out Detector interrupt. More... | |
void | scif_bod50_disable_irq (void) |
Disables the 5.0V Brown-Out Detector interrupt. More... | |
void | scif_bod50_clear_irq (void) |
Clears the 5.0V Brown-Out Detector interrupt flag. More... | |
unsigned long | scif_bod50_get_irq_status (void) |
Gets the 5.0V Brown-Out Detector interrupt flag. More... | |
unsigned long | scif_bod50_get_irq_enable_bit (void) |
Gets the 5.0V Brown-Out Detector interrupt enable status. More... | |
unsigned long | scif_bod50_get_level (void) |
Gets the triggering threshold of the 5.0V Brown-Out Detector. More... | |
8MHz RCosc Functions | |
void | scif_start_rc8M (void) |
Start the 8MHz internal RCosc (RC8M) clock. More... | |
void | scif_stop_rc8M (void) |
Stop the 8MHz internal RCosc (RC8M) clock. More... | |
120MHz RCosc Functions | |
void | scif_start_rc120M (void) |
Start the 120MHz internal RCosc (RC120M) clock. More... | |
void | scif_stop_rc120M (void) |
Stop the 120MHz internal RCosc (RC120M) clock. More... | |
Generic Clock Functions | |
long int | scif_start_gclk (unsigned int gclk, const scif_gclk_opt_t *opt) |
Setup and start a generic clock. More... | |
long int | scif_stop_gclk (unsigned int gclk) |
Stop a generic clock. More... | |
long int | scif_gc_setup (unsigned int gclk, scif_gcctrl_oscsel_t clk_src, unsigned int diven, unsigned int divfactor) |
Setup a generic clock. More... | |
long int | scif_gc_enable (unsigned int gclk) |
Enable a generic clock. More... | |
Backup Registers Functions | |
unsigned long | scif_read_gplp (unsigned long gplp) |
Read the content of the SCIF GPLP registers. More... | |
void | scif_write_gplp (int gplp, unsigned long value) |
Write into the SCIF GPLP registers. More... | |
Temperature Sensor Management Functions | |
static __always_inline void | scif_temperature_sensor_enable (void) |
Enable the temperature sensor. More... | |
static __always_inline void | scif_temperature_sensor_disable (void) |
Disable the temperature sensor. More... | |