Compare commits

..

4 Commits

Author SHA1 Message Date
erki
e4cf913fc6 okay dis weird
All checks were successful
CI & Unit Tests / Unit-Tests (push) Successful in 1m10s
CI & Unit Tests / Docs (push) Successful in 1m32s
CI & Unit Tests / Unit-Tests (pull_request) Successful in 1m11s
CI & Unit Tests / Docs (pull_request) Successful in 1m31s
2023-12-30 18:34:19 +02:00
erki
59d087e295 So pip3 don't exist nomore
Some checks failed
CI & Unit Tests / Unit-Tests (push) Successful in 1m11s
CI & Unit Tests / Docs (push) Failing after 1m16s
2023-12-30 18:29:34 +02:00
erki
a4c4700800 Action to build docs
Some checks failed
CI & Unit Tests / Unit-Tests (push) Successful in 1m9s
CI & Unit Tests / Docs (push) Failing after 1m18s
2023-12-30 12:27:36 +02:00
erki
c8e3a50ead We now have docs 2023-12-30 12:16:15 +02:00
5 changed files with 13 additions and 98 deletions

View File

@ -4,10 +4,15 @@ on: [push, pull_request]
jobs: jobs:
Unit-Tests: Unit-Tests:
runs-on: fedora-cpp runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- name: Prepare environment
run: |
apt update
apt install -y --no-install-recommends build-essential cmake ninja-build
- name: Configure build - name: Configure build
working-directory: ${{runner.workspace}} working-directory: ${{runner.workspace}}
run: | run: |
@ -24,10 +29,16 @@ jobs:
working-directory: ${{runner.workspace}}/build working-directory: ${{runner.workspace}}/build
run: ctest . --output-on-failure run: ctest . --output-on-failure
Docs: Docs:
runs-on: fedora-cpp runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- name: Prepare environment
run: |
apt update
apt install -y --no-install-recommends build-essential cmake ninja-build doxygen python3-sphinx python3 python3-pip
pip3 install breathe
- name: Configure build - name: Configure build
working-directory: ${{runner.workspace}} working-directory: ${{runner.workspace}}
run: | run: |

View File

@ -14,8 +14,6 @@ list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/)
option(SKULLC_WITH_TESTS "Enable unit testing." OFF) option(SKULLC_WITH_TESTS "Enable unit testing." OFF)
option(SKULLC_WITH_HAL "Enable the compiling and deployment of the HAL dependent sections." OFF) option(SKULLC_WITH_HAL "Enable the compiling and deployment of the HAL dependent sections." OFF)
option(SKULLC_USE_HAL_ST "Enable the ST HAl when SKULLC_WITH_HAL is enabled." OFF)
option(SKULLC_USE_HAL_ESP "Enable the ESP HAL when SKULLC_WITH_HAL is enabled." OFF)
option(SKULLC_WITH_DOCS "Enable documentation building." OFF) option(SKULLC_WITH_DOCS "Enable documentation building." OFF)
include(skullc-install) include(skullc-install)

View File

@ -1,37 +0,0 @@
//
// Created by erki on 11/02/24.
//
#pragma once
#include <array>
#include <concepts>
#include <cstdint>
namespace Peripherals::Hal
{
template<typename T>
concept Gpio = requires (T t, const T ct) {
t.set(true);
t.toggle();
{ ct.read() } -> std::same_as<bool>;
};
template<typename T>
concept SerialInterface = requires (T t, std::uint8_t* data, const std::uint32_t len) {
{ t.transmit(data, len) } -> std::same_as<bool>;
{ t.transmit(std::array<std::uint8_t, 10>{}) } -> std::same_as<bool>;
{ t.receive(data, len) } -> std::same_as<bool>;
{ t.receive(std::array<std::uint8_t, 10>{}) } -> std::same_as<bool>;
};
template<typename T, typename RegName>
concept RegisterInterface = requires (T t, RegName reg, std::uint8_t* data, const std::uint32_t len) {
t.writerRegister(reg, std::uint8_t{});
t.writeRegisterMultibyte(reg, data, len);
{ t.readRegister(reg, std::uint32_t{}) } -> std::same_as<std::uint8_t>;
t.readRegisterMultibyte(reg, data, len, std::uint32_t{});
};
}

View File

@ -1,51 +0,0 @@
//
// Created by erki on 11/02/24.
//
#pragma once
#ifdef SKULLC_USE_HAL_ESP
#include <peripherals_hal_concepts.hpp>
#include <driver/gpio.h>
namespace Peripherals::Hal::Esp
{
struct Gpio
{
gpio_num_t gpio;
const bool inverted = false;
Gpio() = delete;
explicit Gpio(gpio_num_t gpio, const bool inverted)
: gpio(gpio), inverted(inverted)
{ }
void set(const bool& state)
{
gpio_set_level(gpio, inverted ? !state : state);
}
void toggle() { gpio_set_level(gpio, !gpio_get_level(gpio)); }
bool read() const
{
return inverted ? !bool(gpio_get_level(gpio)) : bool(gpio_get_level(gpio));
}
};
static_assert(Peripherals::Hal::Gpio<Gpio>);
#define CREATE_GPIO(name) \
Peripherals::Hal::Esp::Gpio{name, false}
#define CREATE_INV_GPIO(name) \
Peripherals::Hal::Esp::Gpio{name, true}
}
#else
# warning "ESP HAL included without SKULLC_USE_HAL_ESP being defined."
#endif /* SKULLC_USE_HAL_ESP */

View File

@ -8,8 +8,6 @@
#ifndef SKULLC_PERIPHERALS_HAL_ST_HPP_ #ifndef SKULLC_PERIPHERALS_HAL_ST_HPP_
#define SKULLC_PERIPHERALS_HAL_ST_HPP_ #define SKULLC_PERIPHERALS_HAL_ST_HPP_
#ifdef SKULLC_USE_HAL_ST
#include <main.h> #include <main.h>
#include <array> #include <array>
@ -345,8 +343,4 @@ struct ItmSerialInterface
}// namespace Hal }// namespace Hal
}// namespace Peripherals }// namespace Peripherals
#else
# warning "ESP HAL included without SKULLC_USE_HAL_ESP being defined."
#endif /* SKULLC_USE_HAL_ST */
#endif /* SKULLC_PERIPHERALS_HAL_ST_HPP_ */ #endif /* SKULLC_PERIPHERALS_HAL_ST_HPP_ */