From 1dc81895272c82074e9e89a4ded01e88ae2bd12e Mon Sep 17 00:00:00 2001 From: polymurph Date: Tue, 14 Jun 2022 19:04:06 +0200 Subject: [PATCH 1/4] added cmake path to drivers --- ked/CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ked/CMakeLists.txt b/ked/CMakeLists.txt index 3d198e8..7dff1e5 100644 --- a/ked/CMakeLists.txt +++ b/ked/CMakeLists.txt @@ -9,7 +9,7 @@ if(EXISTS ${CSL_DIR}) # Cheking if the directory exists set(COMPILER_DEFS ${CSL_DIR}/compiler.cmake) set(PROJECT_DEFS ${CSL_DIR}/config.cmake) else() - message( FATAL_ERROR "${BoldRed}Please Select a valid BSL, CMake will exit.${ColourReset}" ) + message( FATAL_ERROR "${BoldRed}Please Select a valid CSL, CMake will exit.${ColourReset}" ) endif() include(${COMPILER_DEFS}) @@ -24,6 +24,7 @@ set(EXECUTABLE ${PROJECT_NAME}) #Create the executable #################################################################################################### set(INTERFACES_DIR ${CMAKE_SOURCE_DIR}/csl/interfaces) set(UTILS_DIR ${CMAKE_SOURCE_DIR}/utils/assert) +set(DRIVERS_DIR ${CMAKE_DRIVERS_DIR}/drivers) #################################################################################################### #SUBDIRECTORIES Will add the given folders to the porject an check for CmakeLists.txt From f28829599f4f52537823f4cb537f1f770ddc88fa Mon Sep 17 00:00:00 2001 From: polymurph Date: Tue, 14 Jun 2022 19:09:12 +0200 Subject: [PATCH 2/4] added drivers as subdirectory --- ked/CMakeLists.txt | 1 + ked/drivers/CMakeLists.txt | 1 + 2 files changed, 2 insertions(+) create mode 100644 ked/drivers/CMakeLists.txt diff --git a/ked/CMakeLists.txt b/ked/CMakeLists.txt index 7dff1e5..3a4e3c3 100644 --- a/ked/CMakeLists.txt +++ b/ked/CMakeLists.txt @@ -32,6 +32,7 @@ set(DRIVERS_DIR ${CMAKE_DRIVERS_DIR}/drivers) include(${PROJECT_DEFS}) add_subdirectory(utils) add_subdirectory(csl) +add_subdirectory(drivers) message("${BoldBlue}Project Info ${ColourReset}") message("${Blue} |--> Exec Name \t: ${EXECUTABLE} ${ColourReset}") diff --git a/ked/drivers/CMakeLists.txt b/ked/drivers/CMakeLists.txt new file mode 100644 index 0000000..5d23225 --- /dev/null +++ b/ked/drivers/CMakeLists.txt @@ -0,0 +1 @@ +# add_subdirectory(${CSL_USED}) From 8fff069a579d0a3c5aaf6040e19f26178a175007 Mon Sep 17 00:00:00 2001 From: polymurph Date: Tue, 14 Jun 2022 19:51:09 +0200 Subject: [PATCH 3/4] added empty spi.c --- ked/csl/stm32f042/Src/spi.c | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 ked/csl/stm32f042/Src/spi.c diff --git a/ked/csl/stm32f042/Src/spi.c b/ked/csl/stm32f042/Src/spi.c new file mode 100644 index 0000000..e69de29 From 6c370a1cbe7c5bfc62e636b04d5d4a93b9842814 Mon Sep 17 00:00:00 2001 From: polymurph Date: Tue, 14 Jun 2022 20:28:23 +0200 Subject: [PATCH 4/4] added new tmux workbench script + included spi in main.c/.cpp + work on spi.c and hwDescription --- .../stm32f042/Device/hardwareDescription.h | 9 +++++++++ ked/csl/stm32f042/Src/spi.c | 13 ++++++++++++ main.c | 1 + main.cpp | 1 + tmux_workbench.sh | 20 +++++++++++++++++++ 5 files changed, 44 insertions(+) create mode 100755 tmux_workbench.sh diff --git a/ked/csl/stm32f042/Device/hardwareDescription.h b/ked/csl/stm32f042/Device/hardwareDescription.h index 530a311..70dafba 100644 --- a/ked/csl/stm32f042/Device/hardwareDescription.h +++ b/ked/csl/stm32f042/Device/hardwareDescription.h @@ -230,6 +230,15 @@ static const uint32_t timerRes_Prescaler[MAX_TIMER_CHANNEL_COUNT] = { 0xFFFF, /*!< Timer 17 Prescaler Max Value */ }; + +typedef enum{ + SPI_CH_1, + SPI_CH_2 +} spiCH_t; + + + + #ifdef __cplusplus } #endif diff --git a/ked/csl/stm32f042/Src/spi.c b/ked/csl/stm32f042/Src/spi.c index e69de29..05af6c0 100644 --- a/ked/csl/stm32f042/Src/spi.c +++ b/ked/csl/stm32f042/Src/spi.c @@ -0,0 +1,13 @@ +#include "spi.h" + + +void spi_initMater(spiCH_t_spi_hw_ch) +{ + +} + + +uint8_t spi_trx(spiCH_t_spi_hw_ch, uint8_t tx_data) +{ + return 0; +} diff --git a/main.c b/main.c index 4afbfe9..4420bad 100644 --- a/main.c +++ b/main.c @@ -4,6 +4,7 @@ #include "usart.h" #include "ascii.h" #include "timer.h" +#include "spi.h" void timer_test(timerNo_t timer, pinNo_t pin) { diff --git a/main.cpp b/main.cpp index 1a9f936..e2eb625 100644 --- a/main.cpp +++ b/main.cpp @@ -4,6 +4,7 @@ #include "usart.h" #include "ascii.h" #include "timer.h" +#include "spi.h" void timer_test(timerNo_t timer, pinNo_t pin) { diff --git a/tmux_workbench.sh b/tmux_workbench.sh new file mode 100755 index 0000000..c9e0773 --- /dev/null +++ b/tmux_workbench.sh @@ -0,0 +1,20 @@ +#!/bin/bash + +dir=$(pwd) +echo $dir + +tmux new -s 'git' -d 'fish' +tmux new -s 'compile' -d 'fish' + +tmux new -s 'main' -d 'vim main.cpp' + +cd $dir/ked/csl/stm32f042/Src/ +tmux new -s 'src' -d 'fish' + +cd $dir/ked/csl/stm32f042/Device/ +tmux new -s 'device' -d 'fish' + +cd $dir/ked/csl/interfaces/ +tmux new -s 'interface' -d 'fish' + +tmux a