Suppose I have a big project in which I have written code for UART, SPI and I2C in single file. I can create separate header and source file for moduleThe primary advantage of multi-file programs is problem decomposition and modularity. What you put into a file and what you put into a function are two aspects of the same thing.
Something like
Code:
Uart.h
Uart.c
SPI.h
SPI.c
I2C.c
I2C.h
main.c
or the header file for each model will be included in the their source file only?