Include and utilise within project - mipidisaster/miLibrary GitHub Wiki
It is recommended that when this repository is cloned into a project that it is included within a sub-folder of the intended folder structure.
<project root>
├─ < other folders >
└─ miLibrary root *
├─ include
│ ├─ milibrary
│ │ └─ < contents >
│ └─ FileIndex.h
├─ src
│ └─ < contents >
└─ README.md
This way only the root directory of 'miLibrary' need be stated in the include path, along with source path.
The structure of this repository, as can be seen in the layout above as the include
and src
folders at the top most level. It should be noted that within the include
folder is another for milibrary
, this is intentional and is mainly to facilitate the use of this within the ROS environment/CMakeList.
The contents of the src
and include/milibrary
is the same, and follows:
< contents >
├─ com
├─ dev
├─ drv
└─ LnxCond
Folder name | Description |
---|---|
com | files which are common to all devices, i.e. data manipulation, buffers, etc. |
dev | Management of external 'Devices' from the IC being programmed |
drv | Drivers for the interfaces internal to the IC being programmed |
LnxCond | This is to be deleted |
So as to allow for ease of moving folders around within the repository, all header files are captured within the FileIndex.h
and given a #define
name:
#define FilInd_GPIO___HD "milibrary/drv/GPIO/GPIO.h"
Therefore, when utilising these functions you will need to state at the start of the file:
#include "EmbedIndex.h"
#include FilInd_GPIO___HD
As the number of 'Devices' is likely to increase, there is an intent to figure out if the FileIndex.h
can be indexed even further. Such that the top level Index, references a sub-level Index (i.e. within the milibrary/drv
), and it is this lower level index which finally states the actual header.
However, there is a concernt that the amount of text needed to cover this would be quite a bit (and wanted to limit the number of characters per row to 100).