STM32-DS2482-HAL
A DS2482-100 HAL for the STM32F3/F4/H7 series
Usage
Be sure to have the target chip defined:
gcc [...] -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
Then, configure the HAL:
// (in DS2482_HAL.h)
#define DS2482_I2C_ADDR 0x30 //change to desired values
#define DS2482_TIMEOUT_1W 100 //how long we wait for 1-Wire operations to complete
#define DS2482_TIMEOUT_I2C 100
Call ds2482_init()
with the I2C handle, and the HAL is ready.
Be sure to check the return values for error handling.
Description
Languages
C
100%