22 #define MAX_RECEIVE_TIMEOUT 102000 25 #define MAX_SIZE_TRANSMIT_BUFFER 1024 28 #define RS_485_PORT PORTE 29 #define RS_485_DIR DDRE 30 #define RS_485_ENABLE_BIT 3 33 #define ENABLE_RS485_TRANSMIT RS_485_PORT |= (1<<RS_485_ENABLE_BIT) 34 #define ENABLE_RS485_RECEIVE RS_485_PORT &= ~(1<<RS_485_ENABLE_BIT) 36 #define ENABLE_RS485_TRANSMIT 37 #define ENABLE_RS485_RECEIVE 41 #define DISENABLE_COM0_ISR UCSR0B &= ~(1 << RXCIE0); 42 #define ENABLE_COM0_ISR UCSR0B |= (1 << RXCIE0); 43 #define USART0_STATUS UCSR0A 46 #define ENABLE_TRANSMIT_ISR UCSR1B |= (1 << TXCIE1); 47 #define DISENABLE_TRANSMIT_ISR UCSR1B &= ~(1 << TXCIE1); 49 #define ERROR_FLAGS (1<<FE0)|(1<<DOR0)|(1<<UPE0) 52 #define COM_ERR_OFF INDICATION_PORT |= (1<<COM_ERR_LED) 53 #define COM_ERR_ON INDICATION_PORT &= ~(1<<COM_ERR_LED) 56 #define SEND_DEBUG( s ) USART1_Transmit_string ( s ) 58 #define SEND_DEBUG( s ) 62 #define SEND_DEBUG_2( s ) USART1_Transmit_string ( s ) 64 #define SEND_DEBUG_2( s ) 68 #define SEND_DEBUG_CHAR( c ) USART1_Transmit ( c ) 70 #define SEND_DEBUG_CHAR( s ) void USART1_int_transmit_string(unsigned char *string)
void USART1_init(void)
Initialization of USART1.
Definition: rs.c:159
void USART1_Transmit_string(unsigned char *string)
Sends a string from USART0.
Definition: rs.c:237
void USART0_init(void)
Initialization of USART0. USART0 settings 7 data, 1 stop bit, No parity. USART0 is used for ModBus co...
Definition: rs.c:75
void USART0_Transmit_string(unsigned char *string)
Sends a string from USART0.
Definition: rs.c:115
void USART1_Transmit(unsigned char character)
Send one character from USART1.
Definition: rs.c:208
void USART0_Transmit(unsigned char character)
Sends a character from USART0.
Definition: rs.c:97