USB2SerialMux/firmware/globals.h

58 lines
1.5 KiB
C
Executable file

/*****************************************************************************/
/* Message byte definitions: */
#define MSG_SOM1 0x3c
#define MSG_SOM2 0x3e
#define MSG_EOM1 0x0d
#define MSG_EOM2 0x0a
#define MSG_TYPE_ANSWER_OK 0x01
#define MSG_TYPE_ANSWER_NOK 0x02
#define MSG_TYPE_BAUDRATE 0x03
/*****************************************************************************/
#define EN_MUX_LINE0 \
PORTB &= ~(1 << PIN4); \
PORTB &= ~(1 << PIN5); \
PORTB &= ~(1 << PIN6); \
#define EN_MUX_LINE1 \
PORTB &= ~(1 << PIN4); \
PORTB &= ~(1 << PIN5); \
PORTB |= (1 << PIN6); \
#define EN_MUX_LINE2 \
PORTB &= ~(1 << PIN4); \
PORTB |= (1 << PIN5); \
PORTB &= ~(1 << PIN6); \
#define EN_MUX_LINE3 \
PORTB &= ~(1 << PIN4); \
PORTB |= (1 << PIN5); \
PORTB |= (1 << PIN6); \
#define EN_MUX_LINE4 \
PORTB |= (1 << PIN4); \
PORTB &= ~(1 << PIN5); \
PORTB &= ~(1 << PIN6); \
#define EN_MUX_LINE5 \
PORTB |= (1 << PIN4); \
PORTB &= ~(1 << PIN5); \
PORTB |= (1 << PIN6); \
#define EN_MUX_LINE6 \
PORTB |= (1 << PIN4); \
PORTB |= (1 << PIN5); \
PORTB &= ~(1 << PIN6); \
#define EN_MUX_LINE7 \
PORTB |= (1 << PIN4); \
PORTB |= (1 << PIN5); \
PORTB |= (1 << PIN6); \
/*****************************************************************************/