main
Last change
on this file since e545350 was e5dd493, checked in by Adrien Destugues <pulkomandy@…>, 5 years ago |
usart: some cleanups.
|
-
Property mode
set to
100644
|
File size:
871 bytes
|
Rev | Line | |
---|
[b82c7b3] | 1 | /* USART i/o library
|
---|
[e5dd493] | 2 | * Copyright 2010-2019, Adrien Destugues <pulkomandy@pulkomandy.tk>
|
---|
[b82c7b3] | 3 | * Distributed under the terms of the MIT Licence */
|
---|
| 4 |
|
---|
[e5dd493] | 5 | /** Initialize the USART.
|
---|
| 6 | *
|
---|
| 7 | * Baudrate is set according to the BAUD define.
|
---|
| 8 | * Currently the USART is set to 8N1, except on ATmega128 where it's set to 7E1
|
---|
| 9 | * (don't ask why, I don't remember). This should be made configurable.
|
---|
| 10 | *
|
---|
| 11 | * On ATmega128, this always uses the first USART.
|
---|
| 12 | */
|
---|
[cd3a9ac] | 13 | void USARTInit();
|
---|
[e5dd493] | 14 |
|
---|
| 15 | /** Write a byte to the USART.
|
---|
| 16 | *
|
---|
| 17 | * This function blocks if the USART is not ready to accept any data. There is
|
---|
| 18 | * no IO buffering.
|
---|
| 19 | */
|
---|
[b82c7b3] | 20 | void USARTWriteChar(char data);
|
---|
[e5dd493] | 21 |
|
---|
| 22 | /** Write an 8bit integer as hex to the USART.
|
---|
| 23 | */
|
---|
[b82c7b3] | 24 | void USARTWriteHex(unsigned char i);
|
---|
[e5dd493] | 25 |
|
---|
| 26 | /** This function is used to read the available data from USART.
|
---|
| 27 | *
|
---|
| 28 | * It waits untill data is available.
|
---|
| 29 | */
|
---|
| 30 | char USARTReadChar();
|
---|
Note:
See
TracBrowser
for help on using the repository browser.