Revision 241
implementing uart
test7.c | ||
---|---|---|
22 | 22 |
default: return INVALID_ARG; |
23 | 23 |
} |
24 | 24 |
int ret = SUCCESS; |
25 |
|
|
26 |
uint8_t conf = 0; |
|
27 |
conf |= (bits-5)<<UART_BITS_PER_CHAR_POS; |
|
28 |
conf |= (stop-1)<<UART_STOP_BITS_POS; |
|
29 |
conf |= par <<UART_PARITY_POS; |
|
30 |
|
|
31 |
//if((ret = uart_set_bits_per_character(base_addr, bits))) return ret; tickdelay(micros_to_ticks(100000)); |
|
32 |
//if((ret = uart_set_stop_bits (base_addr, stop))) return ret; tickdelay(micros_to_ticks(100000)); |
|
33 |
//if((ret = uart_set_parity (base_addr, par ))) return ret; tickdelay(micros_to_ticks(100000)); |
|
34 |
if((ret = uart_write_config(base_addr, conf))) return ret; |
|
25 |
if((ret = uart_set_bits_per_character(base_addr, bits))) return ret; tickdelay(micros_to_ticks(100000)); |
|
26 |
if((ret = uart_set_stop_bits (base_addr, stop))) return ret; tickdelay(micros_to_ticks(100000)); |
|
27 |
if((ret = uart_set_parity (base_addr, par ))) return ret; tickdelay(micros_to_ticks(100000)); |
|
35 | 28 |
if((ret = uart_set_bit_rate (base_addr, rate))) return ret; tickdelay(micros_to_ticks(100000)); |
36 | 29 |
|
37 | 30 |
return SUCCESS; |
Also available in: Unified diff