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

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

int main(void) {

    twi_init();

    si5351_init(25000000, 800000000, 500000000);
    si5351_ms_set_source(SI5351_MS0, SI5351_PLLA);



    //si5351_ms_set_freq(SI5351_MS0, 7040100);
    //si5351_ms_enable_output(SI5351_MS0);
    //si5351_ms_write_params(SI5351_MS0, WSPR_SYMBOLS[3]);


    uint8_t wspr_buffer[WSPR_LENGTH];

    wspr_encode("DL1SSK", "JN39", 27, wspr_buffer);
    wspr_transmit(SI5351_MS0, wspr_buffer);


    while(1);
}
