Driver for the SCIF (System Control Interface).
The SCIF controls the Oscillators, PLL, Generic Clocks, BODs, the voltage regulators and general purpose low power registers.
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... | |
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... | |
#define AVR32_SCIF_OSCCTRL1 0x00000028 |
Referenced by scif_configure_osc_crystalmode().
#define SCIF_EXT_CRYSTAL_MAX_FREQ_HZ 20000000 |
Referenced by scif_start_osc(), and scif_start_osc32().
#define SCIF_EXT_CRYSTAL_MIN_FREQ_HZ 4000000 |
Device-specific data.
< External crystal/clock min frequency (in Herz) External crystal/clock max frequency (in Herz)
Referenced by scif_start_osc(), and scif_start_osc32().
#define SCIF_NOT_SUPPORTED (-10000) |
Define "not supported" for the chosen implementation.
#define SCIF_POLL_TIMEOUT 100000 |
The timeguard used for polling in ticks.
Referenced by scif_pclksr_statushigh_wait(), and scif_stop_gclk().
#define SCIF_UNLOCK | ( | reg | ) | (AVR32_SCIF.unlock = (AVR32_SCIF_UNLOCK_KEY_VALUE << AVR32_SCIF_UNLOCK_KEY_OFFSET)|(reg)) |
Unlock SCIF register macro.
Referenced by scif_configure_osc_crystalmode(), scif_configure_osc_extmode(), scif_enable_extosc(), scif_enable_osc(), scif_pll_disable(), scif_pll_enable(), scif_pll_setup(), scif_start_osc(), scif_start_osc32(), scif_start_rc120M(), scif_start_rc8M(), scif_stop_osc(), scif_stop_osc32(), scif_stop_rc120M(), scif_stop_rc8M(), scif_temperature_sensor_disable(), scif_temperature_sensor_enable(), and scif_write_gplp().
enum scif_gcctrl_oscsel_t |
The different clock source for the generic clocks.
enum scif_osc_mode_t |
enum scif_osc_t |
enum scif_pll_t |
void scif_bod18_clear_irq | ( | void | ) |
Clears the 1.8V Brown-Out Detector interrupt flag.
void scif_bod18_disable_irq | ( | void | ) |
Disables the 1.8V Brown-Out Detector interrupt.
References Disable_global_interrupt, Enable_global_interrupt, and Is_global_interrupt_enabled.
void scif_bod18_enable_irq | ( | void | ) |
Enables the 1.8V Brown-Out Detector interrupt.
unsigned long scif_bod18_get_irq_enable_bit | ( | void | ) |
Gets the 1.8V Brown-Out Detector interrupt enable status.
0 | BOD interrupt disabled. |
1 | BOD interrupt enabled. |
unsigned long scif_bod18_get_irq_status | ( | void | ) |
Gets the 1.8V Brown-Out Detector interrupt flag.
0 | No BOD interrupt. |
1 | BOD interrupt pending. |
unsigned long scif_bod18_get_level | ( | void | ) |
Gets the triggering threshold of the 1.8V Brown-Out Detector.
void scif_bod33_clear_irq | ( | void | ) |
Clears the 3.3V Brown-Out Detector interrupt flag.
void scif_bod33_disable_irq | ( | void | ) |
Disables the 3.3V Brown-Out Detector interrupt.
References Disable_global_interrupt, Enable_global_interrupt, and Is_global_interrupt_enabled.
void scif_bod33_enable_irq | ( | void | ) |
Enables the 3.3V Brown-Out Detector interrupt.
unsigned long scif_bod33_get_irq_enable_bit | ( | void | ) |
Gets the 3.3V Brown-Out Detector interrupt enable status.
0 | BOD interrupt disabled. |
1 | BOD interrupt enabled. |
unsigned long scif_bod33_get_irq_status | ( | void | ) |
Gets the 3.3V Brown-Out Detector interrupt flag.
0 | No BOD interrupt. |
1 | BOD interrupt pending. |
unsigned long scif_bod33_get_level | ( | void | ) |
Gets the triggering threshold of the 3.3V Brown-Out Detector.
void scif_bod50_clear_irq | ( | void | ) |
Clears the 5.0V Brown-Out Detector interrupt flag.
void scif_bod50_disable_irq | ( | void | ) |
Disables the 5.0V Brown-Out Detector interrupt.
References Disable_global_interrupt, Enable_global_interrupt, and Is_global_interrupt_enabled.
void scif_bod50_enable_irq | ( | void | ) |
Enables the 5.0V Brown-Out Detector interrupt.
unsigned long scif_bod50_get_irq_enable_bit | ( | void | ) |
Gets the 5.0V Brown-Out Detector interrupt enable status.
0 | BOD interrupt disabled. |
1 | BOD interrupt enabled. |
unsigned long scif_bod50_get_irq_status | ( | void | ) |
Gets the 5.0V Brown-Out Detector interrupt flag.
0 | No BOD interrupt. |
1 | BOD interrupt pending. |
unsigned long scif_bod50_get_level | ( | void | ) |
Gets the triggering threshold of the 5.0V Brown-Out Detector.
|
static |
Clear raised interrupts from the SCIF.
mask | The interrupts to clear. |
long int scif_configure_osc_crystalmode | ( | scif_osc_t | osc, |
unsigned int | fcrystal | ||
) |
Configure an oscillator in crystal mode.
osc | The oscillator to configure [INPUT] |
fcrystal | Crystal frequency (Hz) [INPUT] |
0 | Oscillator successfully configured. |
<0 | Error configuring the oscillator. |
References AVR32_ENTER_CRITICAL_REGION, AVR32_LEAVE_CRITICAL_REGION, AVR32_SCIF_OSCCTRL1, u_avr32_scif_oscctrl_t::OSCCTRL, PASS, SCIF_OSC0, SCIF_OSC1, SCIF_OSC_MODE_2PIN_CRYSTAL, and SCIF_UNLOCK.
Referenced by clockfrequencies_configure(), and pcl_switch_to_osc().
long int scif_configure_osc_extmode | ( | scif_osc_t | osc | ) |
Configure an external clock as input clock.
osc | The external clock to configure [INPUT] |
0 | External clock successfully configured. |
<0 | Error configuring the external clock. |
References AVR32_ENTER_CRITICAL_REGION, AVR32_LEAVE_CRITICAL_REGION, u_avr32_scif_oscctrl_t::OSCCTRL, PASS, SCIF_OSC_MODE_EXT_CLK, and SCIF_UNLOCK.
|
static |
Disable SCIF interrupts.
mask | the interrupts to disable. |
long int scif_enable_extosc | ( | scif_osc_t | osc | ) |
Enable external clock.
osc | The oscillator to configure [INPUT] |
0 | Oscillator successfully started |
<0 | Error starting the oscillator. |
References AVR32_ENTER_CRITICAL_REGION, AVR32_LEAVE_CRITICAL_REGION, ENABLE, u_avr32_scif_oscctrl_t::OSCCTRL, PASS, and SCIF_UNLOCK.
|
static |
Enable SCIF interrupts.
mask | the interrupts to enable. |
long int scif_enable_osc | ( | scif_osc_t | osc, |
unsigned int | startup, | ||
bool | wait_for_ready | ||
) |
Enable an oscillator with a given startup time.
osc | The oscillator to configure [INPUT] |
startup | Oscillator startup time (one of AVR32_SCIF_OSCCTRLx_STARTUP_x_RCOSC) [INPUT] |
wait_for_ready | Wait for the oscillator to be stable before return [INPUT] |
0 | Oscillator successfully started |
<0 | Error starting the oscillator. |
References AVR32_ENTER_CRITICAL_REGION, AVR32_LEAVE_CRITICAL_REGION, ENABLE, u_avr32_scif_oscctrl_t::OSCCTRL, PASS, SCIF_OSC0, scif_pclksr_statushigh_wait(), and SCIF_UNLOCK.
Referenced by clockfrequencies_configure(), and pcl_switch_to_osc().
long int scif_gc_enable | ( | unsigned int | gclk | ) |
Enable a generic clock.
gclk | generic clock number (0 for gc0...) |
0 | Success. |
<0 | An error occurred. |
References PASS.
Referenced by can_task_init(), init_gclk(), main(), pcl_configure_usb_clock(), and pwm_start_gc().
long int scif_gc_setup | ( | unsigned int | gclk, |
scif_gcctrl_oscsel_t | clk_src, | ||
unsigned int | diven, | ||
unsigned int | divfactor | ||
) |
Setup a generic clock.
gclk | generic clock number (0 for gc0...) |
clk_src | The input clock source to use for the generic clock |
diven | Generic clock divisor enable |
divfactor | Generic clock divisor |
0 | Success. |
<0 | An error occurred. |
References PASS, SCIF_GCCTRL_OSCSEL_INVALID, and scif_stop_gclk().
Referenced by can_task_init(), init_gclk(), main(), pcl_configure_usb_clock(), and pwm_start_gc().
|
static |
Read the SCIF currently enabled interrupts.
|
static |
Read the interrupt status of the SCIF.
|
static |
Read the Power and Clocks Status of the SCIF.
|
static |
Is OSC32 stable and ready to be used as clock source?
true | oscillator stable and ready |
false | oscillator not enabled or not ready. |
bool scif_is_osc_ready | ( | scif_osc_t | osc | ) |
Is an oscillator stable and ready to be used as clock source?
osc | The oscillator [INPUT] |
true | oscillator stable and ready |
false | oscillator not enabled or not ready. |
References SCIF_OSC0.
long int scif_pll_disable | ( | scif_pll_t | pll | ) |
This function will disable a PLL.
pll | The PLL to configure [INPUT] |
0 | PLL successfully started |
<0 | Error starting the PLL. |
References AVR32_ENTER_CRITICAL_REGION, AVR32_LEAVE_CRITICAL_REGION, DISABLE, PASS, u_avr32_scif_pll_t::PLL, and SCIF_UNLOCK.
long int scif_pll_enable | ( | scif_pll_t | pll | ) |
This function will enable a PLL.
pll | The PLL to configure [INPUT] |
0 | PLL successfully started |
<0 | Error starting the PLL. |
References AVR32_ENTER_CRITICAL_REGION, AVR32_LEAVE_CRITICAL_REGION, ENABLE, PASS, u_avr32_scif_pll_t::PLL, and SCIF_UNLOCK.
Referenced by clockfrequencies_configure(), local_start_highfreq_clock(), and pcl_configure_usb_clock().
long int scif_pll_setup | ( | scif_pll_t | pll, |
const scif_pll_opt_t * | opt | ||
) |
This function will setup a PLL.
pll | The PLL to configure [INPUT] |
opt | The configuration of the PLL [INPUT] |
0 | PLL successfully started |
<0 | Error starting the PLL. |
This function will setup a PLL.
References AVR32_ENTER_CRITICAL_REGION, AVR32_LEAVE_CRITICAL_REGION, scif_pll_opt_t::div, scif_pll_opt_t::lockcount, scif_pll_opt_t::mul, scif_pll_opt_t::osc, PASS, u_avr32_scif_pll_t::PLL, scif_pll_opt_t::pll_div2, scif_pll_opt_t::pll_freq, scif_pll_opt_t::pll_wbwdisable, and SCIF_UNLOCK.
Referenced by clockfrequencies_configure(), local_start_highfreq_clock(), and pcl_configure_usb_clock().
unsigned long scif_read_gplp | ( | unsigned long | gplp | ) |
Read the content of the SCIF GPLP registers.
gplp | GPLP register index (0,1,... depending on the number of GPLP registers for a given part) |
Referenced by pcl_read_gplp().
long int scif_start_gclk | ( | unsigned int | gclk, |
const scif_gclk_opt_t * | opt | ||
) |
Setup and start a generic clock.
gclk | The generic clock number to setup and start (cf. datasheet) |
opt | The settings for the generic clock. |
0 | Success. |
<0 | An error occurred. |
Setup and start a generic clock.
References scif_gclk_opt_t::clock_source, scif_gclk_opt_t::diven, scif_gclk_opt_t::divider, PASS, and SCIF_GCCTRL_OSCSEL_INVALID.
Referenced by init_gclk().
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.
osc | The oscillator to start [INPUT] |
opt | The configuration of the oscillator [INPUT] |
wait_for_ready | Wait for the oscillator to be stable before return [INPUT] |
0 | Oscillator start successful. |
<0 | Error starting the oscillator. |
Configure and start an OSC0/OSC1 oscillator.
Power and Clocks Status Functions OSC0/OSC1 Functions
References AVR32_ENTER_CRITICAL_REGION, AVR32_LEAVE_CRITICAL_REGION, ENABLE, scif_osc_opt_t::freq_hz, scif_osc_opt_t::gain, scif_osc_opt_t::mode, u_avr32_scif_oscctrl_t::OSCCTRL, PASS, SCIF_EXT_CRYSTAL_MAX_FREQ_HZ, SCIF_EXT_CRYSTAL_MIN_FREQ_HZ, SCIF_OSC0, SCIF_OSC_MODE_2PIN_CRYSTAL, SCIF_OSC_MODE_EXT_CLK, scif_pclksr_statushigh_wait(), SCIF_UNLOCK, and scif_osc_opt_t::startup.
long int scif_start_osc32 | ( | const scif_osc32_opt_t * | opt, |
bool | wait_for_ready | ||
) |
Configure and start the OSC32 oscillator.
opt | The configuration of the oscillator [INPUT] |
wait_for_ready | Wait for the oscillator to be stable before return [INPUT] |
0 | Oscillator start successful. |
<0 | Error starting the oscillator. |
Configure and start the OSC32 oscillator.
References AVR32_ENTER_CRITICAL_REGION, AVR32_LEAVE_CRITICAL_REGION, ENABLE, scif_osc32_opt_t::freq_hz, scif_osc32_opt_t::mode, u_avr32_scif_oscctrl32_t::oscctrl32, u_avr32_scif_oscctrl32_t::OSCCTRL32, PASS, SCIF_EXT_CRYSTAL_MAX_FREQ_HZ, SCIF_EXT_CRYSTAL_MIN_FREQ_HZ, SCIF_OSC_MODE_2PIN_CRYSTAL, SCIF_OSC_MODE_EXT_CLK, scif_pclksr_statushigh_wait(), SCIF_UNLOCK, and scif_osc32_opt_t::startup.
Referenced by init_ast(), init_gclk(), and main().
void scif_start_rc120M | ( | void | ) |
Start the 120MHz internal RCosc (RC120M) clock.
Start the 120MHz internal RCosc (RC120M) clock.
References AVR32_ENTER_CRITICAL_REGION, AVR32_LEAVE_CRITICAL_REGION, and SCIF_UNLOCK.
void scif_start_rc8M | ( | void | ) |
Start the 8MHz internal RCosc (RC8M) clock.
Start the 8MHz internal RCosc (RC8M) clock.
Critical Path Oscillator Functions 8MHz RCosc Functions
References AVR32_ENTER_CRITICAL_REGION, AVR32_LEAVE_CRITICAL_REGION, and SCIF_UNLOCK.
long int scif_stop_gclk | ( | unsigned int | gclk | ) |
Stop a generic clock.
gclk | The generic clock number to stop. |
0 | Success. |
<0 | Unable to stop generic clock. |
References PASS, and SCIF_POLL_TIMEOUT.
Referenced by scif_gc_setup().
long int scif_stop_osc | ( | scif_osc_t | osc | ) |
Stop an oscillator.
osc | The oscillator to stop |
0 | Oscillator successfully stopped. |
<0 | An error occurred when stopping the oscillator. |
References AVR32_ENTER_CRITICAL_REGION, AVR32_LEAVE_CRITICAL_REGION, PASS, SCIF_UNLOCK, and temp.
long int scif_stop_osc32 | ( | void | ) |
Stop the OSC32 oscillator.
0 | Oscillator successfully stopped. |
<0 | An error occurred when stopping the oscillator. |
References AVR32_ENTER_CRITICAL_REGION, AVR32_LEAVE_CRITICAL_REGION, PASS, SCIF_UNLOCK, and temp.
void scif_stop_rc120M | ( | void | ) |
Stop the 120MHz internal RCosc (RC120M) clock.
References AVR32_ENTER_CRITICAL_REGION, AVR32_LEAVE_CRITICAL_REGION, SCIF_UNLOCK, and temp.
void scif_stop_rc8M | ( | void | ) |
Stop the 8MHz internal RCosc (RC8M) clock.
References AVR32_ENTER_CRITICAL_REGION, AVR32_LEAVE_CRITICAL_REGION, SCIF_UNLOCK, and temp.
|
static |
Disable the temperature sensor.
References SCIF_UNLOCK.
|
static |
Enable the temperature sensor.
References SCIF_UNLOCK.
long int scif_wait_for_pll_locked | ( | scif_pll_t | pll | ) |
This function will wait for PLL locked.
pll | The PLL to configure [INPUT] |
0 | PLL successfully started |
<0 | Error starting the PLL. |
References PASS, and SCIF_PLL0.
Referenced by clockfrequencies_configure(), local_start_highfreq_clock(), and pcl_configure_usb_clock().
void scif_write_gplp | ( | int | gplp, |
unsigned long | value | ||
) |
Write into the SCIF GPLP registers.
gplp | GPLP register index (0,1,... depending on the number of GPLP registers for a given part) |
value | Value to write |
References SCIF_UNLOCK.
Referenced by pcl_write_gplp().