A DS2482-100 HAL for the STM32F3/F4/H7 series
Go to file
Kilian Bracher 8cead7ac35
add helper to send command to all devices
2024-08-23 17:37:23 +02:00
.gitignore remove single-device mode 2024-08-23 17:27:50 +02:00
DS2482_HAL.c remove single-device mode 2024-08-23 17:27:50 +02:00
DS2482_HAL.h add helper to send command to all devices 2024-08-23 17:37:23 +02:00
LICENSE Initial commit 2024-06-26 03:37:27 +02:00
README.md remove single-device mode 2024-08-23 17:27:50 +02:00

README.md

STM32-DS2482-HAL

A DS2482-100 HAL for the STM32F3/F4/H7 series

Usage

Define the target chip, and set the compiler to C23+:

gcc [...] --std=gnu2x -DSTM32[F3/F4/H7]

or

# (in STM32-for-VSCode.config.yaml)
# Compiler definitions. The -D prefix for the compiler will be automatically added.
cDefinitions:
  - STM32[F3/F4/H7]
  - USE_HAL_DRIVER

# ...

# Compiler flags
cFlags: 
  - --std=gnu2x

Then, configure the HAL:

// (in DS2482_HAL.h)
#define DS2482_TIMEOUT_1W 100    //timeout in ms for 1-wire operations
#define DS2482_TIMEOUT_I2C 100   //timeout in ms for I2C operations

To use the DS2482:

  • Call ds2482_create() with the I2C handle and address
  • Call ds2482_init() with the handle
  • The HAL is ready

Be sure to check the return values for error handling.