HAL (Hardware Abstraction layer) is an interface between “normal” user modules and actual hardware. It makes hardware access easy and portable, it also gives us a layer where we can write optimized, hardware specific code if we need to. The following is a list of HAL classes.
|ADC (Analogue to Digital Converter) will read and analogue value and provide a 8- or 12- bit sampling value either through direct or buffered read. The HAL module embed the hardware into an easy to use module.
|Hardware CRC calculation.
|Digital to Analogue Conversion.
|Direct Memory Access
|ETC (Elapsed Time Clock) count the time in ms and ys since the MPU was started. This is used for time differences by the RTOS itself and available all through code using the ETC::millis() or ETC::micros() functions. ETC is the only mandatory part of our HAL.
|GPIO provide access to a collection of pins. GPIO collections are declared in global space by the user and support logical pin grouping. This means that user modules can toggle pins with a given name even if their location is different from hardware to hardware. This allows the user to “wire” a board during initialization to preserve portability on modules that need pin Access.
|I2C bus interface.
|Real Time Clock.
|Serial Peripheral Interface is a high speed serial bus allowing devices to communicate. It is a network using a GPIO pin to select what device to talk with, but is also extended using the SmartSPI protocol. The SPI classes provide a serial interface with byte streams allowing the user to send/receive without digging into the complexity of a bit-stream.
|Hardware Timers are found on most modern MCU’s. They offer a count-down clock and various features like the capability to connect to GPIO pins and send PWM or perform a more advanced 3-phase Motor Control. The Timer class provide a uniform wrapper exposing the capabilities without digging into vendor specific implementations.
The list above is a draft that will change!
All HAL classes uses an empty, default constructor and need to call a Init(…) function as part of system initialization. This Init() function is hardware specific as it will “wire” the system.