Source Code Library

I maintain all the source code that we will be discussing and developing in this blog in the SVN repository kindly provided by Google at Code Repository. All of the code provided by me is covered by the “MIT License”:

The MIT License (MIT)
Copyright (c) 2014 by Alex Zarenin
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

In this blog we will be primarily dealing with the SW under the Quad-V3 tree. I usually implement the following structure for all of my projects – the first folder in the tree, 00-COMMON in this case, contains sub-folders for individual “modules” – closely related pieces of code dedicated to a particular function. For example, The MPL folder contains code encapsulating operations with the MPL3115A barometric altimeter.  To bring in MPL functionality into the project code, the main MPL header, MPL.h, need to be included. Definitions used within the components of the module are usually aggregated into the header _Local.h. For the MPL module, this would be MPL_Local.h.



Most of the modules dealing directly with the elements of MCU hardware usually include the header file _Profile.h. This header file provides definitions customizing the module to specific HW where it is going to be used.

Code for some modules may rely on the functionality exposed by other modules. For example, the TMR module, which provides various time-related functionality (like timestamps, delay functions, etc.), is used by most of the other modules in the system. Thus the include directive for TMR.h would appear in most of the _Local.h headers, which would also require inclusion of the TMR module code in respective projects.

Following the 00-COMMON folder are the folders for individual projects. These projects are in the MPLab-X format configured for my platform – Windows. If you are a MAC or UNIX user (MPLab-X available for all platforms) you may need to replace “\” with the “/” in the #include directives and project settings for include libraries.


Most of these projects test individual modules or their integrations. Projects are numbered in the order they were developed. Each project mostly contains one code file, main.c, which just provide a “glue” for interfacing various modules.

At the bottom of the tree there is an Eagle folder, which contains Eagle project used to build respective boards. For those without the Eagle PCB SW, the PDF subfolder contains board, schematic, and description printouts.



Enjoy!

No comments:

Post a Comment