/*
 * MD_USB.h
 *
 * Created: 13.1.2013 16:49:05
 *  Author: MichalM11x
 */
#ifndef MD_USB_H_
#define MD_USB_H_
 
#include "MD_POT.h"
#include "usbdrv.h"


/*#define USB_LED_OFF 0
#define USB_LED_ON  1
#define USB_DATA_OUT 2
#define USB_DATA_WRITE 3*/
#define USB_LED_OFF 0
#define USB_LED_ON 1
#define USB_DPOT_PERM 2
#define USB_DPOT_TEMP 3
#define USB_SEMAF_MODE 4
#define USB_SEMAF_STATE 5
#define USB_FB 6
#define USB_DPOT_RESET 7

#define GREEN 0x0a
#define RED 0x0c
#define ORANGE 0x0d
#define YELLOW 0x09
#define MAZ(x) (~(7<<x))

extern semafors *hold;
extern digpot *pots;

void usb_init(void);
void msg_interpret(void);

void msg_semaf(semafors *states);
uint8_t semaf_pins(unsigned char state, unsigned char port);
void msg_semaf_info(uchar pocet, uchar s1, uchar s2, uchar s3, uchar s4, uchar s5, uchar s6);

void msg_onedpot(uchar sel, uchar value);
void msg_alldpot(uchar v1, uchar v2, uchar v3);

#endif