Skip to Content
Hands-On Embedded Programming with C++17
book

Hands-On Embedded Programming with C++17

by Maya Posch
January 2019
Intermediate to advanced
458 pages
10h 35m
English
Packt Publishing
Content preview from Hands-On Embedded Programming with C++17

Custom drivers

The exact format and integration of drivers (kernel modules) with the OS kernel differs for each OS and thus would be impossible to fully cover here. We will, however, look at how the driver for the RTC module we used earlier is implemented for Linux.

In addition, we will look at how to use an I2C peripheral from user space later in this chapter, in the club room monitoring example. Using a user space-based driver (library) is often a good alternative to implementing it as a kernel module.

The RTC functionality is integrated into the Linux kernel, with the code for it found in the /drivers/rtc folder (on GitHub, at https://github.com/torvalds/linux/tree/master/drivers/rtc).

The rtc-ds1307.c file contains two functions we need ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Hands-On RTOS with Microcontrollers

Hands-On RTOS with Microcontrollers

Brian Amos

Publisher Resources

ISBN: 9781788629300Supplemental Content