Feedback
Feedback

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

Lesson 7 – Device driver development

Overview

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 and implementation. Then we will take a look at the sensor driver API available in nRF Connect SDK, and how to add a custom sensor to it. After implementing custom driver using sensor API we will extend the driver by power management routines. Finally we will design our own API and implement the driver which covers this API.

In the exercise section, we will use the BME280 sensor with the SPI interface that was used in Lesson 5. We will practice creating a custom driver for this sensor using the sensor driver API.

Objectives

  • Explore the available options for adding a custom device driver
  • Understand the different application types in nRF Connect SDK
  • Learn how to add a sensor to the Zephyr sensor driver API
  • Practice through hands-on exercise how to create a custom API and a device driver for it
  • Learn Zephyr device driver power management and implement power management routines in the custom driver

Prerequisites

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.