LibDriver MAX31865
Loading...
Searching...
No Matches
max31865 base driver function

max31865 base driver modules More...

Collaboration diagram for max31865 base driver function:

Data Structures

struct  max31865_handle_s
 max31865 handle structure definition More...
struct  max31865_info_s
 max31865 information structure definition More...

Typedefs

typedef struct max31865_handle_s max31865_handle_t
 max31865 handle structure definition
typedef struct max31865_info_s max31865_info_t
 max31865 information structure definition

Enumerations

enum  max31865_bool_t { MAX31865_BOOL_FALSE = 0x00 , MAX31865_BOOL_TRUE = 0x01 }
 max31865 bool enumeration definition More...
enum  max31865_wire_t { MAX31865_WIRE_2 = 0x00 , MAX31865_WIRE_3 = 0x01 , MAX31865_WIRE_4 = 0x00 }
 max31865 wire type enumeration definition More...
enum  max31865_resistor_t { MAX31865_RESISTOR_100PT = 0x00 , MAX31865_RESISTOR_1000PT = 0x01 }
 max31865 resistor type enumeration definition More...
enum  max31865_filter_select_t { MAX31865_FILTER_SELECT_60HZ = 0x00 , MAX31865_FILTER_SELECT_50HZ = 0x01 }
 max31865 filter select enumeration definition More...
enum  max31865_fault_detection_cycle_control_t { MAX31865_FAULT_DETECTION_CYCLE_CONTROL_NO_ACTION = 0x00 , MAX31865_FAULT_DETECTION_CYCLE_CONTROL_AUTOMATIC_DELAY = 0x01 , MAX31865_FAULT_DETECTION_CYCLE_CONTROL_MANUAL_DELAY_CYCLE_1 = 0x02 , MAX31865_FAULT_DETECTION_CYCLE_CONTROL_MANUAL_DELAY_CYCLE_2 = 0x03 }
 max31865 fault detection cycle control enumeration definition More...
enum  max31865_fault_detection_cycle_control_status_t { MAX31865_FAULT_DETECTION_CYCLE_CONTROL_STATUS_FINISHED = 0x00 , MAX31865_FAULT_DETECTION_CYCLE_CONTROL_STATUS_AUTOMATIC_RUNNING = 0x01 , MAX31865_FAULT_DETECTION_CYCLE_CONTROL_STATUS_MANUAL_DELAY_CYCLE_1_RUNNING = 0x02 , MAX31865_FAULT_DETECTION_CYCLE_CONTROL_STATUS_MANUAL_DELAY_CYCLE_2_RUNNING = 0x03 }
 max31865 fault detection cycle control status enumeration definition More...
enum  max31865_fault_status_t {
  MAX31865_FAULT_STATUS_RTD_HIGH_THRESHOLD = (1 << 7) , MAX31865_FAULT_STATUS_RTD_LOW_THRESHOLD = (1 << 6) , MAX31865_FAULT_STATUS_REFIN_MORE_THAN_0P85_VBIAS = (1 << 5) , MAX31865_FAULT_STATUS_REFIN_LESS_THAN_0P85_VBIAS = (1 << 4) ,
  MAX31865_FAULT_STATUS_RTDIN_LESS_THAN_0P85_VBIAS = (1 << 3) , MAX31865_FAULT_STATUS_OVER_UNDER_VOLTAGE = (1 << 2)
}
 max31865 fault status enumeration definition More...

Functions

uint8_t max31865_info (max31865_info_t *info)
 get chip's information
uint8_t max31865_init (max31865_handle_t *handle)
 initialize the chip
uint8_t max31865_deinit (max31865_handle_t *handle)
 close the chip
uint8_t max31865_single_read (max31865_handle_t *handle, uint16_t *raw, float *temp)
 read data once
uint8_t max31865_start_continuous_read (max31865_handle_t *handle)
 start reading
uint8_t max31865_stop_continuous_read (max31865_handle_t *handle)
 stop reading
uint8_t max31865_continuous_read (max31865_handle_t *handle, uint16_t *raw, float *temp)
 read data continuously
uint8_t max31865_set_filter_select (max31865_handle_t *handle, max31865_filter_select_t filter)
 set the filter type
uint8_t max31865_get_filter_select (max31865_handle_t *handle, max31865_filter_select_t *filter)
 get the filter type
uint8_t max31865_set_wire (max31865_handle_t *handle, max31865_wire_t wire)
 set the pt resistor wire
uint8_t max31865_get_wire (max31865_handle_t *handle, max31865_wire_t *wire)
 get the pt resistor wire
uint8_t max31865_set_reference_resistor (max31865_handle_t *handle, float value)
 set the reference resistor
uint8_t max31865_get_reference_resistor (max31865_handle_t *handle, float *value)
 get the reference resistor
