In the RT-Thread real-time operating system, a wide variety of device drivers are managed through a set of I/O device management frameworks. The device management framework provides a set of standard device operation APIs for upper-level applications, and developers can efficiently interact with the underlying hardware peripherals by calling these standard device operation APIs. The structure of the Device Management Framework is shown in the following figure:
Developing applications using the I/O Device Management Framework has the following advantages:
This section introduces the different class-driven concepts provided by BSPs, and for a BSP, there are three types of drivers:
A schematic diagram of these three peripherals is shown below:
The driver libraries currently provided by RT-Thread already support multiple series of BSPs for RA. Click on the driver name in the table below to jump to the introductory document for the corresponding driver framework. Developers can read the materials to learn how to use these peripheral drivers through the device driver framework in application development.
Driver | Introduction |
---|---|
GPIO | Operate the GPIO pins |
UART | Send and receive data through serial ports |
I2C | Send and receive data via software I2C |
SPI | Send and receive data over SPI |
ADC | Measure the analog data on the pin |
SDIO | Read and write data through SDIO |
TIMER | Use hardware timers to implement the function of measuring time and timing execution callback functions |
PWM | Outputs a PWM waveform at a specific pin |
RTC | Set and read times |
WDT | Watchdog driver |
QSPI | Send and receive data via SPI (1, 2, 4-wire). |
Driver | Introduction |
---|---|
I2C | On-board I2C sensor |
SDIO | SD (TF) card for SPI interface or SDIO interface |
Driver | Introduction |
---|---|
RW007 | WIFI module with SPI interface |
HS300x | Temperature and humidity sensor with I2C interface |
ZMOD4410 | Indoor air quality sensor with I2C interface |
In RT-Thread's examples\test
directory, there is sample code provided by RT-Thread based on different peripheral drivers. You can quickly test the drivers provided in BSP by turning on the drivers to be tested in the env tool and adding the corresponding driver framework test files from examples\test
to the project.
This tutorial translated by Josh Zou