STM32 HAL-based driver for the ADT7320 high-accuracy digital temperature sensor over SPI.
- Full STM32 HAL compatibility — supports all STM32 MCU series (F0–F7, G0/G4, H7, L0–L5, U0/U5)
- MISRA-C-style design — clean, safe, and portable for embedded and safety-critical applications
- Modular and portable — works with STM32CubeIDE, Keil, IAR, or Makefile-based environments
- Supports read/write access to all ADT7320 registers
- Accurate temperature conversion to degrees Celsius
- Mode: Full-Duplex Master
- Data Size: 8-bit
- First Bit: MSB First
- Clock Polarity (CPOL): High
- Clock Phase (CPHA): 2nd Edge
- Add a GPIO Output pin for CS (Chip Select)
- Include
adt7320.h
in your application code - Add
adt7320.c
to your compiler - Set the STM32 MCU series macro in
adt7320_config.h
- Add the library folder to your compiler’s include paths
Each function returns an ADT7320_StatusTypeDef
status code.
Sends a reset sequence to initialize sensor.
Reads data from any ADT7320 register.
Writes data to any ADT7320 register.
Reads and converts the temperature to °C.
A complete working example is available in example/main.c
.
This project is released under the MIT License.
Amirhossein Askari
📧 theamiraskarii@gmail.com
🔗 GitHub Profile