uint8_t max31865_set_resistor (max31865_handle_t *handle, max31865_resistor_t resistor)
 set the pt resistor
uint8_t max31865_get_resistor (max31865_handle_t *handle, max31865_resistor_t *resistor)
 get the pt resistor
uint8_t max31865_set_vbias (max31865_handle_t *handle, max31865_bool_t enable)
 set the chip vbias
uint8_t max31865_get_vbias (max31865_handle_t *handle, max31865_bool_t *enable)
 get the chip vbias
uint8_t max31865_clear_fault_status (max31865_handle_t *handle)
 clear all fault status
uint8_t max31865_get_fault_status (max31865_handle_t *handle, uint8_t *status)
 get the fault status
uint8_t max31865_set_high_fault_threshold (max31865_handle_t *handle, uint16_t threshold)
 set the high fault threshold
uint8_t max31865_get_high_fault_threshold (max31865_handle_t *handle, uint16_t *threshold)
 get the high fault threshold
uint8_t max31865_set_low_fault_threshold (max31865_handle_t *handle, uint16_t threshold)
 set the low fault threshold
uint8_t max31865_get_low_fault_threshold (max31865_handle_t *handle, uint16_t *threshold)
 get the low fault threshold
uint8_t max31865_set_fault_detection_cycle_control (max31865_handle_t *handle, max31865_fault_detection_cycle_control_t control)
 set the fault detection cycle control
uint8_t max31865_get_fault_detection_cycle_control (max31865_handle_t *handle, max31865_fault_detection_cycle_control_status_t *status)
 get the fault detection cycle control

Detailed Description

max31865 base driver modules

Typedef Documentation

◆ max31865_handle_t

max31865 handle structure definition

◆ max31865_info_t

max31865 information structure definition

Enumeration Type Documentation

◆ max31865_bool_t

max31865 bool enumeration definition

Enumerator
MAX31865_BOOL_FALSE 

disable function

MAX31865_BOOL_TRUE 

enable function

Definition at line 64 of file driver_max31865.h.

◆ max31865_fault_detection_cycle_control_status_t

max31865 fault detection cycle control status enumeration definition

Enumerator
MAX31865_FAULT_DETECTION_CYCLE_CONTROL_STATUS_FINISHED 

finished status

MAX31865_FAULT_DETECTION_CYCLE_CONTROL_STATUS_AUTOMATIC_RUNNING 

automatic running status

MAX31865_FAULT_DETECTION_CYCLE_CONTROL_STATUS_MANUAL_DELAY_CYCLE_1_RUNNING 

manual delay cycle 1 running status

MAX31865_FAULT_DETECTION_CYCLE_CONTROL_STATUS_MANUAL_DELAY_CYCLE_2_RUNNING 

manual delay cycle 2 running status

Definition at line 112 of file driver_max31865.h.

◆ max31865_fault_detection_cycle_control_t

max31865 fault detection cycle control enumeration definition

Enumerator
MAX31865_FAULT_DETECTION_CYCLE_CONTROL_NO_ACTION 

no action

MAX31865_FAULT_DETECTION_CYCLE_CONTROL_AUTOMATIC_DELAY 

automatic delay

MAX31865_FAULT_DETECTION_CYCLE_CONTROL_MANUAL_DELAY_CYCLE_1 

manual delay cycle 1

MAX31865_FAULT_DETECTION_CYCLE_CONTROL_MANUAL_DELAY_CYCLE_2 

manual delay cycle 2

Definition at line 101 of file driver_max31865.h.

◆ max31865_fault_status_t

max31865 fault status enumeration definition

Enumerator
MAX31865_FAULT_STATUS_RTD_HIGH_THRESHOLD 

rtd high threshold

MAX31865_FAULT_STATUS_RTD_LOW_THRESHOLD 

rtd low threshold

MAX31865_FAULT_STATUS_REFIN_MORE_THAN_0P85_VBIAS 

ref more than 0.85 vbias

MAX31865_FAULT_STATUS_REFIN_LESS_THAN_0P85_VBIAS 

ref less than 0.85 vbias

MAX31865_FAULT_STATUS_RTDIN_LESS_THAN_0P85_VBIAS 

rtdin less than 0.85 vbias

MAX31865_FAULT_STATUS_OVER_UNDER_VOLTAGE 

over under voltage

Definition at line 123 of file driver_max31865.h.

◆ max31865_filter_select_t

max31865 filter select enumeration definition

Enumerator
MAX31865_FILTER_SELECT_60HZ 

60Hz noise filter

MAX31865_FILTER_SELECT_50HZ 

50Hz noise filter

Definition at line 92 of file driver_max31865.h.

◆ max31865_resistor_t

max31865 resistor type enumeration definition

Enumerator
MAX31865_RESISTOR_100PT 

100pt resistor type

MAX31865_RESISTOR_1000PT 

1000pt resistor type

