diff --git a/CMakeLists.txt b/CMakeLists.txt index e966a41..2d7ba37 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -155,14 +155,12 @@ makeSubmodulesProject("${PROJECT_ADDITIONAL_DIRS}" "${PROJECT_TO_COMPILE_LIST}" message("${BoldBlue}+-------------------------------+${ColourReset}") # Stick All the libraries together, only for code redability futher down. -foreach(X IN LISTS STARTUP_UCODE - SYSTEM_LIBS - PERIPHERAL_LIBS - DRIVER_LIBS - LIBRARIES_LIBS - PROJECT_LIBS ) - list(APPEND GENERATED_LIBRARIES ${X}) -endforeach() +set(GENERATED_LIBRARIES ${STARTUP_UCODE} + ${SYSTEM_LIBS} + ${PERIPHERAL_LIBS} + ${DRIVER_LIBS} + ${LIBRARIES_LIBS} + ${PROJECT_LIBS}) #################################################################################################### # Overview @@ -185,19 +183,18 @@ message("+-------------------------------+") message("Compiling Info") message("+-------------------------------+") message("|--> Main Compile Definitions:") -printList("${BoldCyan} | " "${MAIN_DEFS}") +printList("${BoldCyan} | " "${MAIN_DEFS}") message("${BoldBlue}|--> Main Compile Flags:") -printList("${BoldCyan} | " "${MAIN_FLAGS}") +printList("${BoldCyan} | " "${MAIN_FLAGS}") message("${BoldBlue}|--> Linker Flags:") -printList("${BoldCyan} | " "${LINKER_FLAGS}") +printList("${BoldCyan} | " "${LINKER_FLAGS}") message("${BoldBlue}|--> Periferals which will be implemented:") -printList("${BoldCyan} |-> " "${PERIPHERALS_LIST}") +printList("${BoldCyan} |-> " "${PERIPHERALS_LIST}") message("${BoldBlue}|--> Drivers which will be implemented:") -printList("${BoldCyan} |-> " "${DRIVERS_LIST}") +printList("${BoldCyan} |-> " "${DRIVERS_LIST}") message("${BoldBlue}|--> Project sources to be implemented:") -printList("${BoldCyan} |-> " "${PROJECT_SOURCES_DIR_LIST}") -message("${BoldBlue}|--> Generated Library Submodules ${Red}!!!This list order also defines the compilation \ -order of submodules!!!${ColourReset}${BoldCyan}") +printList("${BoldCyan} |-> " "${PROJECT_TO_COMPILE_LIST}") +message("${BoldBlue}|--> Generated Library Submodules ${Red}!!!The Order Matters!!!${ColourReset}${BoldCyan}") printList("${BoldCyan} |-> " "${GENERATED_LIBRARIES}") message("${BoldBlue}+-------------------------------+${ColourReset}") diff --git a/env/cmake_core/cmakeCore.cmake b/env/cmake_core/cmakeCore.cmake index 48b14f5..5b0a82d 100755 --- a/env/cmake_core/cmakeCore.cmake +++ b/env/cmake_core/cmakeCore.cmake @@ -60,10 +60,11 @@ function(searchHeaderFile _alias _retDir) if(_headerFound) set(${_retDir} ${_headerDirFound}/${_alias}.h PARENT_SCOPE) else() - set(${_retDir} "Not Found" PARENT_SCOPE) + set(${_retDir} "No corresponding header << ${_alias}.h >> found " PARENT_SCOPE) endif() endfunction() + #################################################################################################### # SUBMODULE MANAGEMENT #################################################################################################### diff --git a/libraries/backup/BitFiled.hpp b/libraries/backup/BitFiled.hpp deleted file mode 100644 index c3f4a3a..0000000 --- a/libraries/backup/BitFiled.hpp +++ /dev/null @@ -1,76 +0,0 @@ -/** - * @file BitField.h - * @author Edwin Koch (eddyed.k@gmail.com) - * @brief - * @version 0.1 - * @date 2020-12-19 - * - * @copyright Copyright (c) 2020 - * - */ - -// Based on: -// https://www.youtube.com/watch?v=TYqbgvHfxjM -// https://stackoverflow.com/questions/31726191/is-there-a-portable-alternative-to-c-bitfields -// https://stackoverflow.com/questions/1392059/algorithm-to-generate-bit-mask -#ifndef _BITFIELDS_HPP_ -#define _BITFIELDS_HPP_ -#include -/** - * @brief Template class for portable Bitfields - * - * @tparam T type of variable in which the bitfield resides - * @tparam START bit index starting from LSB where the bitfield starts - * @tparam SIZE number of bits - */ -template -struct BitField -{ - /** - * @brief Construct a new Bit Field object - * - */ - BitField() - { - static_assert(SIZE != 0, "Bitfield SIZE must be > 0!"); - static_assert(START < sizeof(T) * 8, "START exceeds number of bits of the chosen typename T!"); - } - - /** - * @brief assignment operator - * - * @param v value to be written in the bitfield - * @return BitField& - */ - BitField& operator =(T v) - { - // use bit band alias if system permits - _raw = ((v & ((1ULL << SIZE)-1)) << START) | (_raw & ~(((1ULL << SIZE)-1) << START)); - return *this; - } - - /** - * @brief return the value inside the bitfield - * - * @return T - */ - operator T() const - { - return (_raw >> START) & ((1ULL << SIZE) - 1); - } - - /** - * @brief return the raw value - * - * @return T - */ - T operator ()() const - { - return (_raw >> START) & ((1ULL << SIZE) - 1); - } - - private: - T _raw; -}; - -#endif // _BITFIELDS_HPP_ diff --git a/libraries/backup/commandManager/commandManager.cpp b/libraries/backup/commandManager/commandManager.cpp deleted file mode 100644 index 17973a4..0000000 --- a/libraries/backup/commandManager/commandManager.cpp +++ /dev/null @@ -1,100 +0,0 @@ -/* - * Authors : Kerem Yollu & Edwin Koch - * Date : 07.03.2021 - * Version : 0.1 - * License : MIT-0 - * - * Description : An easy way to intereact with argv for passing commands. - * - * TODO : Inplement singleton pattern - * TODO : Write description - * TODO : Comment the code wiht odxygen - * TODO : write a standart string Output function and implment it (will come with the BSL) 08.08.21 - */ - -#include "commandManager.h" - - -CommandManager::CommandManager():emptyIndex(0) -{ -} - -void CommandManager::addNewCommand( const std::string& commmand, - const std::string& description, - commanCallback_t callBack) -{ - if(emptyIndex >= MAX_MUNBER_OF_COMMANDS) // Check if the command list is full - { - std::cout << "Error | Intern | Command list is full!" << std::endl; - exit(1); - } - if(getLookUpIndex(commmand) >= 0) // Chek for command duplicats - { - std::cout << "Error | Intern | Command already exitst!" << std::endl; - exit(1); - } - - - commandLookup[emptyIndex].commmand = commmand; - commandLookup[emptyIndex].description = description; - commandLookup[emptyIndex].callBack = callBack; - emptyIndex++; -} - -void CommandManager::operator()(const std::string cmdName) -{ - int index = 0; - - if(cmdName == "help" || cmdName == "Help") - { - printHelp(); - exit(1); - } - - if(cmdName == "-h" || cmdName == "-H") - { - printCommads(); - exit(1); - } - - index = getLookUpIndex(cmdName); - - if(index < 0) - { - std::cout << "Error | Intern | Invalid Command!" << std::endl; - exit(1); - } - - commandLookup[index].callBack(); - exit(1); -} - - -// -// Privat memeber functions -// - - -int CommandManager::getLookUpIndex(const std::string& cmd) -{ - int index = 0; - for (index = 0; index < emptyIndex; index++) - { - if(commandLookup[index].commmand == cmd) - { - return index; - } - } - return -1; -} - -void CommandManager::printHelp() -{ - std::cout << "Function : printHelp is under construction" << std::endl; -} - -void CommandManager::printCommads() -{ - std::cout << "Function : printCommads is under construction" << std::endl; -} - diff --git a/libraries/backup/commandManager/commandManager.h b/libraries/backup/commandManager/commandManager.h deleted file mode 100644 index 0ad164d..0000000 --- a/libraries/backup/commandManager/commandManager.h +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Authors : Kerem Yollu & Edwin Koch - * Date : 07.03.2021 - * - * Description : - * TODO : Inplement singleton pattern - * TODO : Write description - * TODO : Comment the code wiht odxygen - * - */ - - -#ifndef _COMMMANDMANAGER_H_ -#define _COMMMANDMANAGER_H_ - -#include -#include -#include -#include - -#define MAX_MUNBER_OF_COMMANDS 10 - -class CommandManager -{ - public: - typedef std::function commanCallback_t; - CommandManager(); - void addNewCommand( const std::string& commmand, - const std::string& description, - commanCallback_t callBack); - - void operator()(const std::string cmdName); - - - private: - unsigned int emptyIndex; - - struct commant_t{ - std::string commmand; - std::string description; - commanCallback_t callBack; // The Callback function could only be a void returning a void. - }; - - std::array commandLookup; - int getLookUpIndex(const std::string& cmd); // If command exists retunrs the index otherwise -1 - void printHelp(); // Prints all awailbale commands and their description. - void printCommads(); // Prints all awailable commnads without description. -}; - -#endif // _COMMMANDMANAGER_H_ diff --git a/libraries/backup/function_pointer/graphics.c b/libraries/backup/function_pointer/graphics.c deleted file mode 100644 index cc78ccb..0000000 --- a/libraries/backup/function_pointer/graphics.c +++ /dev/null @@ -1,14 +0,0 @@ -#include "graphics.h" - -display_s *lcd; - -void display_init(display_s *d) -{ - lcd = d; - printf("LCD : Init Ok\n"); -} - -void display_print(int val) -{ - lcd->print(val); -} diff --git a/libraries/backup/function_pointer/graphics.h b/libraries/backup/function_pointer/graphics.h deleted file mode 100644 index 54e2304..0000000 --- a/libraries/backup/function_pointer/graphics.h +++ /dev/null @@ -1,52 +0,0 @@ -#include -#include -#include -#include - -typedef struct display -{ - int size_x,size_y; - void (*enable)(); - void (*disable)(); - - void (*reset_hard)(); - void (*reset_soft)(); - - uint8_t (*is_ready)(); - - void (*sleep)(); - void (*wake)(); - - void (*draw_pixel)(uint16_t, uint16_t, uint8_t); - void (*draw_line)(uint16_t, uint16_t, uint16_t, uint16_t, uint8_t); - void (*draw_rectangle)(uint16_t, uint16_t, uint16_t, uint16_t, uint8_t, uint8_t); - void (*draw_circle)(uint16_t, uint16_t, uint16_t, uint8_t, uint8_t); - - void (*scroll_right)(uint16_t, uint16_t); - void (*scroll_left)(uint16_t, uint16_t); - - void (*scroll_up)(uint16_t, uint16_t); - void (*scroll_down)(uint16_t, uint16_t); - - void (*set_font)(uint8_t*, uint8_t, uint8_t spacing); - void (*print_char)(uint16_t, uint16_t, uint8_t, uint8_t); - void (*print_text)(uint16_t, uint16_t, uint8_t, uint16_t, uint8_t); - void (*print_cursor)(uint8_t); - - void (*goto_pos)(uint16_t, uint16_t); - - uint8_t (*display)(); - uint8_t (*clear)(); - - void (*change_brightness)(uint8_t); - void (*change_contrast)(uint8_t); - - void (*rotate)(uint8_t); - void (*inverse)(uint8_t); - void (*invert)(uint8_t); - void (*print)(int); -} display_s; - -void display_init(display_s *d); -void display_print(int val); - diff --git a/libraries/backup/function_pointer/main.c b/libraries/backup/function_pointer/main.c deleted file mode 100644 index 94f3fde..0000000 --- a/libraries/backup/function_pointer/main.c +++ /dev/null @@ -1,16 +0,0 @@ -#include -#include -#include -#include "ui.h" - - -display_s display; - -int main() -{ - oled_init(&display); - display_init(&display); - ui_print_number(50); - display_print(10); - return 0; -} diff --git a/libraries/backup/function_pointer/oled.c b/libraries/backup/function_pointer/oled.c deleted file mode 100644 index a8d04c4..0000000 --- a/libraries/backup/function_pointer/oled.c +++ /dev/null @@ -1,18 +0,0 @@ -#include -#include -#include -#include "oled.h" - -void oled_print(int a) -{ - printf("oled_print(int a) : %d\n", a); -} - -void oled_init(display_s *lcd) -{ - lcd->size_x = 10; - lcd->size_y = 20; - lcd->print = &oled_print; - - printf("LCD_OLED_REG : Init Ok\n"); -} diff --git a/libraries/backup/function_pointer/oled.h b/libraries/backup/function_pointer/oled.h deleted file mode 100644 index 167d4b1..0000000 --- a/libraries/backup/function_pointer/oled.h +++ /dev/null @@ -1,9 +0,0 @@ -#include -#include -#include -#include -#include "graphics.h" - -void oled_init(display_s *lcd); -void oled_print(int a); - diff --git a/libraries/backup/function_pointer/test b/libraries/backup/function_pointer/test deleted file mode 100755 index 9d4ab33..0000000 Binary files a/libraries/backup/function_pointer/test and /dev/null differ diff --git a/libraries/backup/function_pointer/ui.c b/libraries/backup/function_pointer/ui.c deleted file mode 100644 index ec6a934..0000000 --- a/libraries/backup/function_pointer/ui.c +++ /dev/null @@ -1,7 +0,0 @@ -#include "ui.h" - -void ui_print_number(int num) -{ - printf("UI : Init Ok\n"); - display_print(33); -} diff --git a/libraries/backup/function_pointer/ui.h b/libraries/backup/function_pointer/ui.h deleted file mode 100644 index 436d3e3..0000000 --- a/libraries/backup/function_pointer/ui.h +++ /dev/null @@ -1,9 +0,0 @@ -#include -#include -#include -#include -#include "oled.h" - -void ui_print_number(int num); -void ui_init(); - diff --git a/libraries/examples/autoInit/projectDefinitions.cmake b/libraries/examples/autoInit/projectDefinitions.cmake index 7112928..d5e3473 100644 --- a/libraries/examples/autoInit/projectDefinitions.cmake +++ b/libraries/examples/autoInit/projectDefinitions.cmake @@ -1,12 +1,34 @@ -#Declareing header directory for the project -#To add a new directory -# -> list(APPEND PROJECT_HEADERS_DIR ${PROJECT_DIR}/YOUR_DESIRED_DIRECTORY) -# list() = List declaration "DON'T CHANGE" -# PROJECT_HEADERS_DIR = Variable containing the listed direcotries "DON'T CHANCE -# ${PROJECT_DIR} = Direcotry of the main project this is per default the current direcotry it is defined in ked/CMakeLists.txt +################################################################################################### +# Declaring new directories to be added to the project +################################################################################################### +# list() = List declaration "DON'T CHANGE" +# PROJECT_ADDITIONAL_DIRS = Variable containing the listed direcotries "DON'T CHANCE" +# . = This indicates that the root file needs to de included "DON'T REMOVE" +# +# To include a new folder containing headers or sources that you want to compile +# - The root of the project is where the main.c is located +# - Let's suppose your main.c is under : /home/yourUserName/YOurProjectName/main.c +# - If we Make a new "Src" folder under /home/yourUserName/YOurProjectName/Src +# - To add it to the project, +# - Just include the Direwctory name "Src" the the Declarion WITHOUT THE LAST "/" +# - the declaration should look like this : list(APPEND PROJECT_ADDITIONAL_DIRS . Src) list(APPEND PROJECT_ADDITIONAL_DIRS .) -#Declaring sources to be compiled for the project. -#CMake will look in each previsouly declarec sources directory until to find this files. +################################################################################################### +# Declaring sources to be compiled for the project. +################################################################################################### +# KED will look in every PROJECT_ADDITIONAL_DIRS list an search for sources +# decalred by PROJECT_TO_COMPILE_LIST list +# +# To add a source file to the compilation +# - Let's continue where we left off for the Directory inclusion. +# - Now let's say you have source file named sensor.c located as follow : +# -> /home/yourUserName/YOurProjectName/Src/sensor.c +# - To let KED know that you want this source to be compiled, you simply ned to add it the list +# - This would look like this : set(PROJECT_TO_COMPILE_LIST sensors.c) set(PROJECT_TO_COMPILE_LIST) +# If you still have some question please have a look under : ked/libraries/examples/ +# There you can find some example projects with their corresponding "projectDefinitions.cmake". +# To try one of them just copy the entirety of one example folders contend to the root of your +# project where ked/ is located. diff --git a/libraries/examples/i2c/main.c b/libraries/examples/i2c/main.c deleted file mode 100644 index 28641c0..0000000 --- a/libraries/examples/i2c/main.c +++ /dev/null @@ -1,189 +0,0 @@ -#include "main.h" -#include "delay.h" -#include "deviceSetup.h" -#include "usart.h" -#include "ascii.h" -#include "timer.h" -#include "i2c.h" - -void timer_test(timerNo_t timer, pinNo_t pin) -{ - - timerInitCounter(timer, 4000, 999, downCounting); - timerSart(timer); - - for(int i = 0; i < 10 ; i++) - { - while(!timerGetUpdateInterrupt(timer)); - timerClearUpdateInterrupt(timer); - pinToggle(pin); - } - pinWrite(pin,0); -} - -void timer_capture_compare_test(timerNo_t timer) -{ - uint16_t i = 0; - timerInitCounter(timer, 100, 99, downCounting); - // We use pin PA3 (Arduino header A2) - //timerInitOutputCompare(timer, toggle, 4, pinA3, 2,0, 300); - timerInitOutputCompare(timer, pwm_normal, 2, pinB3, 2,0, 900); - timerSart(timer); - - while(1){ - delayMs(200); - timerSetCounterCompareValue(timer, 2, i); - i += 10; - if(i>99) i = 0; - } -} - - -void printBinary32(uint32_t toPrint, uint8_t lsbFirst) -{ - int i; - char pt; - if(lsbFirst) - { - print_Usart(usart2, "Bit Pos | 0| 1| 2| 3| 4| 5| 6| 7| 8| 9|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30|31|"); - print_Usart(usart2, "\n\r"); - print_Usart(usart2, "Bits |"); - for(i=0; i < 32; i++) - { - pt = (toPrint >> i) & 1; - usartSendChar(usart2, ' '); - usartSendChar(usart2, pt + 0x30); - usartSendChar(usart2, '|'); - } - } - else - { - print_Usart(usart2, "Bit Pos |31|30|29|28|27|26|25|24|23|22|21|20|19|18|17|16|15|14|13|12|11|10| 9| 8| 7| 6| 5| 4| 3| 2| 1| 0|"); - print_Usart(usart2, "\n\r"); - print_Usart(usart2, "Bits |"); - for(i=0; i < 32; i++) - { - pt = (toPrint >> (31-i)) & 1; - usartSendChar(usart2, ' '); - usartSendChar(usart2, pt + 0x30); - usartSendChar(usart2, '|'); - } - } -} - - -void printBinary8(uint8_t toPrint, uint8_t lsbFirst) -{ - int i; - char pt; - if(lsbFirst) - { - print_Usart(usart2, "Bit Pos | 0| 1| 2| 3| 4| 5| 6| 7|"); - print_Usart(usart2, "\n\r"); - print_Usart(usart2, "Bits |"); - for(i=0; i < 8; i++) - { - pt = (toPrint >> i) & 1; - usartSendChar(usart2, ' '); - usartSendChar(usart2, pt + 0x30); - usartSendChar(usart2, '|'); - } - } - else - { - print_Usart(usart2, "Bit Pos | 7| 6| 5| 4| 3| 2| 1| 0|"); - print_Usart(usart2, "\n\r"); - print_Usart(usart2, "Bits |"); - for(i=0; i < 8; i++) - { - pt = (toPrint >> (7-i)) & 1; - usartSendChar(usart2, ' '); - usartSendChar(usart2, pt + 0x30); - usartSendChar(usart2, '|'); - } - } -} - -int main(int argc, char *argv[]) -{ - - uint8_t i = 0; - uint16_t slaveAddress = 0xC0; - uint8_t registerToRead = 0x00; - uint8_t i2cRecieved = 0; - uint8_t i2cData = 0xFF; - uint8_t i2cDataLenght = 1; - i2c_t i2c_1; - - delayInitMs(8000000, 1000); // Clock Freq and Divider for ARM library - - pinConfig(pinB3, output, pushPull, def_res, def_speed); - pinConfig(pinA0, input, def_stage, pullDown, def_speed); - - setupInit(); // This is the sescond call of System init the assebly start code is calling it before the main. - - usartInit( usart2, - pinA2, - pinA15, - 115200, - eight, - NO_PARITY_CTRL, - noFlowControl); - - //clears screen and send the wellcome messgae - print_Usart(usart2, ASCII_clear); - print_Usart(usart2, "Hello to our KED project\n\r"); - - - //blinks 10 times to indicate the sicsessfull init if the device - for(i = 0 ; i < 2 ; i++) { - delayMs(100); - pinToggle(pinB3); - delayMs(100); - } - - pinWrite(pinB3,0); - - print_Usart(usart2, "\n\r"); - - i2c_init(&i2c_1, I2C_CH_1, i2c_mode_master, 0x00,0x00, i2c_address_count_single, i2c_address_size_7b, i2c_clk_speed_standart, i2c_clk_stretching_disable, i2c_wake_disabled); - - slaveAddress = 0x40; - registerToRead = 0x02; - registerToRead = 0x06; - i2cData = 0xAA; - - print_Usart(usart2, "Register Address To Write \n\r"); - printBinary8(registerToRead,0); - print_Usart(usart2, "\n\r"); - print_Usart(usart2, "\n\r"); - - print_Usart(usart2, "Data To Sent\n\r"); - printBinary8(i2cData,0); - print_Usart(usart2, "\n\r"); - print_Usart(usart2, "\n\r"); - - - i2c_check_device(&i2c_1, &slaveAddress); - - i2c_write(&i2c_1, &slaveAddress, ®isterToRead, &i2cData, &i2cDataLenght); - i2c_read(&i2c_1, &slaveAddress, ®isterToRead, &i2cRecieved,&i2cDataLenght); - - - print_Usart(usart2, "Data Recieved\n\r"); - printBinary8(i2cRecieved,0); - print_Usart(usart2, "\n\r"); - - print_Usart(usart2, "\n\r"); - print_Usart(usart2, "All is working fine\n\r"); - - while(1) - { - delayMs(100); - pinToggle(pinB3); - delayMs(100); - } - - return 1; -} - diff --git a/libraries/examples/i2c/main.h b/libraries/examples/i2c/main.h deleted file mode 100644 index 4a3e41b..0000000 --- a/libraries/examples/i2c/main.h +++ /dev/null @@ -1,15 +0,0 @@ -#ifndef MAIN_H -#define MAIN_H - -#ifdef __cplusplus -extern "C" { -#endif - -#include - - -#ifdef __cplusplus -} -#endif - -#endif /* MAIN_H */ diff --git a/libraries/examples/i2c_oled_display/projectDefinitions.cmake b/libraries/examples/i2c_oled_display/projectDefinitions.cmake index dc8a7d9..d5e3473 100644 --- a/libraries/examples/i2c_oled_display/projectDefinitions.cmake +++ b/libraries/examples/i2c_oled_display/projectDefinitions.cmake @@ -1,20 +1,34 @@ -#Declareing header directory for the project -#To add a new directory -# -> list(APPEND PROJECT_HEADERS_DIR ${PROJECT_DIR}/YOUR_DESIRED_DIRECTORY) -# list() = List declaration "DON'T CHANGE" -# PROJECT_HEADERS_DIR = Variable containing the listed direcotries "DON'T CHANCE -# ${PROJECT_DIR} = Direcotry of the main project this is per default the current direcotry it is defined in ked/CMakeLists.txt -list(APPEND PROJECT_HEADERS_DIR ${PROJECT_DIR}) +################################################################################################### +# Declaring new directories to be added to the project +################################################################################################### +# list() = List declaration "DON'T CHANGE" +# PROJECT_ADDITIONAL_DIRS = Variable containing the listed direcotries "DON'T CHANCE" +# . = This indicates that the root file needs to de included "DON'T REMOVE" +# +# To include a new folder containing headers or sources that you want to compile +# - The root of the project is where the main.c is located +# - Let's suppose your main.c is under : /home/yourUserName/YOurProjectName/main.c +# - If we Make a new "Src" folder under /home/yourUserName/YOurProjectName/Src +# - To add it to the project, +# - Just include the Direwctory name "Src" the the Declarion WITHOUT THE LAST "/" +# - the declaration should look like this : list(APPEND PROJECT_ADDITIONAL_DIRS . Src) +list(APPEND PROJECT_ADDITIONAL_DIRS .) -#Declaring sources directory for the project -#To add a new directory -# -> list(APPEND PROJECT_SOURCES_DIR ${PROJECT_DIR}/YOUR_DESIRED_DIRECTORY) -# list() = List declaration "DON'T CHANGE" -# PROJECT_SOURCES_DIR = Variable containing the listed direcotries "DON'T CHANCE -# ${PROJECT_DIR} = Direcotry of the main project this is per default the current direcotry it is defined in ked/CMakeLists.txt -list(APPEND PROJECT_SOURCES_DIR) - -#Declaring sources to be compiled for the project. -#CMake will look in each previsouly declarec sources directory until to find this files. -set(PROJECT_SOURCES_DIR_LIST) +################################################################################################### +# Declaring sources to be compiled for the project. +################################################################################################### +# KED will look in every PROJECT_ADDITIONAL_DIRS list an search for sources +# decalred by PROJECT_TO_COMPILE_LIST list +# +# To add a source file to the compilation +# - Let's continue where we left off for the Directory inclusion. +# - Now let's say you have source file named sensor.c located as follow : +# -> /home/yourUserName/YOurProjectName/Src/sensor.c +# - To let KED know that you want this source to be compiled, you simply ned to add it the list +# - This would look like this : set(PROJECT_TO_COMPILE_LIST sensors.c) +set(PROJECT_TO_COMPILE_LIST) +# If you still have some question please have a look under : ked/libraries/examples/ +# There you can find some example projects with their corresponding "projectDefinitions.cmake". +# To try one of them just copy the entirety of one example folders contend to the root of your +# project where ked/ is located. diff --git a/libraries/examples/initWithConfig/projectDefinitions.cmake b/libraries/examples/initWithConfig/projectDefinitions.cmake index 5dadf91..d5e3473 100644 --- a/libraries/examples/initWithConfig/projectDefinitions.cmake +++ b/libraries/examples/initWithConfig/projectDefinitions.cmake @@ -1,21 +1,34 @@ -#Declareing header directory for the project -#To add a new directory -# -> list(APPEND PROJECT_HEADERS_DIR ${PROJECT_DIR}/YOUR_DESIRED_DIRECTORY) -# list() = List declaration "DON'T CHANGE" -# PROJECT_HEADERS_DIR = Variable containing the listed direcotries "DON'T CHANCE -# ${PROJECT_DIR} = Direcotry of the main project this is per default the current direcotry it is defined in ked/CMakeLists.txt -list(APPEND PROJECT_HEADERS_DIR ${PROJECT_DIR}/headers) +################################################################################################### +# Declaring new directories to be added to the project +################################################################################################### +# list() = List declaration "DON'T CHANGE" +# PROJECT_ADDITIONAL_DIRS = Variable containing the listed direcotries "DON'T CHANCE" +# . = This indicates that the root file needs to de included "DON'T REMOVE" +# +# To include a new folder containing headers or sources that you want to compile +# - The root of the project is where the main.c is located +# - Let's suppose your main.c is under : /home/yourUserName/YOurProjectName/main.c +# - If we Make a new "Src" folder under /home/yourUserName/YOurProjectName/Src +# - To add it to the project, +# - Just include the Direwctory name "Src" the the Declarion WITHOUT THE LAST "/" +# - the declaration should look like this : list(APPEND PROJECT_ADDITIONAL_DIRS . Src) +list(APPEND PROJECT_ADDITIONAL_DIRS .) -#Declaring sources directory for the project -#To add a new directory -# -> list(APPEND PROJECT_SOURCES_DIR ${PROJECT_DIR}/YOUR_DESIRED_DIRECTORY) -# list() = List declaration "DON'T CHANGE" -# PROJECT_SOURCES_DIR = Variable containing the listed direcotries "DON'T CHANCE -# ${PROJECT_DIR} = Direcotry of the main project this is per default the current direcotry it is defined in ked/CMakeLists.txt -list(APPEND PROJECT_SOURCES_DIR ${PROJECT_DIR}/src) -list(APPEND PROJECT_SOURCES_DIR ${PROJECT_DIR}/sensors) - -#Declaring sources to be compiled for the project. -#CMake will look in each previsouly declarec sources directory until to find this files. -set(PROJECT_SOURCES_DIR_LIST uartComm sensor) +################################################################################################### +# Declaring sources to be compiled for the project. +################################################################################################### +# KED will look in every PROJECT_ADDITIONAL_DIRS list an search for sources +# decalred by PROJECT_TO_COMPILE_LIST list +# +# To add a source file to the compilation +# - Let's continue where we left off for the Directory inclusion. +# - Now let's say you have source file named sensor.c located as follow : +# -> /home/yourUserName/YOurProjectName/Src/sensor.c +# - To let KED know that you want this source to be compiled, you simply ned to add it the list +# - This would look like this : set(PROJECT_TO_COMPILE_LIST sensors.c) +set(PROJECT_TO_COMPILE_LIST) +# If you still have some question please have a look under : ked/libraries/examples/ +# There you can find some example projects with their corresponding "projectDefinitions.cmake". +# To try one of them just copy the entirety of one example folders contend to the root of your +# project where ked/ is located. diff --git a/libraries/examples/interrupt/projectDefinitions.cmake b/libraries/examples/interrupt/projectDefinitions.cmake new file mode 100644 index 0000000..d5e3473 --- /dev/null +++ b/libraries/examples/interrupt/projectDefinitions.cmake @@ -0,0 +1,34 @@ +################################################################################################### +# Declaring new directories to be added to the project +################################################################################################### +# list() = List declaration "DON'T CHANGE" +# PROJECT_ADDITIONAL_DIRS = Variable containing the listed direcotries "DON'T CHANCE" +# . = This indicates that the root file needs to de included "DON'T REMOVE" +# +# To include a new folder containing headers or sources that you want to compile +# - The root of the project is where the main.c is located +# - Let's suppose your main.c is under : /home/yourUserName/YOurProjectName/main.c +# - If we Make a new "Src" folder under /home/yourUserName/YOurProjectName/Src +# - To add it to the project, +# - Just include the Direwctory name "Src" the the Declarion WITHOUT THE LAST "/" +# - the declaration should look like this : list(APPEND PROJECT_ADDITIONAL_DIRS . Src) +list(APPEND PROJECT_ADDITIONAL_DIRS .) + +################################################################################################### +# Declaring sources to be compiled for the project. +################################################################################################### +# KED will look in every PROJECT_ADDITIONAL_DIRS list an search for sources +# decalred by PROJECT_TO_COMPILE_LIST list +# +# To add a source file to the compilation +# - Let's continue where we left off for the Directory inclusion. +# - Now let's say you have source file named sensor.c located as follow : +# -> /home/yourUserName/YOurProjectName/Src/sensor.c +# - To let KED know that you want this source to be compiled, you simply ned to add it the list +# - This would look like this : set(PROJECT_TO_COMPILE_LIST sensors.c) +set(PROJECT_TO_COMPILE_LIST) + +# If you still have some question please have a look under : ked/libraries/examples/ +# There you can find some example projects with their corresponding "projectDefinitions.cmake". +# To try one of them just copy the entirety of one example folders contend to the root of your +# project where ked/ is located. diff --git a/libraries/examples/spi/projectDefinitions.cmake b/libraries/examples/spi/projectDefinitions.cmake new file mode 100644 index 0000000..d5e3473 --- /dev/null +++ b/libraries/examples/spi/projectDefinitions.cmake @@ -0,0 +1,34 @@ +################################################################################################### +# Declaring new directories to be added to the project +################################################################################################### +# list() = List declaration "DON'T CHANGE" +# PROJECT_ADDITIONAL_DIRS = Variable containing the listed direcotries "DON'T CHANCE" +# . = This indicates that the root file needs to de included "DON'T REMOVE" +# +# To include a new folder containing headers or sources that you want to compile +# - The root of the project is where the main.c is located +# - Let's suppose your main.c is under : /home/yourUserName/YOurProjectName/main.c +# - If we Make a new "Src" folder under /home/yourUserName/YOurProjectName/Src +# - To add it to the project, +# - Just include the Direwctory name "Src" the the Declarion WITHOUT THE LAST "/" +# - the declaration should look like this : list(APPEND PROJECT_ADDITIONAL_DIRS . Src) +list(APPEND PROJECT_ADDITIONAL_DIRS .) + +################################################################################################### +# Declaring sources to be compiled for the project. +################################################################################################### +# KED will look in every PROJECT_ADDITIONAL_DIRS list an search for sources +# decalred by PROJECT_TO_COMPILE_LIST list +# +# To add a source file to the compilation +# - Let's continue where we left off for the Directory inclusion. +# - Now let's say you have source file named sensor.c located as follow : +# -> /home/yourUserName/YOurProjectName/Src/sensor.c +# - To let KED know that you want this source to be compiled, you simply ned to add it the list +# - This would look like this : set(PROJECT_TO_COMPILE_LIST sensors.c) +set(PROJECT_TO_COMPILE_LIST) + +# If you still have some question please have a look under : ked/libraries/examples/ +# There you can find some example projects with their corresponding "projectDefinitions.cmake". +# To try one of them just copy the entirety of one example folders contend to the root of your +# project where ked/ is located.