Library Functions.
More...
|
| uint8_t | TM_DS18B20_Start (TM_OneWire_t *OneWireStruct, uint8_t *ROM) |
| | Starts temperature conversion for specific DS18B20 on specific onewire channel. More...
|
| |
| void | TM_DS18B20_StartAll (TM_OneWire_t *OneWireStruct) |
| | Starts temperature conversion for all DS18B20 devices on specific onewire channel. More...
|
| |
| uint8_t | TM_DS18B20_Read (TM_OneWire_t *OneWireStruct, uint8_t *ROM, float *destination) |
| | Reads temperature from DS18B20. More...
|
| |
| uint8_t | TM_DS18B20_GetResolution (TM_OneWire_t *OneWireStruct, uint8_t *ROM) |
| | Gets resolution for temperature conversion from DS18B20 device. More...
|
| |
| uint8_t | TM_DS18B20_SetResolution (TM_OneWire_t *OneWireStruct, uint8_t *ROM, TM_DS18B20_Resolution_t resolution) |
| | Sets resolution for specific DS18B20 device. More...
|
| |
| uint8_t | TM_DS18B20_Is (uint8_t *ROM) |
| | Checks if device with specific ROM number is DS18B20. More...
|
| |
| uint8_t | TM_DS18B20_SetAlarmHighTemperature (TM_OneWire_t *OneWireStruct, uint8_t *ROM, int8_t temp) |
| | Sets high alarm temperature to specific DS18B20 sensor. More...
|
| |
| uint8_t | TM_DS18B20_SetAlarmLowTemperature (TM_OneWire_t *OneWireStruct, uint8_t *ROM, int8_t temp) |
| | Sets low alarm temperature to specific DS18B20 sensor. More...
|
| |
| uint8_t | TM_DS18B20_DisableAlarmTemperature (TM_OneWire_t *OneWireStruct, uint8_t *ROM) |
| | Disables alarm temperature for specific DS18B20 sensor. More...
|
| |
| uint8_t | TM_DS18B20_AlarmSearch (TM_OneWire_t *OneWireStruct) |
| | Searches for devices with alarm flag set. More...
|
| |
| uint8_t | TM_DS18B20_AllDone (TM_OneWire_t *OneWireStruct) |
| | Checks if all DS18B20 sensors are done with temperature conversion. More...
|
| |
Library Functions.
| uint8_t TM_DS18B20_AlarmSearch |
( |
TM_OneWire_t * |
OneWireStruct | ) |
|
Searches for devices with alarm flag set.
- Parameters
-
| *OneWireStruct | Pointer to TM_OneWire_t working structure (OneWire channel) |
- Return values
-
| Alarm | search status
- 0: No device found with alarm flag set
- > 0: Device is found with alarm flag
|
- Note
- To get all devices on one onewire channel with alarm flag set, you can do this:
while (TM_DS18B20_AlarmSearch(&OneWireStruct)) {
//Read device ID here
//Print to user device by device
}
- Return values
-
| 1 | if any device has flag, otherwise 0 |
Checks if all DS18B20 sensors are done with temperature conversion.
- Parameters
-
| *OneWireStruct | Pointer to TM_OneWire_t working structure (OneWire channel) |
- Return values
-
| Conversion | status
- 0: Not all devices are done
- > 0: All devices are done with conversion
|
| uint8_t TM_DS18B20_DisableAlarmTemperature |
( |
TM_OneWire_t * |
OneWireStruct, |
|
|
uint8_t * |
ROM |
|
) |
| |
Disables alarm temperature for specific DS18B20 sensor.
- Parameters
-
| *OneWireStruct | Pointer to TM_OneWire_t working structure (OneWire channel) |
| *ROM | Pointer to first byte of ROM address for desired DS12B80 device. Entire ROM address is 8-bytes long |
- Return values
-
| Success | status:
- 0: Device is not DS18B20
- > 0: Alarm disabled OK
|
| uint8_t TM_DS18B20_GetResolution |
( |
TM_OneWire_t * |
OneWireStruct, |
|
|
uint8_t * |
ROM |
|
) |
| |
Gets resolution for temperature conversion from DS18B20 device.
- Parameters
-
| *OneWireStruct | Pointer to TM_OneWire_t working structure (OneWire channel) |
| *ROM | Pointer to first byte of ROM address for desired DS12B80 device. Entire ROM address is 8-bytes long |
- Return values
-
| Resolution |
- 0: Device is not DS18B20
- 9 - 12: Resolution of DS18B20
|
| uint8_t TM_DS18B20_Is |
( |
uint8_t * |
ROM | ) |
|
Checks if device with specific ROM number is DS18B20.
- Parameters
-
| *ROM | Pointer to first byte of ROM address for desired DS12B80 device. Entire ROM address is 8-bytes long |
- Return values
-
| Device | status
- 0: Device is not DS18B20
- > 0: Device is DS18B20
|
| uint8_t TM_DS18B20_Read |
( |
TM_OneWire_t * |
OneWireStruct, |
|
|
uint8_t * |
ROM, |
|
|
float * |
destination |
|
) |
| |
Reads temperature from DS18B20.
- Parameters
-
| *OneWireStruct | Pointer to TM_OneWire_t working structure (OneWire channel) |
| *ROM | Pointer to first byte of ROM address for desired DS12B80 device. Entire ROM address is 8-bytes long |
| *destination | Pointer to float variable to store temperature |
- Return values
-
| Temperature | status:
- 0: Device is not DS18B20 or conversion is not done yet or CRC failed
- > 0: Temperature is read OK
|
| uint8_t TM_DS18B20_SetAlarmHighTemperature |
( |
TM_OneWire_t * |
OneWireStruct, |
|
|
uint8_t * |
ROM, |
|
|
int8_t |
temp |
|
) |
| |
Sets high alarm temperature to specific DS18B20 sensor.
- Parameters
-
| *OneWireStruct | Pointer to TM_OneWire_t working structure (OneWire channel) |
| *ROM | Pointer to first byte of ROM address for desired DS12B80 device. Entire ROM address is 8-bytes long |
| temp | integer value for temperature between -55 to 125 degrees |
- Return values
-
| Success | status:
- 0: Device is not DS18B20
- > 0: High alarm set OK
|
| uint8_t TM_DS18B20_SetAlarmLowTemperature |
( |
TM_OneWire_t * |
OneWireStruct, |
|
|
uint8_t * |
ROM, |
|
|
int8_t |
temp |
|
) |
| |
Sets low alarm temperature to specific DS18B20 sensor.
- Parameters
-
| *OneWireStruct | Pointer to TM_OneWire_t working structure (OneWire channel) |
| *ROM | Pointer to first byte of ROM address for desired DS12B80 device. Entire ROM address is 8-bytes long |
| temp | integer value for temperature between -55 to 125 degrees |
- Return values
-
| Success | status:
- 0: Device is not DS18B20
- > 0: Low alarm set OK
|
Sets resolution for specific DS18B20 device.
- Parameters
-
| *OneWireStruct | Pointer to TM_OneWire_t working structure (OneWire channel) |
| *ROM | Pointer to first byte of ROM address for desired DS12B80 device. Entire ROM address is 8-bytes long |
| resolution | Resolution for DS18B20 device. This parameter can be a value of TM_DS18B20_Resolution_t enumeration. |
- Return values
-
| Success | status:
- 0: Device is not DS18B20
- > 0: Resolution set OK
|
| uint8_t TM_DS18B20_Start |
( |
TM_OneWire_t * |
OneWireStruct, |
|
|
uint8_t * |
ROM |
|
) |
| |
Starts temperature conversion for specific DS18B20 on specific onewire channel.
- Parameters
-
| *OneWireStruct | Pointer to TM_OneWire_t working structure (OneWire channel) |
| *ROM | Pointer to first byte of ROM address for desired DS12B80 device. Entire ROM address is 8-bytes long |
- Return values
-
| 1 | if device is DS18B20 or 0 if not |
Starts temperature conversion for all DS18B20 devices on specific onewire channel.
- Note
- This mode will skip ROM addressing
- Parameters
-
| *OneWireStruct | Pointer to TM_OneWire_t working structure (OneWire channel) |
- Return values
-