DRV_CLOCK
DRV_CLOCK API Status
API |
|---|
DRV_CLOCK API Reference
Header File
Functions
-
int32_t drv_clk_dpll_enable(uint32_t req_freq_Mhz)
打开DPLL,并提供对应的频率输出.
这里只是打开DPLL,对应的模块是否使用该clock还需要手动切换
- 参数:
req_freq_Mhz – [in] 期望的PLL输出的频率,单位是Mhz
- 返回值:
0 – success [BK_RET_OK]
other – fail
- 返回:
result
-
int32_t drv_clk_dpll_disable(void)
关闭DPLL
关闭前使用到DPLL的模块需要先进行切换,否则会挂掉
- 返回值:
0 – success [BK_RET_OK]
other – fail
- 返回:
result
-
int32_t drv_clk_dpll_calibration(void)
对DPLL进行校准.
先要打开DPLL才调用该函数进行校准,在以下几种情况需要校准 第一次开机或者从下电后的唤醒启动 改变频率或者温度改变太大
- 返回值:
0 – success [BK_RET_OK]
other – fail
- 返回:
result
-
int32_t drv_clk_apll_enable(float req_freq_Mhz)
打开APLL,并提供对应的频率输出.
这里只是打开APLL,对应的模块是否使用该clock还需要手动切换
- 参数:
req_freq_Mhz – [in] 期望的PLL输出的频率,单位是Mhz
- 返回值:
0 – success [BK_RET_OK]
other – fail
- 返回:
result
-
int32_t drv_clk_apll_disable(void)
关闭APLL
关闭前使用到APLL的模块需要先进行切换,否则会挂掉
- 返回值:
0 – success [BK_RET_OK]
other – fail
- 返回:
result
-
bool drv_clk_apll_is_active(void)
check if APLL is active or not.
- 返回值:
true – active
false – inactive
- 返回:
active status
-
int32_t drv_clk_apll_calibration(float req_freq_Mhz)
对APLL进行校准.
先要打开APLL才调用该函数进行校准
- 参数:
req_freq_Mhz – [in] 期望的PLL输出的频率,单位是Mhz
- 返回值:
0 – success [BK_RET_OK]
other – fail
- 返回:
result
-
int32_t drv_clk_apll_unlock_det_en(bool enable)
打开APLL的失锁检测功能
- 参数:
enable – [in] true:打开检测功能 false:关闭检测
- 返回值:
0 – success [BK_RET_OK]
other – fail
- 返回:
result
-
int32_t drv_clk_apll_fine_tuning(int32_t adjust_val)
APLL 微调
微调APLL的clock
- 参数:
adjust_val – [in] >0 频率升高 <0 频率降低
- 返回值:
0 – success [BK_RET_OK]
other – fail
- 返回:
result
-
int32_t drv_clk_rc32k_calibration(bool first_cal)
RC32K calibration,.
手动触发32K的校准,校准完成时间需要25ms
- 参数:
first_cal – [in] true: first calibration
- 返回值:
0 – success [BK_RET_OK]
other – fail
- 返回:
result
-
int32_t drv_clk_rc32k_fine_tuning(int32_t fine_val, uint32_t coarse_val)
RC32K 微调
手动控制或者微调32K
- 参数:
fine_val – [in] 变大频率升高 变小频率降低
coarse_val – [in] 默认粗调值
- 返回值:
0 – success [BK_RET_OK]
other – fail
- 返回:
result
-
int32_t drv_clk_rc32k_manual_fine_tuning(int32_t adjust_val)
RC32K 手动微调
- 返回值:
0 – success [BK_RET_OK]
other – fail
- 返回:
result
-
int32_t drv_clk_rc32k_manual_coarse_tuning(int32_t adjust_val)
RC32K 手动粗调
- 返回值:
0 – success [BK_RET_OK]
other – fail
- 返回:
result
-
int32_t drv_clk_get_rc32k_fine_value(void)
-
int32_t drv_clk_set_rc32k_fine_value(int32_t fine_val)
-
int32_t drv_clk_rc32k_tuning_force(int32_t fine_val, uint32_t coarse_val)
直接控制rc32k调整参数,用于校准时使用
- 参数:
fine_val – [in] 细调参数
coarse_val – [in] 粗调参数
- 返回值:
0 – success [BK_RET_OK]
other – fail
- 返回:
result
-
int32_t drv_clk_xtal26M_lowpower_en(bool enable)
26M low power设定
在RF没有工作的时候可以设置26M进低功耗
- 参数:
enable – [in] true: 进low power false: 退出low power
- 返回值:
0 – success [BK_RET_OK]
other – fail
- 返回:
result
-
int32_t drv_clk_xtal26M_fine_tuning(int32_t adjust_val)
26M 微调
- 参数:
adjust_val – [in] >0 频率升高 <0 频率降低
- 返回值:
0 – success [BK_RET_OK]
other – fail
- 返回:
result
-
void drv_clk_test_buf_for_dpll(void)
-
void drv_clk_test_buf_for_apll(void)
Macros
-
COARSE_DEFAULT_VALUE
-
FINE_DEFAULT_VALUE