Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Driver vs HAL

I am budding Embedded Engineer, currently, I would like to learn how to program nrf52dk. While I am exploring info center, Peripheral examples I have noticed that most of the peripherals has two section: 


1. Driver. 

2. HAL. 

My questions are the following: 

1. What is the difference between these two? and which one to opt 

In future I am interested in implementing RTOS on nrf52. will it make any difference if i learn coding with driver or HAL? 

Thanks in advance, 

Ashok

Parents Reply Children
  • Yes, you're correct. 

    I suggest you study the RTC driver and RTC HAL API documentation and their code implementation, and compare the two abstraction layers. You should also study the RTC — Real-time counter chapter of the Product specification, and take particular note of the Registers description, it will tell you exactly what each bit in a given register does. If you know what each register does, you will understand how the HAL interfaces with the underlying hardware. As many driver functions results in calls to the HAL api, you'll be able to understand what the driver is actually doing.
    Once you've understood the connection between the driver, HAL, product specification, and register description of the RTC you will be able to debug any HW peripheral in the SDK much more effectively. 

    I believe this abstraction model extends to a great number of embedded systems. 

Related