BLDC control on ATAVRMC303 with ATxMega128A1
clksys_driver.h
Go to the documentation of this file.
1 /* This file has been prepared for Doxygen automatic documentation generation.*/
60 #ifndef CLKSYS_DRIVER_H
61 #define CLKSYS_DRIVER_H
62 
63 #include <stdint.h>
64 #include <stdbool.h>
65 #include <ioavr.h>
66 
67 
68 /* Definitions of macros. */
69 
81 #define CLKSYS_Enable( _oscSel ) ( OSC.CTRL |= (_oscSel) )
82 
94 #define CLKSYS_IsReady( _oscSel ) ( OSC.STATUS & (_oscSel) )
95 
101 #define CLKSYS_RTC_ClockSource_Disable() ( CLK.RTCCTRL &= ~CLK_RTCEN_bm )
102 
108 #define CLKSYS_AutoCalibration_Disable( _clk ) ( (_clk).CALA &= ~DFLL_ENABLE_bm )
109 
110 
111 /* Prototyping of function. Detailed information is found in source file. */
112 void CLKSYS_XOSC_Config( OSC_FRQRANGE_t freqRange,
113  bool lowPower32kHz,
114  OSC_XOSCSEL_t xoscModeSelection );
115 void CLKSYS_PLL_Config( OSC_PLLSRC_t clockSource, uint8_t factor );
116 uint8_t CLKSYS_Disable( uint8_t oscSel );
117 void CLKSYS_Prescalers_Config( CLK_PSADIV_t PSAfactor,
118  CLK_PSBCDIV_t PSBCfactor );
119 uint8_t CLKSYS_Main_ClockSource_Select( CLK_SCLKSEL_t clockSource );
120 void CLKSYS_RTC_ClockSource_Enable( CLK_RTCSRC_t clockSource );
121 void CLKSYS_AutoCalibration_Enable( uint8_t clkSource, bool extReference );
123 void CLKSYS_Configuration_Lock( void );
124 
125 
126 #endif
void CLKSYS_Prescalers_Config(CLK_PSADIV_t PSAfactor, CLK_PSBCDIV_t PSBCfactor)
This function changes the prescaler configuration.
void CLKSYS_XOSC_FailureDetection_Enable(void)
This function enables the External Oscillator Failure Detection (XOSCFD) feature. ...
void CLKSYS_PLL_Config(OSC_PLLSRC_t clockSource, uint8_t factor)
This function configures the internal high-frequency PLL.
void CLKSYS_AutoCalibration_Enable(uint8_t clkSource, bool extReference)
This function enables automatic calibration of the selected internal oscillator.
void CLKSYS_RTC_ClockSource_Enable(CLK_RTCSRC_t clockSource)
This function selects a Real-Time Counter clock source.
void CLKSYS_XOSC_Config(OSC_FRQRANGE_t freqRange, bool lowPower32kHz, OSC_XOSCSEL_t xoscModeSelection)
This function configures the external oscillator.
uint8_t CLKSYS_Disable(uint8_t oscSel)
This function disables the selected oscillator.
void CLKSYS_Configuration_Lock(void)
This function lock the entire clock system configuration.
uint8_t CLKSYS_Main_ClockSource_Select(CLK_SCLKSEL_t clockSource)
This function selects the main system clock source.