Ddr-ArdMeg - Device DriveR for Arduino Mega 2560 and other boards
This is a part of the Ddr-ArdMeg device driver library for
the Arduino Mega 2560 (and other boards).
http://ddrardmeg.sourceforge.net/
Copyright (c) 2014-2017, Nils Paulsson, Lonfield C&D, Linkoping, Sweden.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
DESCRIPTION
This is a device driver package for (aomong others) the
Arduino MEGA 2560 Board. It's a source code only package to be used
together with GCC and AVR Libc.
REVISION HISTORY
Beta release 1.00, April 10th, 2017
Initial beta release.
WHERE TO START
Ddr-ArdMeg is distributed as source code only. In other words:
1. Download the source files package.
2. Decompress the downloaded file to a suitable directory.
3. Import the CPP- and H-files into your project.
Ddr-ArdMeg supports other boards than the Arduino Mega 2560 and needs
to be configured accordingly. The specific setup is defined by the file
Configure.h (located in the root directory of the distribution package),
which has to be included and correctly setup for the specific project.
So, make sure Configure.h is included in the include path of the project.
INSTALLATION
To install the package, uncompress the zip-at a suitable location.
MODULES
Analog This is a device driver for the built-in A/D converter.
Binary - Defines binary number representation to be used directly
in code, e.g. b1001 or B0101.
Configure - Defines which of the supported boards (Arduino Mega 2560,
Moteino MEGA, ...) Ddr-ArdMeg shall be compiled for.
BootLoad - Very basic Store Program Memory (SPM) support.
Eeprom Module for writing and reading the MCU internal EEPROM.
ExtIrq Module that provides support for external interrupts as well
as pin-change interrupts.
Mcu Module for low level control of the MCU including controlling
pull-up resistors on pins.
Pin Provides support for controlling and manipulating digital IO-pins.
Port Provides support for controlling and manipulating digital IO-ports.
Register Provides support for reading and writing control and status
registers for periferal devices.
Serial This is the fundamental module for for serial port (RS232)
communication. This module is used for setup and control of the serial
ports whereas SerialAsycn and SerialSynch provide the actual communication
primitives.
SerialAsynch - Provides communication primitives for asynchronous, interrupt
driven and buffered serial communication.
SerialSynch - Provides communication primitives for synchronous, polled,
non-buffered serial communication.
Spi This is the fundamental module for for Spi communication. This module
is used for setup and control of the Spi-port whereas SpiAsync and SpiSynch
provide the actual communication primitives.
SpiAsync - Provides communication primitives for asynchronous, interrupt
driven and buffered Spi communication.
SpiSynch - Provides communication primitives for synchronous, polled,
non-buffered Spi communication.
Util Provides some utility functions such as efficient circular buffers
and sign().
GENERAL NOTES
- The deployment board (Arduino Mega 2560, MoteinoMEGA, ...) of a project
has to be defined in the Configure.h file. This file is located in the
root directlry of the package. Set the parameter CFG_BOARD in the beginning
of Configure.h to the selected board (ARDUINO_MEGA_2560, MOTEINO_MEGA, ...).
Select only one board at a time.
- Compiler errors such as:
error: 'PIN_D45' is not a member of 'Pin'
or warnings about undefined interrupt service routines, are sure signs of a
missmatch between the target MCU setting of GCC/AVR Libc and the target board
setting in Configure.h.
NOTES REVISION - Beta 01.00
All test cases and the code as such are beta release quality.
The documentation is NOT up to date - There are significant errors all
ower the place.