diff --git a/ked/CMakeLists.txt b/ked/CMakeLists.txt index 3d198e8..3a4e3c3 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 @@ -31,6 +32,7 @@ set(UTILS_DIR ${CMAKE_SOURCE_DIR}/utils/assert) 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/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 new file mode 100644 index 0000000..05af6c0 --- /dev/null +++ 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/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}) 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