If you are having issues with the exercises, please create a ticket on DevZone:
Click or drag files to this area to upload. You can upload up to 2 files.

Lesson 7 – Device driver model


A device driver is a combination of statically allocated structures maintained in the kernel that contain information about the device instance. Some of the device information that is worth mentioning is config, data, state, and an API to access the device-specific implementation of all the features supported for this specific device.

In this lesson, we will cover the device driver model, API, instances, implementation, and the code path from the application call to the driver implementation and important helper functions.

In the exercise section, we will use the BME280 sensor with the SPI interface that was used in Lesson 5. We will practice adding a feature to the driver and accessing it in the application using system calls and the Zephyr sensor API.


  • Learn how interrupts are handled in Zephyr RTOS.
  • Explore the available options for adding a custom device driver.
  • Picking a standard API for your custom device driver.
  • Creating custom API for your device driver.  
  • Practice through hands-on exercises adding a custom device driver.


Complete Lesson 5 before starting this lesson. We will use the same SPI instance with the same sensor (BME280) and dive deeper into the details of the underlying device driver.

Register an account
Already have an account? Log in
(All fields are required unless specified optional)

  • 8 or more characters
  • Upper and lower case letters
  • At least one number or special character

Forgot your password?
Enter the email associated with your account, and we will send you a link to reset your password.