Chapter 18. RTC Drivers
Real Time Clocks (RTCs) are devices used to track the absolute time in nonvolatile memory, which can be internal to the processor or externally connected through the I2C or SPI bus.
You can use an RTC to do the following:
- Read and set the absolute clock, and generate interrupts during clock updates
- Generate periodic interrupts
- Set alarms
RTCs and the system clock have different purposes. The former is a hardware clock that maintains the absolute time and date in a nonvolatile manner, whereas the latter is a software clock maintained by the kernel and used to implement the gettimeofday(2)
and time(2
system calls, set the timestamps on files, and so on. The system clock reports seconds and microseconds from a starting point, defined to be the POSIX epoch: 1970-01-01 00:00:00 +0000 (UTC)
.
In this chapter, we will cover the following topics:
- Introducing the RTC framework API
- Describing driver's architecture, along with a dummy driver example
- Dealing with alarms
- Managing RTC devices...