AVRTools
A Library for the AVR ATmega328 and ATmega2560 Microcontrollers
USART1Minimal.h
Go to the documentation of this file.
1 /*
2  USART1Minimal.h - Minimal, light-weight functions to use
3  USART1 available on ATMega2560 (Arduino Mega) processors (no buffering).
4  This is part of the AVRTools library.
5  Copyright (c) 2015 Igor Mikolic-Torreira. All right reserved.
6  Functions readlong() and readFloat() adapted from Arduino code that
7  is Copyright (c) 2005-2006 David A. Mellis and licensed under LGPL.
8 
9  This program is free software: you can redistribute it and/or modify
10  it under the terms of the GNU Lesser General Public License as published by
11  the Free Software Foundation, either version 3 of the License, or
12  (at your option) any later version.
13 
14  This program is distributed in the hope that it will be useful,
15  but WITHOUT ANY WARRANTY; without even the implied warranty of
16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  GNU Lesser General Public License for more details.
18 
19  You should have received a copy of the GNU Lesser General Public License
20  along with this program. If not, see <http://www.gnu.org/licenses/>.
21 */
22 
23 
24 
47 #ifndef USART1Minimal_h
48 #define USART1Minimal_h
49 
50 
51 
52 #if defined(__AVR_ATmega2560__)
53 
54 
55 
70 void initUSART1( unsigned long baudRate );
71 
72 
85 void transmitUSART1( unsigned char data );
86 
87 
100 void transmitUSART1( const char* data );
101 
102 
115 unsigned char receiveUSART1();
116 
117 
127 void releaseUSART1();
128 
129 
130 
131 #endif
132 
133 
134 
135 #endif
unsigned char receiveUSART1()
Receive a byte on USART1.
Definition: USART1Minimal.cpp:75
void releaseUSART1()
Release USART1, making pins 0 and 1 again available for non-USART use.
Definition: USART1Minimal.cpp:83
void initUSART1(unsigned long baudRate)
Initialize USART1 for serial receive and transmit.
Definition: USART1Minimal.cpp:42
void transmitUSART1(unsigned char data)
Transmit a single byte on USART1.
Definition: USART1Minimal.cpp:53