Realise a good software structure

Hello everybudy

I am working on a projekt with the ESP32 DevKit v1. To develope the programmcode for this one i am using the Arduino IDE.

I would really like to have a nice software structure. A Hardware abstraction layer (HAL) which includes a chip support library (CSL) and a board support library (BSL).

My Problem now is, that i have to save all my libraries in the sketch library folder. And in this folder i have to have another folder, which has the exact same name as the headerfile of the library (libraries -> xylib -> xylib.h).
This is an unsatisfing solution. I mean at least i would like to have a folder called CSL and one called BSL in which i would have my libraries but this does not work.
I tried to do it like this <CSL/xylib.h> and like this "CSL/xylib.h" and on many other variants.

Maybe someone has an idea how to solve this problem or Maybe there is no solution.

And maybe there is also a solution with static libraries which would be my favourite one if this is even possible.

Does someone have an answer for this?

Thank you very much and sorry for my bad english :wink:
(would also read answers in german :slight_smile: )

the Arduino libraries and many of those provided on the side already offer quite an abstraction layer for the hardware (OOP)

what do you have in mind for your CSL and BSL ?

Thank you for your Reply.

I have to install a webserver on the Esp32 devkit v1 and have to communicate over a serial interface with a Motormodule. Over a wifi link i want to reach a wifi client which should be any kind of webbrowser.

so in the CSL i would like to have all the libraries which are responsible for the peripherals and the chip intern communication.
The BSL should include everthing else like driving a display, the code for the Motor module and so on.

At the moment i have the Folder called hardware->espressif->esp32(would be also nice to rename These but does not work) which is more or less the CSL and the libraries Folder of the sketch which is the BSL.

It would be nice to have a Folder called CSL and one called BSL which are both included in the libraries Folder ore in the Project folder.

I mean i know this is Maybe a Little bit a luxury Problem that i have but would be really nice if there would be a solution for this Problem.

The main reason for this is. I am gonna have different motor modules, which lead to different BSL's but i only have one folder calles libraries.

Maybe i also made some kind of other faults but it is the first time i use this IDE and the first time i use Arduino and that is why i not so familiar which how Arduino handles those files.

Maybe there is also a include version like:

#include "../../folderX/folderY/lib.h"

I hope you can understand what i am asking for :).

Thank you very much.

@dmaurer

Moved your topic to it's current location as it is more suitable.

Could you take a few moments to Learn How To Use The Forum.
Other general help and troubleshooting advice can be found here.
It will help you get the best out of the forum in the future.