mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-07 12:33:42 +00:00
avr: implement UART interface
Signed-off-by: Ron Evans <ron@hybridgroup.com>
This commit is contained in:
committed by
Ayke van Laethem
parent
bcf441ccba
commit
4c8a725d78
@@ -54,9 +54,10 @@ func init() {
|
||||
}
|
||||
|
||||
func initUART() {
|
||||
// Initialize UART at 115200 baud when running at 16MHz.
|
||||
// Initialize UART at 9600 baud when running at 16MHz.
|
||||
*avr.UBRR0H = 0
|
||||
*avr.UBRR0L = 8
|
||||
*avr.UBRR0L = 0x67
|
||||
|
||||
*avr.UCSR0B = avr.UCSR0B_RXEN0 | avr.UCSR0B_TXEN0 // enable RX and TX
|
||||
*avr.UCSR0C = avr.UCSR0C_UCSZ01 | avr.UCSR0C_UCSZ00 // 8-bits data
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user