
//definice HW: funkce pro inicializaci portu, kde jsou pripojeny
//chip selecty
#define STPM_CS_INIT()	{LATB|=0b00001111;TRISB&=0b11110000;}

//vypnuti vsech CS
#define STPM_CS_OFF()	{LATB|=0b00001111;}

//zapnuti CS STPM10 cislo x (x je 0 .. STPM_NUMBER-1)
#define STPM_CS_ON(x)	{LATB&=~(1<<x);}

//definice HW: pripojeni knihovny pro komunikaci SPI
void initSPI(void);

//definice HW: posle SYNC a zapne CS
void sendSync(unsigned char stpmId);

//definice HW: vycte blok dat z STPM
void readSTPM(unsigned char stpmId, unsigned char bytes, unsigned char * block);

//definice HW: zapis bitu na STPM
void writeSTPMBit(unsigned char stpmId, unsigned char bitId, unsigned char value);

