DHCOM HAL class library is used to abstract application code from the underlying OS - and hardware - specific device drivers.
The library can be compiled to support several systems with similar executable binary formats (OS/CPU architectures).
In its current state the library supports:
- UART, SPI, I2C, Physical Memory and GPIO for DHCOM Linux targets
- UART for PC Linux targets
- UART for PC Windows targets
Compiling
It is intended to compile the DHCOM HAL with Qt4 build system (qmake), though it does not use any of the Qt libraries.
The project file for building is supplied with the library (DHCOM_HAL.pro).
To compile for DHCOM Modules use the Qt for DHCOM targets installation, supplied in the Debian building environment by DH Electronics.
Use options CONFIG+=DHCOM_AM35 or CONFIG+=DHCOM_iMX25 to compile support for DHCOM_AM35 or DHCOM_iMX25 modules, or both of them.
Configuring for Windows pc
If you want to configure for Windows PC, execute the following command from the Visual Studio command prompt:
qmake -spec win32-msvc2008 -tp vc CONFIG=debug_and_release
The MS Visual studio project will be created.
Configuring for DHCOM Module running Windows CE6 or CE7
Under construction...
Configuring for Linux PC
You can configure the build for linux host the following way:
qmake -spec linux-g++-32 CONFIG=debug_and_release
The makefile project will be created.
Configuring for DHCOM module running Linux.
You can configure the build for DHCOM modules running linux the following way:
qmake -spec linux-arm-gnueabi-g++ CONFIG=debug_and_release
The mkspec linux-arm-gnueabi-g++ must be in place to do this.
The makefile project will be created.
Manual configuration
It is always possible to configure the library for compilation without qmake.
To do this on Windows:
- In MSVC2008 create a smart device project, selecting the correct SDK
- add all header files from include and include/hal into the project
- add appropriate source files from the src
- observe correctness of definitions of supported targets in System.h
- define DHCOM_HAL macro as /D "DHCOM_HAL=__declspec(dllexport)"
To manually compile on linux:
- select the appropriate source files from src/Linux
- include the include directory
- observe correctness of definitions of supported targets in System.h (USE_HARDWARE_...)
- create a Makefile or Eclipse project
License
This library source code is distributed under terms of BSD License:
Copyright (c) 2013, DH Electronics GmbH. All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
- Neither the name of DH Electronics GmbH nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT holder>=""> BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.