USB2SerialMux/firmware/globals.h

66 lines
1.7 KiB
C
Raw Normal View History

/*****************************************************************************/
/* 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 MSG_TYPE_MUXLINE 0x04
/*****************************************************************************/
#define LED0_ON PORTB &= ~(1 << PIN0);
#define LED0_OFF PORTB |= (1 << PIN0);
#define LED1_ON PORTB &= ~(1 << PIN1);
#define LED1_OFF PORTB |= (1 << PIN1);
/*****************************************************************************/
#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); \
/*****************************************************************************/