RT-Thread Device Drivers
Introduction to RT-Thread device model: I/O Device Model
Chip Peripherals
Device Driver |
Corresponding HAL |
---|---|
Configuration
Run menuconfig
, then enter the On-chip Peripheral RTOS Drivers
menu to configure the peripherals to be used. After selecting a device in menuconfig, it means that the corresponding device will be registered during system initialization, and the application can use the rt_device_find
interface to obtain the device pointer by device name. For unregistered devices, rt_device_find
will return a NULL pointer. For example, after selecting the UART1 device, the application can use rt_device_find("uart1")
to obtain the device pointer.
Note
If running menuconfig
in the project directory, you need to add --board=<board_name>
to specify the board being used. Refer to the instructions in Creating an Application. The modified configuration is saved in proj.conf
.