/*
Diplomova prace : Palubni pocitac

pca9530.c

Atmega128A 10 MHz XTAL

Autor: Ondrej Lutera

2011/2012

*/

#include "pca9530.h"


void initPCA(void)
{

    i2cInit();


}

void setPCA(pca_t * data)
{

    unsigned char buf[6];


    buf[0] = data->frek0;

    if(buf[0]>152) buf[0]=152;

    buf[0] = (152/ buf[0])-1;


    buf[1]=data->pwm0;


    buf[2] = data->frek1;

    if(buf[2]>152) buf[2]=152;

    buf[2] = (152/ buf[2])-1;

    buf[3]=data->pwm1;

    buf[4]=data->ls;

    i2cSend(PCA9530, PCA_REG , 5, buf);


};
