HAL Features

HAL includes a rich set of features making writing application a simpler task. The user has no necessity to understand all the inner working of MCU.

  • Rich set of device driver models:
    • ADC, abstraction of ADC units with streaming and callback capability.
    • CAN, abstraction of CAN bus units.
    • DAC, abstraction of DAC units with streaming and callback capability.
    • EXT, abstraction of external interrupts with callback capability.
    • GPT, abstraction on one-shot or continuous timers with callback capability.
    • I2C, abstraction of an I2C master.
    • I2S, abstraction of an I2S master or slave with streaming and callback capability.
    • ICU, abstraction of a PWM-input unit with callback capability.
    • MAC, abstraction of an Ethernet interface with events generation capability.
    • PAL, abstraction of GPIO initialization, configuration and use.
    • PWM, abstraction of a PWM-output unit with callback capability and multiple channels handling.
    • RTC, abstraction of an RTC clock unit with alarms callback capability.
    • SDC, abstraction of an SDIO interface to SD/MMC cards. Implements a block interface.
    • Serial, abstraction of a buffered serial port with events generation capability. Implements a channel interface.
    • SPI, abstraction of an SPI master with callback capability.
    • ST, abstraction of a system tick timer for RTOS support.
    • UART, abstraction of an UART unit with callback capability and unbuffered handling.
    • USB, abstraction of an USB device unit with callback capability.
  • Device drivers are configured using configuration structures, all the HW-dependent information is encapsulated in those structures, the API is invariant.
  • Complex device drivers.
    • Serial over USB, a CDC device is implemented on top of the USB driver. Implements a channel interface.
    • MMC/SD over SPI, MMC and SD cards handling on top of the SPI driver. Implements a block interface.
  • Abstract interfaces:
    • Streams. Abstract interface of an bidirectional stream, streams can be read and written.
    • Channels. Extends streams with events for use in asynchronous I/O, introduces timeouts.
    • Files. Extends streams for file I/O.
    • Block Devices. Abstraction over devices that handle data in blocks (MMC and SD cards for example).
  • Support functionalities:
    • I/O queues. Circular buffers handling.
    • Formatter. Printf-like functionality over streams.
    • Memory Stream. Stream-like object over a memory buffer.
    • Null Stream. Stream-like object that discards output.
Code Portability

Is code portability really possible using HAL? What are the limitations?

learn more