Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00025 #ifndef HAL_CLK_H__
00026 #define HAL_CLK_H__
00027
00028 #include <stdint.h>
00029 #include <stdbool.h>
00030
00034 typedef enum
00035 {
00036 HAL_CLK_XOSC16_OR_RCOSC16 = 0,
00037 HAL_CLK_PAD_XC1 = 1
00038 } hal_clk_input_t;
00039
00043 typedef enum
00044 {
00045 HAL_CLK_XOSC16M_AND_RCOSC16M = 0,
00046 HAL_CLK_RCOSC16M = 1,
00047 HAL_CLK_XOSC16M = 2
00048 } hal_clk_source_t;
00049
00053 typedef enum
00054 {
00055 HAL_CLK_16MHZ = 0,
00056 HAL_CLK_8MHZ = 1,
00057 HAL_CLK_4MHZ = 2,
00058 HAL_CLK_2MHZ = 3,
00059 HAL_CLK_1MHZ = 4,
00060 HAL_CLK_500KHZ = 5,
00061 HAL_CLK_250KHZ = 6,
00062 HAL_CLK_125KHZ = 7
00063 } hal_clk_freq_t;
00064
00068 typedef enum
00069 {
00070 HAL_CLKLF_XOSC32K = 0,
00071 HAL_CLKLF_RCOSC32K = 1,
00072 HAL_CLKLF_XOSC16M_SYNTH = 2,
00073 HAL_CLKLF_PAD_XC1 = 3,
00074 HAL_CLKLF_DIG_IO_RAIL = 4,
00075 HAL_CLKLF_NONE = 7
00076 } hal_clklf_source_t;
00077
00082 void hal_clk_regret_xosc16m_on(bool on);
00083
00090 void hal_clk_set_input(hal_clk_input_t input);
00091
00102 void hal_clk_set_16m_source(hal_clk_source_t source);
00103
00109 hal_clk_source_t hal_clk_get_16m_source(void);
00110
00123 void hal_clk_set_freq(hal_clk_freq_t freq);
00124
00128 bool hal_clklf_phase(void);
00129
00133 bool hal_clklf_ready(void);
00134
00143 void hal_clklf_set_source(hal_clklf_source_t source);
00144
00145 #endif // HAL_CLK_H__
00146