Git Product home page Git Product logo

abdoaboganima / avr Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 2.0 1.3 MB

A layered architecture implementations for the atmega32 micocontroller peripheral drivers and also some sensors drivers

License: GNU General Public License v3.0

C 96.70% Makefile 2.91% Python 0.39%
embedded-systems c avr-gcc-toolchain makefile doxygen software-engineering bare-metal rtos hal hardware-abstraction-layer

avr's Introduction

Structure

  • I used layer architecture for developing the drivers and the HALs of the atmega32 microcontroller.

Module Structure

  • Every folder in the MCAL or HAL folders is considered as a module.
  • Every module contains 5 files:
    1. MODULE_interface.h : Contains the interface of the module like functions prototypes and structure types.
    2. MODULE_program.c : Contains the implementations and details of the module.
    3. MODULE_register.h : A register definition file that contains registers names and their map either in the microcontroller or in an external device.
    4. MODULE_config.h : Contains the pre-build configurations of the module.
    5. MODULE_private.h : Contains definitions private to the module.
    6. MODULE_test.c : Contains tests for the module only. (Note: It has a main function.)

How to use

This Project has multiple main functions. We can compile source files, but can link only with one 
source file that has a main function.

Options for compiling, linking, building, and flashing.

  1. make compile-all :

    Compiles all source file that has no main function. (It only compiles the _program.c source files)

  2. make build-all :

    1. Compiles all source files that has no main function.
    2. For every source file that has the main function, Compile it and Link it with other object files. Then Generate its corresponding executable. (Usually .elf and .hex format)
  3. make flash EXEC=*flash_name*:

    Flashes the .hex file to the microcontroller. The EXEC variable must be specified because we have multiple executables.

    (Note:flash_name must be without any suffixes)

  4. make clean: Cleans all the generated files.

  5. make docs : Generate documentation files.

Examples

To build all the executables and flash the MPU6050_test.hex, just do as the following:

$ make build-all && make all EXEC=MPU6050_test

Other

Badges

Lines of code GitHub repo size GitHub last commit

avr's People

Contributors

abdoaboganima avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.