Renaming folders

redesign_interrupts
Kerem Yollu 3 years ago
parent 343d78ac7c
commit f8261a20cb

@ -25,6 +25,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)
set(PERIFERALS_DIR ${CMAKE_DRIVERS_DIR}/periferals)
####################################################################################################
#SUBDIRECTORIES Will add the given folders to the porject an check for CmakeLists.txt
@ -33,6 +34,7 @@ include(${PROJECT_DEFS})
add_subdirectory(utils)
add_subdirectory(csl)
add_subdirectory(drivers)
add_subdirectory(periferals)
message("${BoldBlue}Project Info ${ColourReset}")
message("${Blue} |--> Exec Name \t: ${EXECUTABLE} ${ColourReset}")

@ -1,7 +0,0 @@
add_library(ledDriver led.cpp)
target_compile_options(ledDriver PRIVATE ${C_FLAGS})
target_compile_definitions(ledDriver PRIVATE ${C_DEFS})
target_include_directories(ledDriver PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
add_library(sub::led ALIAS ledDriver)

@ -1,30 +0,0 @@
#include "led.hpp"
Led::Led(Pin* pin_ptr)
{
pin = pin_ptr;
pin->init();
pin->setMode(Pin::mode::output);
pin->setSpeed(Pin::speed::fast);
}
Led::~Led()
{
}
void Led::on()
{
pin->write(true);
}
void Led::off()
{
pin->write(false);
}
void Led::toggle()
{
pin->toggle();
}

@ -1,20 +0,0 @@
#ifndef _LED_HPP
#define _LED_HPP
class Led
{
public:
Led(Pin *pin_ptr);
~Led();
void on();
void off();
void toggle();
private:
Pin *pin;
};
#endif /* __LED_HPP */

@ -1,82 +0,0 @@
#include "spi_ch.h"
// generic implementation of spi channel class
uint8_t spiCH_readReg(spi_ch_t *spi_ch,
uint8_t reg_address) {
uitn8_t buf;
// select target device
pinWrite(spi_ch->pin,0);
// send address of target register
spi_trx(spi_ch->spi, reg_address);
// read from target register
buf = spi_trx(spi->spi,0x00);
// release target device
pinWrite(spi_ch->pin,1);
return buf;
}
void spiCH_autoReadBlock(spi_ch_t *spi_ch,
uint8_t start_address,
uint8_t* buffer,
uint8_t buf_len) {
uint8_t i = 0;
// select target device
pinWrite(spi_ch->pin,0);
// send address of starting register
spi_trx(spi_ch->spi, reg_address);
// read block from device
for(;i < buf_len;i++) {
buffer[i] = spi_trx(spi_ch->spi, 0x00);
}
// release target device
pinWrite(spi_ch->pin,1);
}
void spiCH_writeReg(spi_ch_t *spi_ch,
uint8_t reg_address,
uint8_t data) {
// select target device
pinWrite(spi_ch->pin,0);
// send address of target register
spi_trx(spi_ch->spi, reg_address);
// write to target register
spi_trx(spi->spi, data);
// release target device
pinWrite(spi_ch->pin,1);
}
void spiCH_writeBlock(spi_ch_t *spi_ch,
uint8_t start_address,
const uint8_t *data,
uint8_t data_len) {
uint8_t i = 0;
// select target device
pinWrite(spi_ch->pin,0);
// send address of starting register
spi_trx(spi_ch->spi, reg_address);
// read block from device
for(;i < buf_len;i++) {
spi_trx(spi_ch->spi, data[i]);
}
// release target device
pinWrite(spi_ch->pin,1);
}

@ -0,0 +1 @@
# add_subdirectory(${CSL_USED})
Loading…
Cancel
Save