Definition at line 83 of file driver_max31865.h.

◆ max31865_wire_t

max31865 wire type enumeration definition

Enumerator
MAX31865_WIRE_2 

2 wire mode

MAX31865_WIRE_3 

3 wire mode

MAX31865_WIRE_4 

4 wire mode

Definition at line 73 of file driver_max31865.h.

Function Documentation

◆ max31865_clear_fault_status()

uint8_t max31865_clear_fault_status ( max31865_handle_t * handle)

clear all fault status

Parameters
[in]*handlepointer to a max31865 handle structure
Returns
status code
  • 0 success
  • 1 clear fault status failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 561 of file driver_max31865.c.

◆ max31865_continuous_read()

uint8_t max31865_continuous_read ( max31865_handle_t * handle,
uint16_t * raw,
float * temp )

read data continuously

Parameters
[in]*handlepointer to a max31865 handle structure
[out]*rawpointer to a raw temperature buffer
[out]*temppointer to a converted temperature buffer
Returns
status code
  • 0 success
  • 1 continuous read failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 find rtd fault
Note
none

Definition at line 1012 of file driver_max31865.c.

◆ max31865_deinit()

uint8_t max31865_deinit ( max31865_handle_t * handle)

close the chip

Parameters
[in]*handlepointer to a max31865 handle structure
Returns
status code
  • 0 success
  • 1 spi deinit failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 power down failed
Note
none

Definition at line 186 of file driver_max31865.c.

◆ max31865_get_fault_detection_cycle_control()

uint8_t max31865_get_fault_detection_cycle_control ( max31865_handle_t * handle,
max31865_fault_detection_cycle_control_status_t * status )

get the fault detection cycle control

Parameters
[in]*handlepointer to a max31865 handle structure
[out]*statuspointer to a fault detection cycle buffer
Returns
status code
  • 0 success
  • 1 get fault detection cycle control failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 798 of file driver_max31865.c.

◆ max31865_get_fault_status()

uint8_t max31865_get_fault_status ( max31865_handle_t * handle,
uint8_t * status )

get the fault status

Parameters
[in]*handlepointer to a max31865 handle structure
[out]*statuspointer to a fault status buffer
Returns
status code
  • 0 success
  • 1 get fault status failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 598 of file driver_max31865.c.

◆ max31865_get_filter_select()

uint8_t max31865_get_filter_select ( max31865_handle_t * handle,
max31865_filter_select_t * filter )

get the filter type

Parameters
[in]*handlepointer to a max31865 handle structure
[out]*filterpointer to a filter type buffer
Returns
status code
  • 0 success
  • 1 get filter select failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 273 of file driver_max31865.c.

◆ max31865_get_high_fault_threshold()

uint8_t max31865_get_high_fault_threshold ( max31865_handle_t * handle,
uint16_t * threshold )

get the high fault threshold

Parameters
[in]*handlepointer to a max31865 handle structure
[out]*thresholdpointer to a high fault threshold buffer
Returns
status code
  • 0 success
  • 1 get high fault threshold failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 654 of file driver_max31865.c.

◆ max31865_get_low_fault_threshold()

uint8_t max31865_get_low_fault_threshold ( max31865_handle_t * handle,
uint16_t * threshold )

get the low fault threshold

Parameters
[in]*handlepointer to a max31865 handle structure
[out]*thresholdpointer to a low fault threshold buffer
Returns
status code
  • 0 success
  • 1 get low fault threshold failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 723 of file driver_max31865.c.

◆ max31865_get_reference_resistor()

uint8_t max31865_get_reference_resistor ( max31865_handle_t * handle,
float * value )

get the reference resistor

Parameters
[in]*handlepointer to a max31865 handle structure
[out]*valuepointer to a reference resistor buffer
Returns
status code
  • 0 success
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 409 of file driver_max31865.c.

◆ max31865_get_resistor()

uint8_t max31865_get_resistor ( max31865_handle_t * handle,
max31865_resistor_t * resistor )

get the pt resistor

Parameters
[in]*handlepointer to a max31865 handle structure
[out]*resistorpointer to a pt resistor type value buffer
Returns
status code
  • 0 success
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 461 of file driver_max31865.c.

◆ max31865_get_vbias()

uint8_t max31865_get_vbias ( max31865_handle_t * handle,
max31865_bool_t * enable )

get the chip vbias

Parameters
[in]*handlepointer to a max31865 handle structure
[out]*enablepointer to a bool value buffer
Returns
status code
  • 0 success
  • 1 get vbias failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 525 of file driver_max31865.c.

◆ max31865_get_wire()

uint8_t max31865_get_wire ( max31865_handle_t * handle,
max31865_wire_t * wire )

get the pt resistor wire

