STM32 LL(Low Layer) library. DS18B20 is 1-Wire digital temperature sensor from Maxim IC.
- Power Supply from 3V to 5.5V
- Celsius temperature measurement with 9 to 12-bit precision, from -55 to 125 (+/-0.5).
- Each sensor has a unique 64-Bit Serial number etched into it - allows for a huge number of sensors to be used on one data bus.
- Conversion Time: < 750ms
- Multiple sensor 1-Wire scan on single port
- Single sensor on port support
- Sensor auto address resolving
- CRC data validation
How to add CPM to the project, check the link
CPMAddPackage(
NAME DS18B20
GITHUB_REPOSITORY ximtech/DS18B20
GIT_TAG origin/main)
- Start project with STM32CubeMX:
- Select: Project Manager -> Advanced Settings -> GPIO -> LL
- Generate Code
- Add sources to project:
include_directories(${includes}
${DS18B20_DIRECTORY}) # source directories
file(GLOB_RECURSE SOURCES ${sources}
${DS18B20_SOURCES}) # source files
add_executable(${PROJECT_NAME}.elf ${SOURCES} ${LINKER_SCRIPT}) # executable declaration should be before libraries
target_link_libraries(${PROJECT_NAME}.elf Vector) # add library dependencies to project
target_link_libraries(${PROJECT_NAME}.elf CRC)
- Then Build -> Clean -> Rebuild Project
- Usage example: link