STM32F407VET6 uses RT-Thread to add DS18B20 temperature sensor software package online
Add packages online
Use the env tool in the relevant directory
to open the sensor framework
. Find the corresponding software package and open it.
Open the keil project, and you will find the corresponding software package and sensor framework
. Modify the pins and refer to the example to use.
It should be noted here that if you are using the following DS18B20 modules without external resistors, you should change the pins to pull-up input mode, otherwise the device cannot be found. Can't find device: temp_ds18b20.
Modify as follows:
Steps to add packages manually
Open the sensor framework
and add the driver code. Here is a general idea without going into each step carefully.
The driver code includes: hardware driver function part, ops function, data acquisition function, instruction control function, initialization (including sensor structure assignment).
ops function, data acquisition function, instruction control function, and
initialization
driver related functions are written, basically for the acquisition of temperature sensor data: hardware initialization, raw data acquisition (ds18b20 should be written according to the timing, I did it lazily), data processing, Control transfer instructions, etc.
If you use it, you can use the frame method according to the conventional equipment.