Add uart synchronous transmit
This commit is contained in:
parent
50ff908582
commit
c745cd330f
13
drivers/uart_tx.c
Normal file
13
drivers/uart_tx.c
Normal file
@ -0,0 +1,13 @@
|
||||
#include "uart_tx.h"
|
||||
#include "uart.h"
|
||||
#include <avr/io.h>
|
||||
#include <avr/interrupt.h>
|
||||
|
||||
void __attribute__ ((naked)) __attribute__ ((section (".init6"))) uart_tx_init() {
|
||||
UCSR0B |= (1<<TXEN0);
|
||||
}
|
||||
|
||||
void uart_putc(unsigned char c) {
|
||||
while( ( UCSR0A & ( 1 << UDRE0 ) ) == 0 ) {}
|
||||
UDR0 = c;
|
||||
}
|
1
drivers/uart_tx.h
Normal file
1
drivers/uart_tx.h
Normal file
@ -0,0 +1 @@
|
||||
void uart_putc(unsigned char c);
|
Loading…
Reference in New Issue
Block a user