parent
92f753bf50
commit
ecca9af3a3
@ -0,0 +1,96 @@
|
|||||||
|
# Drivers
|
||||||
|
## Description
|
||||||
|
Drivers are the higher level of code prowided by *KED*. It come on top of the [Peripheras](https://git.keydev.me/kerem/KED/src/branch/master/peripherals) and alows the usage of comercially awailable IC's or moludes.
|
||||||
|
|
||||||
|
---
|
||||||
|
## Please follow this guide to find out about the :
|
||||||
|
- [Structure](#Structure)
|
||||||
|
- [Usage](#Usage)
|
||||||
|
- [Creation](#creation)
|
||||||
|
- [Modification](#modification)
|
||||||
|
- [Credits](#credits)
|
||||||
|
- [License](#license)
|
||||||
|
---
|
||||||
|
|
||||||
|
## Structure
|
||||||
|
##### The __driver__ folder has multiple elements inside :
|
||||||
|
+ CMakeLists.txt
|
||||||
|
+ where the DRIVERS_LIST is defined
|
||||||
|
+ Folders named after the driver that they respresent. Inside you will find:
|
||||||
|
+ Source file of the driver
|
||||||
|
+ Header file of the driver
|
||||||
|
+ This Readme file
|
||||||
|
---
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
In the *CMakeLists.txt* you will find the decalarion of __DRIVERS_LIST__ list which contains the dirvers that are to be compiled.
|
||||||
|
The *name* of the declared *driver* also defines the name of the driver's *folder*, *souce* file and *header* file.
|
||||||
|
Once the driver is implemented correctly you can call the header of the driver from any soure of header file.
|
||||||
|
> exmaple for *ssd1306_i2c*
|
||||||
|
~~~ C
|
||||||
|
#include "ssd1306_i2c.h"
|
||||||
|
~~~
|
||||||
|
|
||||||
|
CMake will the automatically find the driver, compile it and implement it to the main projet as a submodule.
|
||||||
|
|
||||||
|
---
|
||||||
|
## Creation
|
||||||
|
### Let's implement a driver named *ssd1306_i2c*
|
||||||
|
#### First let's add *ssd1306_i2c* to the __DRIVERS_LIST__.
|
||||||
|
Open *CMakeLists.txt* with your favorite *text editor* and modifiy the line wehre __DRIVERS_LIST__ is defined.
|
||||||
|
In which order the drivers are added to the list has no importance.
|
||||||
|
|
||||||
|
> Before adding *ssd1306_i2c*
|
||||||
|
|
||||||
|
~~~ CMAKE
|
||||||
|
set(DRIVERS_LIST lcd_oled max7219 max31865)
|
||||||
|
~~~
|
||||||
|
|
||||||
|
> After adding *ssd1306_i2c* the declaration of __DRIVERS_LIST__ should look like this
|
||||||
|
|
||||||
|
~~~ CMAKE
|
||||||
|
set(DRIVERS_LIST lcd_oled max7219 max31865 ssd1306_i2c)
|
||||||
|
~~~
|
||||||
|
|
||||||
|
#### Than we can create a folder with the same name
|
||||||
|
~~~ bash
|
||||||
|
mkdir ssd1306_i2c
|
||||||
|
~~~
|
||||||
|
|
||||||
|
#### Inside the newly created folder add the *source* and *header* file with the same name as the driver
|
||||||
|
In our case that means __ssd1306_i2c.c__ and __ssd1306_i2c.h__
|
||||||
|
|
||||||
|
~~~ bash
|
||||||
|
touch ssd1306_i2c.c ssd1306_i2c.h
|
||||||
|
~~~
|
||||||
|
|
||||||
|
#### The final structure should look like this
|
||||||
|
As you can see this folder also contains the datashhed for this driver. If you have any additional documentation like a datasheet or calculation sheet, feel free to add them here.
|
||||||
|
|
||||||
|
~~~ bash
|
||||||
|
└── ssd1306_i2c
|
||||||
|
├── ssd1306_i2c.c
|
||||||
|
├── ssd1306_i2c.h
|
||||||
|
└── SSD1306.pdf
|
||||||
|
~~~
|
||||||
|
---
|
||||||
|
## Modification
|
||||||
|
You can modify each driver to your convinience but it can't be pushed again so please be careful during GIT transactions.
|
||||||
|
You can also remove any driver from the complation by simply removing his declaration from the __DRIVERS_LIST__
|
||||||
|
> Like so :
|
||||||
|
set(DRIVERS_LIST lcd_oled max7219 max31865 ~~ssd1306_i2c~~)
|
||||||
|
## How to Contribute
|
||||||
|
Do you want to become a contibutor ? :
|
||||||
|
How is Ked organised :
|
||||||
|
Rules to write a Driver :
|
||||||
|
|
||||||
|
## Credits
|
||||||
|
|
||||||
|
Edwin Koch
|
||||||
|
Kerem Yollu
|
||||||
|
|
||||||
|
## License
|
||||||
|
|
||||||
|
The last section of a high-quality README file is the license. This lets other developers know what they can and cannot do with your project. If you need help choosing a license, refer to [https://choosealicense.com/](https://choosealicense.com/).
|
||||||
|
|
||||||
|
---
|
Loading…
Reference in new issue