#include <avr/io.h>
#include <util/delay.h>

#include "twi.h"
#include "si5351.h"

int main(void) {

    twi_init();

    si5351_init(25000000, 800000000, 500000000);
    si5351_ms_set_source(SI5351_MS0, SI5351_PLLA);
    uint32_t base = 7165000;
    uint32_t ppm_err = 9;
    uint32_t err = base * ppm_err / 1000000;
    uint32_t target = base - err;

    si5351_ms_set_freq(SI5351_MS0, target);
    si5351_ms_enable_output(SI5351_MS0);




    while(1);
}
