#include "pll.h"

extern void setGPIO();
extern void clrGPIO();


void testPLLCalc(UINT32 idx)
{
    void *handle = NULL;
    INT32 i= 0;
    FLOAT32 a, b, c;
    PLLOUT_OBJ out_obj = {0};
    // struct hwtimer_ctrl_info info, info2;

    handle = PLLCfg(0.00003, PLL_LPF_WC, PLL_FREQ_KP, PLL_FREQ_KI, PLL_PI_LIMIT);

    //DELAY_US(100);
    a = 123.45;
    b = 456.45;
    c = 778.45;
    out_obj.ua_inv_sample = &a;
    out_obj.ub_inv_sample = &b;
    out_obj.uc_inv_sample = &c;

    GPIO_write(idx, 1);
    for (i = 0; i < 2; i++) {
        PLLCalc(&out_obj, handle, 0.00003);
    }
    GPIO_write(idx, 0);
}

