73 #define TM_DS18B20_H 200
115 #include "stm32f4xx.h"
116 #include "tm_stm32f4_onewire.h"
120 #if TM_ONEWIRE_H < 200
121 #error "Please update TM ONEWIRE LIB, minimum required version is 2.0.0. Download available on stm32f4-discovery.com website"
132 #define DS18B20_FAMILY_CODE 0x28
133 #define DS18B20_CMD_ALARMSEARCH 0xEC
136 #define DS18B20_CMD_CONVERTTEMP 0x44
137 #define DS18B20_DECIMAL_STEPS_12BIT 0.0625
138 #define DS18B20_DECIMAL_STEPS_11BIT 0.125
139 #define DS18B20_DECIMAL_STEPS_10BIT 0.25
140 #define DS18B20_DECIMAL_STEPS_9BIT 0.5
143 #define DS18B20_RESOLUTION_R1 6
144 #define DS18B20_RESOLUTION_R0 5
147 #ifdef DS18B20_USE_CRC
148 #define DS18B20_DATA_LEN 9
150 #define DS18B20_DATA_LEN 2
Definition: tm_stm32f4_ds18b20.h:168
uint8_t TM_DS18B20_SetResolution(TM_OneWire_t *OneWireStruct, uint8_t *ROM, TM_DS18B20_Resolution_t resolution)
Sets resolution for specific DS18B20 device.
OneWire working struct.
Definition: tm_stm32f4_onewire.h:132
TM_DS18B20_Resolution_t
DS18B0 Resolutions available.
Definition: tm_stm32f4_ds18b20.h:166
uint8_t TM_DS18B20_GetResolution(TM_OneWire_t *OneWireStruct, uint8_t *ROM)
Gets resolution for temperature conversion from DS18B20 device.
uint8_t TM_DS18B20_Read(TM_OneWire_t *OneWireStruct, uint8_t *ROM, float *destination)
Reads temperature from DS18B20.
void TM_DS18B20_StartAll(TM_OneWire_t *OneWireStruct)
Starts temperature conversion for all DS18B20 devices on specific onewire channel.
uint8_t TM_DS18B20_Is(uint8_t *ROM)
Checks if device with specific ROM number is DS18B20.
Definition: tm_stm32f4_ds18b20.h:167
Definition: tm_stm32f4_ds18b20.h:170
uint8_t TM_DS18B20_DisableAlarmTemperature(TM_OneWire_t *OneWireStruct, uint8_t *ROM)
Disables alarm temperature for specific DS18B20 sensor.
Definition: tm_stm32f4_ds18b20.h:169
uint8_t TM_DS18B20_SetAlarmLowTemperature(TM_OneWire_t *OneWireStruct, uint8_t *ROM, int8_t temp)
Sets low alarm temperature to specific DS18B20 sensor.
uint8_t TM_DS18B20_SetAlarmHighTemperature(TM_OneWire_t *OneWireStruct, uint8_t *ROM, int8_t temp)
Sets high alarm temperature to specific DS18B20 sensor.
uint8_t TM_DS18B20_Start(TM_OneWire_t *OneWireStruct, uint8_t *ROM)
Starts temperature conversion for specific DS18B20 on specific onewire channel.
uint8_t TM_DS18B20_AlarmSearch(TM_OneWire_t *OneWireStruct)
Searches for devices with alarm flag set.
uint8_t TM_DS18B20_AllDone(TM_OneWire_t *OneWireStruct)
Checks if all DS18B20 sensors are done with temperature conversion.