ABSTRACT

This chapter describes how Real Time-Thread (RT-Thread) device drivers work with examples. In RT-Thread, those standard peripherals are abstracted as a set of common device driver interfaces for various microcontrollers. The chapter provides information on UART, PIN, SPI, and I2C devices. In the application side, a developer could access the GPIO hardware through PIN device management interfaces. Serial Peripheral Interface is a high-speed, synchronous communication method commonly used for microcontrollers to access, for example, EEPROM, FLASH, real-time clock, AD converter. The purpose of the “SCLK” signal provided by the “master” is to keep the “master” and “slave” synchronous. The device driver code is in the Device Drivers group. The device uses the sample code in the peripheral-samples group.