Parameters
[in]*handlepointer to a max31865 handle structure
[out]*wirepointer to a pt resistor wire type buffer
Returns
status code
  • 0 success
  • 1 get wire failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 347 of file driver_max31865.c.

◆ max31865_info()

uint8_t max31865_info ( max31865_info_t * info)

get chip's information

Parameters
[out]*infopointer to a max31865 info structure
Returns
status code
  • 0 success
  • 2 handle is NULL
Note
none

Definition at line 1119 of file driver_max31865.c.

◆ max31865_init()

uint8_t max31865_init ( max31865_handle_t * handle)

initialize the chip

Parameters
[in]*handlepointer to a max31865 handle structure
Returns
status code
  • 0 success
  • 1 spi initialization failed
  • 2 handle is NULL
  • 3 linked functions is NULL
Note
none

Definition at line 123 of file driver_max31865.c.

◆ max31865_set_fault_detection_cycle_control()

uint8_t max31865_set_fault_detection_cycle_control ( max31865_handle_t * handle,
max31865_fault_detection_cycle_control_t control )

set the fault detection cycle control

Parameters
[in]*handlepointer to a max31865 handle structure
[in]controlfault detection cycle
Returns
status code
  • 0 success
  • 1 set fault detection cycle control failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 761 of file driver_max31865.c.

◆ max31865_set_filter_select()

uint8_t max31865_set_filter_select ( max31865_handle_t * handle,
max31865_filter_select_t filter )

set the filter type

Parameters
[in]*handlepointer to a max31865 handle structure
[in]filterfilter type and it can be 50Hz or 60Hz
Returns
status code
  • 0 success
  • 1 set filter select failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 236 of file driver_max31865.c.

◆ max31865_set_high_fault_threshold()

uint8_t max31865_set_high_fault_threshold ( max31865_handle_t * handle,
uint16_t threshold )

set the high fault threshold

Parameters
[in]*handlepointer to a max31865 handle structure
[in]thresholdhigh fault threshold
Returns
status code
  • 0 success
  • 1 set high fault threshold failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 623 of file driver_max31865.c.

◆ max31865_set_low_fault_threshold()

uint8_t max31865_set_low_fault_threshold ( max31865_handle_t * handle,
uint16_t threshold )

set the low fault threshold

Parameters
[in]*handlepointer to a max31865 handle structure
[in]thresholdlow fault threshold
Returns
status code
  • 0 success
  • 1 set low fault threshold failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 692 of file driver_max31865.c.

◆ max31865_set_reference_resistor()

uint8_t max31865_set_reference_resistor ( max31865_handle_t * handle,
float value )

set the reference resistor

Parameters
[in]*handlepointer to a max31865 handle structure
[in]valuereference resistor value
Returns
status code
  • 0 success
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 383 of file driver_max31865.c.

◆ max31865_set_resistor()

uint8_t max31865_set_resistor ( max31865_handle_t * handle,
max31865_resistor_t resistor )

set the pt resistor

Parameters
[in]*handlepointer to a max31865 handle structure
[in]resistorpt resistor type value
Returns
status code
  • 0 success
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 435 of file driver_max31865.c.

◆ max31865_set_vbias()

uint8_t max31865_set_vbias ( max31865_handle_t * handle,
max31865_bool_t enable )

set the chip vbias

Parameters
[in]*handlepointer to a max31865 handle structure
[in]enablebool value
Returns
status code
  • 0 success
  • 1 set vbias failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 488 of file driver_max31865.c.

◆ max31865_set_wire()

uint8_t max31865_set_wire ( max31865_handle_t * handle,
max31865_wire_t wire )

set the pt resistor wire

Parameters
[in]*handlepointer to a max31865 handle structure
[in]wirept resistor wire and it can be 2, 3 or 4
Returns
status code
  • 0 success
  • 1 set wire failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 310 of file driver_max31865.c.

◆ max31865_single_read()

uint8_t max31865_single_read ( max31865_handle_t * handle,
uint16_t * raw,
float * temp )

read data once

Parameters
[in]*handlepointer to a max31865 handle structure
[out]*rawpointer to a raw temperature buffer
[out]*temppointer to a converted temperature buffer
Returns
status code
  • 0 success
  • 1 single read failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 find rtd fault
Note
none

Definition at line 837 of file driver_max31865.c.

◆ max31865_start_continuous_read()

uint8_t max31865_start_continuous_read ( max31865_handle_t * handle)

start reading

Parameters
[in]*handlepointer to a max31865 handle structure
Returns
status code
  • 0 success
  • 1 start failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 932 of file driver_max31865.c.

◆ max31865_stop_continuous_read()

uint8_t max31865_stop_continuous_read ( max31865_handle_t * handle)

stop reading

Parameters
[in]*handlepointer to a max31865 handle structure
Returns
status code
  • 0 success
  • 1 stop failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 971 of file driver_max31865.c.