feat: 添加LMK04828锁定状态的回读

This commit is contained in:
2025-06-05 16:52:31 +08:00
parent 7dc59a4b46
commit 0d6a5491ad
3 changed files with 31 additions and 6 deletions
+22
View File
@@ -494,3 +494,25 @@ uint8_t Hardware_GetAD9528LockStatus(void)
return ret;
}
// @ Determine LMK04828 lock state
/**
* Read corresponding register to determine clock lock state.
*/
uint8_t Hardware_GetLMK04828LockStatus(void)
{
ASSERT(lmk04828_inst != NULL);
uint8_t ret = 0;
uint8_t regVal;
// pll1
lmk04828_read(lmk04828_inst, 0x0182, &regVal); // [D1] is lock indicator
ret |= ((regVal & 0x02) == 0x02) ? CLK_SP_PLL1_LOCK : 0;
// pll2
lmk04828_read(ad9528_inst, 0x0183, &regVal); // [D1] is lock indicator
ret |= ((regVal & 0x02) == 0x02) ? CLK_SP_PLL2_LOCK : 0;
return ret;
}