AVRTools
A Library for the AVR ATmega328 and ATmega2560 Microcontrollers
Loading...
Searching...
No Matches
USART2Minimal.h
Go to the documentation of this file.
1/*
2 USART2Minimal.h - Minimal, light-weight functions to use
3 USART2 available on ATMega2560 (Arduino Mega) processors (no buffering).
4 This is part of the AVRTools library.
5 Copyright (c) 2014 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 USART2Minimal_h
48#define USART2Minimal_h
49
50
51
52#if defined(__AVR_ATmega2560__)
53
54
55
70void initUSART2( unsigned long baudRate );
71
72
85void transmitUSART2( unsigned char data );
86
87
100void transmitUSART2( const char* data );
101
102
115unsigned char receiveUSART2();
116
117
127void releaseUSART2();
128
129
130
131#endif
132
133
134
135#endif
void transmitUSART2(unsigned char data)
Transmit a single byte on USART2.
Definition USART2Minimal.cpp:49
unsigned char receiveUSART2()
Receive a byte on USART2.
Definition USART2Minimal.cpp:71
void initUSART2(unsigned long baudRate)
Initialize USART2 for serial receive and transmit.
Definition USART2Minimal.cpp:38
void releaseUSART2()
Release USART2, making pins 0 and 1 again available for non-USART use.
Definition USART2Minimal.cpp:79