Pages

Wednesday, February 18, 2015

Why header file?

Header file in a program will comprise of the files, function definitions and macros. Basically we will give same name for the c (or cpp file) and its corresponding header file. Like "ExInit.c" and "ExInit.h" file. So in this example, the preprocessor macros and functions that are used in the "ExInit.c" will be included in the "ExInit.h" .

Why we are using header file is a question since we can declare it in the c file itself. So what I found out from my experience is follows:

  1. Easy review since it is a structured one.
  2. To include in multiple file same group of files,functions or macros.
  3. To include inbuilt library of the c compiler.
  4. To reduce the code size by making proper conditional preprocessor statements.
  5. To improve compilation time.

Wednesday, February 11, 2015

Why AUTOSAR?

AUTOSAR( Automotive Open System Architecture) is basically to standardize cross ECU communication from different OEM manufacturers. The other main intention is to reduce the future development as all the different layers of the AUTOSAR will become compatible each other. Here the main idea is that most of the modules in controller are having basic functions as same. So even the function name and register mapped names in the lower layers are made same which makes the upper layers to work independently even changing the entire controller of the ECU.

Mainly the AUTOSAR layers are divided in top to bottom layer as :

  1. APP
  2. Run Time Environment (RTE)
  3. Service Layer
  4. ECU Abstraction Layer(ECAL)
  5. Microcontroller Abstraction Layer(MCAL)


The idea is so fine that in future it will be even good in implementing robotics, where the robot can change its parts which have same lower layer calls and every other components will remain the same as in the science fiction movies.