//------------------------------------------------------------ //用户配置数据 #define TSYN 33 #define TSDR 20 //bit times! #define PB_ADR 8 #define MAX_LENGTH 22 //max length of telegrams #define TIMER_INIT 256 - 4 * (TSYN + TSDR) //timer0 counts 4 times to generate irq #define TSYN_COUNTER TIMER_INIT + 4 * TSYN //this is what the timer should contain at tsyn #define BR_DIV 1 //baud rate divider for desired baud //rate - here 187.5kbps @ 6MHz #define UART_CTRL_INIT 0b10010100 //enables recv-irq, recv and 9th bit
//串口标记定义 #define LE_valid 1 //Bit0: LE-gueltig #define LE_validbit 0 //Bit0: LE-gueltig #define variable 2 //Bit1: variabel #define variablebit 1 //Bit1: variabel #define counter_set1 4 //Bit2: counter_set1 #define counter_set1bit 2 //Bit2: counter_set1 #define counter_set2 8 //Bit3: counter_set2 #define counter_set2bit 3 //Bit3: counter_set2 #define telegr_end 16 //Bit4: telegr_end #define telegr_endbit 4 //Bit4: telegr_end #define recv_enabled 32 //Bit5: the receiver is being used #define recv_enabledbit 5 //Bit5: the receiver is being used #define tran_enabled 64 //Bit6: the tranceiver is being used #define tran_enabledbit 6 //Bit6: the tranceiver is being used #define adr_valid 128 //Bit7: this telegram has our adress #define adr_validbit 7