Hardware Abstraction Layer (HAL) provides a platform-agnostic interface, abstracting peripheral interactions from specific hardware implementations. This promotes code reusability, scalability, and maintainability in embedded software development.
Each peripheral shall follow this example directory structure.
Software design document available in the doc/
folder of each peripheral device. Each peripheral should have at least one class diagram and one sequence diagram illustrating the inputs and outputs expected for normal operation when using the interface.
The following example shows the GPIO class and sequence diagram,
The total number of lines of code (LOC) for the header files.
File | Blank | Comment | Code |
---|---|---|---|
hal_uart.h | 29 | 178 | 120 |
hal_can.h | 24 | 166 | 105 |
hal_modbus.h | 25 | 183 | 88 |
hal_i2c.h | 23 | 174 | 84 |
hal_qei.h | 25 | 159 | 81 |
hal_spi.h | 24 | 191 | 81 |
hal_adc.h | 22 | 110 | 71 |
hal_rtc.h | 23 | 152 | 71 |
hal_gpio.h | 21 | 121 | 59 |
hal_nvm.h | 20 | 152 | 54 |
hal_system.h | 20 | 129 | 51 |
hal_dac.h | 20 | 136 | 47 |
hal_timer.h | 18 | 104 | 47 |
hal_pwm.h | 21 | 136 | 46 |
hal_wdt.h | 18 | 104 | 44 |
hal_delay.h | 12 | 72 | 16 |
SUM | 345 | 2267 | 1065 |
Copyright (c) 2024 by TH Muda Engineering. All rights reserved.