/*
Diplomova prace : Palubni pocitac

pca9530.h

Atmega128A 10 MHz XTAL

Autor: Ondrej Lutera

2011/2012

*/

#ifndef PCA9530_H_INCLUDED
#define PCA9530_H_INCLUDED

#include <avr/io.h>
#include "i2csw.h"

#define PCA9530     0xC0
#define PCA_REG     0x11

#define CH0_PWM0    2
#define CH1_PWM1    0x0C

typedef struct{

    unsigned char frek0;        /* frekvence vystupu 0 : 0 az 152 Hz */
    unsigned char frek1;        /* frekvence vystupu 1 : 0 az 152 Hz */
    unsigned char pwm0;         /* pwm vystupu 0 : 0 az 255 */
    unsigned char pwm1;         /* pwm vystupu 1 : 0 az 255 */
    unsigned char ls;           /* vyber kanalu pomoc CH0_PWM0 a CH1_PWM1 */

}pca_t;

void initPCA(void); /* inicializace zarizeni */

void setPCA(pca_t * data);  /* nastaveni PCA */



#endif // PCA9530_H_INCLUDED
