LibDriver DS18B20
Loading...
Searching...
No Matches
ds18b20 advance driver function

ds18b20 advance driver modules More...

Collaboration diagram for ds18b20 advance driver function:

Macros

#define DS18B20_MAX_SEARCH_SIZE   64
 ds18b20 max search size definition

Functions

uint8_t ds18b20_scratchpad_set_alarm_threshold (ds18b20_handle_t *handle, int8_t threshold_high, int8_t threshold_low)
 set the alarm threshold in the scratchpad
uint8_t ds18b20_scrachpad_get_alarm_threshold (ds18b20_handle_t *handle, int8_t *threshold_high, int8_t *threshold_low)
 get the alarm threshold in the scratchpad
uint8_t ds18b20_alarm_convert_to_register (ds18b20_handle_t *handle, float temp, int8_t *reg)
 convert the alarm temperature to the register data
uint8_t ds18b20_alarm_convert_to_data (ds18b20_handle_t *handle, int8_t reg, float *temp)
 convert the register data to the alarm temperature
uint8_t ds18b20_search_rom (ds18b20_handle_t *handle, uint8_t(*rom)[8], uint8_t *num)
 search the ds18b20 rom
uint8_t ds18b20_search_alarm (ds18b20_handle_t *handle, uint8_t(*rom)[8], uint8_t *num)
 search the ds18b20 alarm rom
uint8_t ds18b20_get_power_mode (ds18b20_handle_t *handle, ds18b20_power_mode_t *power_mode)
 get the power mode

Detailed Description

ds18b20 advance driver modules

Macro Definition Documentation

◆ DS18B20_MAX_SEARCH_SIZE

#define DS18B20_MAX_SEARCH_SIZE   64

ds18b20 max search size definition

max 64 devices

Definition at line 64 of file driver_ds18b20.h.

Function Documentation

◆ ds18b20_alarm_convert_to_data()

uint8_t ds18b20_alarm_convert_to_data ( ds18b20_handle_t * handle,
int8_t reg,
float * temp )

convert the register data to the alarm temperature

Parameters
[in]*handlepointer to a ds18b20 handle structure
[in]regregister data
[out]*temppointer to an alarm temperature buffer
Returns
status code
  • 0 success
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1278 of file driver_ds18b20.c.

◆ ds18b20_alarm_convert_to_register()

uint8_t ds18b20_alarm_convert_to_register ( ds18b20_handle_t * handle,
float temp,
int8_t * reg )

convert the alarm temperature to the register data

Parameters
[in]*handlepointer to a ds18b20 handle structure
[in]tempalarm temperature
[out]*regpointer to a register data
Returns
status code
  • 0 success
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1251 of file driver_ds18b20.c.

◆ ds18b20_get_power_mode()

uint8_t ds18b20_get_power_mode ( ds18b20_handle_t * handle,
ds18b20_power_mode_t * power_mode )

get the power mode

Parameters
[in]*handlepointer to a ds18b20 handle structure
[out]*power_modepointer to a power mode buffer
Returns
status code
  • 0 success
  • 1 get power mode failed
Note
none

Definition at line 1988 of file driver_ds18b20.c.

◆ ds18b20_scrachpad_get_alarm_threshold()

uint8_t ds18b20_scrachpad_get_alarm_threshold ( ds18b20_handle_t * handle,
int8_t * threshold_high,
int8_t * threshold_low )

get the alarm threshold in the scratchpad

Parameters
[in]*handlepointer to a ds18b20 handle structure
[out]*threshold_highpointer to a high threshold buffer
[out]*threshold_lowpointer to a low threshold buffer
Returns
status code
  • 0 success
  • 1 scratchpad get alarm threshold failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 958 of file driver_ds18b20.c.

◆ ds18b20_scratchpad_set_alarm_threshold()

uint8_t ds18b20_scratchpad_set_alarm_threshold ( ds18b20_handle_t * handle,
int8_t threshold_high,
int8_t threshold_low )

set the alarm threshold in the scratchpad

Parameters
[in]*handlepointer to a ds18b20 handle structure
[in]threshold_highhigh threshold
[in]threshold_lowlow threshold
Returns
status code
  • 0 success
  • 1 scratchpad set alarm threshold failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 773 of file driver_ds18b20.c.

◆ ds18b20_search_alarm()

uint8_t ds18b20_search_alarm ( ds18b20_handle_t * handle,
uint8_t(*) rom[8],
uint8_t * num )

search the ds18b20 alarm rom

Parameters
[in]*handlepointer to a ds18b20 handle structure
[out]**rompointer to a rom array
[in,out]*numpointer to an array size buffer
Returns
status code
  • 0 success
  • 1 search alarm failed
Note
none

Definition at line 1965 of file driver_ds18b20.c.

◆ ds18b20_search_rom()

uint8_t ds18b20_search_rom ( ds18b20_handle_t * handle,
uint8_t(*) rom[8],
uint8_t * num )

search the ds18b20 rom

Parameters
[in]*handlepointer to a ds18b20 handle structure
[out]**rompointer to a rom array
[in,out]*numpointer to an array size buffer
Returns
status code
  • 0 success
  • 1 search rom failed
Note
none

Definition at line 1941 of file driver_ds18b20.c.