Skip to content

Commit 57ffcfc

Browse files
committed
Added README.md file
1 parent a73f480 commit 57ffcfc

File tree

1 file changed

+53
-0
lines changed

1 file changed

+53
-0
lines changed

README.md

+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# Structure
2+
3+
- I used layer architecture for developing the drivers and the HALs of the atmega32 microcontroller.
4+
5+
## Module Structure
6+
7+
- Every folder in the `MCAL` or `HAL` folders is considered as a module.
8+
- Every module contains 5 files:
9+
1. `MODULE_interface.h `: Contains the interface of the module like functions prototypes
10+
and structure types.
11+
2. `MODULE_program.c `: Contains the implementations and details of the module.
12+
3. `MODULE_register.h `: A register definition file that contains registers names and their map
13+
either in the microcontroller or in an external device.
14+
4. `MODULE_config.h `: Contains the pre-build configurations of the module.
15+
5. `MODULE_private.h `: Contains definitions private to the module.
16+
6. `MODULE_test.c `: Contains tests for the module only. *(Note: It has a main function.)*
17+
18+
# How to use
19+
20+
This Project has multiple main functions. We can compile source files, but can link only with one
21+
source file that has a main function.
22+
23+
## Options for compiling, linking, building, and flashing.
24+
25+
1. `make compile-all` :
26+
27+
Compiles all source file that has no `main` function.
28+
*(It only compiles the `_program.c` source files)*
29+
30+
31+
2. `make build-all` :
32+
1. Compiles all source files that has no `main` function.
33+
2. For every source file that has the `main` function, Compile it and Link it with other object files.
34+
Then Generate its corresponding executable. *(Usually `.elf` and `.hex` format)*
35+
36+
37+
3. `make flash EXEC=*flash_name*`:
38+
39+
Flashes the `.hex` file to the microcontroller.
40+
The `EXEC` variable must be specified because we have multiple executables.
41+
> (**Note**:*`flash_name` must be without any suffixes*)
42+
43+
44+
4. `make clean`: Cleans all the generated files.
45+
5. `make docs` : Generate documentation files.
46+
47+
48+
## Examples
49+
To build all the executables and flash the `MPU6050_test.hex`, just do as the following:
50+
51+
```
52+
$ make build-all && make all EXEC=MPU6050_test
53+
```

0 commit comments

Comments
 (0)