afiskon / stm32-si5351

HAL-based Si5351 driver for STM32
https://eax.me/stm32-si5351/
MIT License
48 stars 13 forks source link

Add xtal freq define #3

Closed BitLoose closed 11 months ago

BitLoose commented 11 months ago

Thanks, excellent code. I'd put the xtal frequency in the header so people can set it.

A routine to change the frequency with minimal interefence would be useful.

afiskon commented 11 months ago

You can adjust the library for the particular crystal by passing a correction factor to si5351_Init(). Please see the comments https://github.com/afiskon/stm32-si5351/blob/main/si5351/si5351.c#L102

If you mean supporting other crystal than 25 MHz, e.g. 27 MHz, I suspect this will require somewhat invasive changes, perhaps a separate version of si5351_Calc(). Personally I have no interest in such a functionality, nor have I hardware that would allow to test it, but feel free submitting a pull request.