LibDriver MAX31856
Loading...
Searching...
No Matches
max31856 base driver function

max31856 base driver modules More...

Collaboration diagram for max31856 base driver function:

Data Structures

struct  max31856_handle_s
 max31856 handle structure definition More...
struct  max31856_info_s
 max31856 information structure definition More...

Typedefs

typedef struct max31856_handle_s max31856_handle_t
 max31856 handle structure definition
typedef struct max31856_info_s max31856_info_t
 max31856 information structure definition

Enumerations

enum  max31856_bool_t { MAX31856_BOOL_FALSE = 0x00 , MAX31856_BOOL_TRUE = 0x01 }
 max31856 bool enumeration definition More...
enum  max31856_open_circuit_detection_t { MAX31856_OPEN_CIRCUIT_DETECTION_DISABLE = 0x00 , MAX31856_OPEN_CIRCUIT_DETECTION_MODE1 = 0x01 , MAX31856_OPEN_CIRCUIT_DETECTION_MODE2 = 0x02 , MAX31856_OPEN_CIRCUIT_DETECTION_MODE3 = 0x03 }
 max31856 open circuit detection enumeration definition More...
enum  max31856_fault_mode_t { MAX31856_FAULT_MODE_COMPARATOR = 0x00 , MAX31856_FAULT_MODE_INTERRUPT = 0x01 }
 max31856 fault mode enumeration definition More...
enum  max31856_noise_rejection_filter_t { MAX31856_NOISE_REJECTION_FILTER_60HZ = 0x00 , MAX31856_NOISE_REJECTION_FILTER_50HZ = 0x01 }
 max31856 noise rejection filter enumeration definition More...
enum  max31856_sample_average_t {
  MAX31856_SAMPLE_AVERAGE_1 = 0x00 , MAX31856_SAMPLE_AVERAGE_2 = 0x01 , MAX31856_SAMPLE_AVERAGE_4 = 0x02 , MAX31856_SAMPLE_AVERAGE_8 = 0x03 ,
  MAX31856_SAMPLE_AVERAGE_16 = 0x04
}
 max31856 sample average enumeration definition More...
enum  max31856_thermocouple_type_t {
  MAX31856_THERMOCOUPLE_TYPE_B = 0x00 , MAX31856_THERMOCOUPLE_TYPE_E = 0x01 , MAX31856_THERMOCOUPLE_TYPE_J = 0x02 , MAX31856_THERMOCOUPLE_TYPE_K = 0x03 ,
  MAX31856_THERMOCOUPLE_TYPE_N = 0x04 , MAX31856_THERMOCOUPLE_TYPE_R = 0x05 , MAX31856_THERMOCOUPLE_TYPE_S = 0x06 , MAX31856_THERMOCOUPLE_TYPE_T = 0x07 ,
  MAX31856_THERMOCOUPLE_TYPE_VOLTAGE_GAIN_8 = 0x08 , MAX31856_THERMOCOUPLE_TYPE_VOLTAGE_GAIN_32 = 0x0C
}
 max31856 thermocouple type enumeration definition More...
enum  max31856_fault_mask_t {
  MAX31856_FAULT_MASK_CJHIGH = 5 , MAX31856_FAULT_MASK_CJLOW = 4 , MAX31856_FAULT_MASK_TCHIGH = 3 , MAX31856_FAULT_MASK_TCLOW = 2 ,
  MAX31856_FAULT_MASK_OVUV = 1 , MAX31856_FAULT_MASK_OPEN = 0
}
 max31856 fault mask enumeration definition More...
enum  max31856_fault_status_t {
  MAX31856_FAULT_STATUS_CJRANGE = (1 << 7) , MAX31856_FAULT_STATUS_TCRANGE = (1 << 6) , MAX31856_FAULT_STATUS_CJHIGH = (1 << 5) , MAX31856_FAULT_STATUS_CJLOW = (1 << 4) ,
  MAX31856_FAULT_STATUS_TCHIGH = (1 << 3) , MAX31856_FAULT_STATUS_TCLOW = (1 << 2) , MAX31856_FAULT_STATUS_OVUV = (1 << 1) , MAX31856_FAULT_STATUS_OPEN = (1 << 0)
}
 max31856 fault status enumeration definition More...

Functions

uint8_t max31856_info (max31856_info_t *info)
 get chip's information
uint8_t max31856_irq_handler (max31856_handle_t *handle)
 irq handler
uint8_t max31856_init (max31856_handle_t *handle)
 initialize the chip
uint8_t max31856_deinit (max31856_handle_t *handle)
 close the chip
uint8_t max31856_single_read (max31856_handle_t *handle, int32_t *raw, double *deg)
 read data from the chip once
uint8_t max31856_continuous_read (max31856_handle_t *handle, int32_t *raw, double *deg)
 read data from the chip continuously
uint8_t max31856_start_continuous_read (max31856_handle_t *handle)
 start the chip reading
uint8_t max31856_stop_continuous_read (max31856_handle_t *handle)
 stop the chip reading
uint8_t max31856_read_cold_junction_temperature (max31856_handle_t *handle, int16_t *raw, double *deg)
 read cold junction temperature
uint8_t max31856_set_open_circuit_detection (max31856_handle_t *handle, max31856_open_circuit_detection_t detection)
 set open circuit detection
uint8_t max31856_get_open_circuit_detection (max31856_handle_t *handle, max31856_open_circuit_detection_t *detection)
 get open circuit detection
uint8_t max31856_set_cold_junction_sensor (max31856_handle_t *handle, max31856_bool_t enable)
 enable or disable cold junction sensor
uint8_t max31856_get_cold_junction_sensor (max31856_handle_t *handle, max31856_bool_t *enable)
 get cold junction sensor status
uint8_t max31856_set_fault_mode (max31856_handle_t *handle, max31856_fault_mode_t mode)
 set fault mode
uint8_t max31856_get_fault_mode (max31856_handle_t *handle, max31856_fault_mode_t *mode)
 get fault mode
uint8_t max31856_clear_fault (max31856_handle_t *handle)
 clear fault
uint8_t max31856_set_noise_rejection_filter (max31856_handle_t *handle, max31856_noise_rejection_filter_t filter)
 set noise rejection filter
uint8_t max31856_get_noise_rejection_filter (max31856_handle_t *handle, max31856_noise_rejection_filter_t *filter)
 get noise rejection filter
uint8_t max31856_set_sample_average (max31856_handle_t *handle, max31856_sample_average_t average)
 set sample average
uint8_t max31856_get_sample_average (max31856_handle_t *handle, max31856_sample_average_t *average)
 get sample average
uint8_t max31856_set_thermocouple_type (max31856_handle_t *handle, max31856_thermocouple_type_t type)
 set thermocouple type
uint8_t max31856_get_thermocouple_type (max31856_handle_t *handle, max31856_thermocouple_type_t *type)
 get thermocouple type
uint8_t max31856_set_fault_mask (max31856_handle_t *handle, max31856_fault_mask_t mask, max31856_bool_t enable)
 set fault mask
uint8_t max31856_get_fault_mask (max31856_handle_t *handle, max31856_fault_mask_t mask, max31856_bool_t *enable)
 get fault mask
uint8_t max31856_set_cold_junction_high_fault_threshold (max31856_handle_t *handle, int8_t threshold)
 set cold junction high fault threshold
uint8_t max31856_get_cold_junction_high_fault_threshold (max31856_handle_t *handle, int8_t *threshold)
 get cold junction high fault threshold
uint8_t max31856_set_cold_junction_low_fault_threshold (max31856_handle_t *handle, int8_t threshold)
 set cold junction low fault threshold
uint8_t max31856_get_cold_junction_low_fault_threshold (max31856_handle_t *handle, int8_t *threshold)
 get cold junction low fault threshold
uint8_t max31856_set_temperature_high_fault_threshold (max31856_handle_t *handle, int16_t threshold)
 set temperature high fault threshold
uint8_t max31856_get_temperature_high_fault_threshold (max31856_handle_t *handle, int16_t *threshold)
 get temperature high fault threshold
uint8_t max31856_set_temperature_low_fault_threshold (max31856_handle_t *handle, int16_t threshold)
 set temperature low fault threshold
uint8_t max31856_get_temperature_low_fault_threshold (max31856_handle_t *handle, int16_t *threshold)
 get temperature low fault threshold
uint8_t max31856_set_cold_junction_temperature_offset (max31856_handle_t *handle, int8_t offset)
 set cold junction temperature offset
uint8_t max31856_get_cold_junction_temperature_offset (max31856_handle_t *handle, int8_t *offset)
 get cold junction temperature offset
uint8_t max31856_set_cold_junction_temperature (max31856_handle_t *handle, int16_t temperature)
 set cold junction temperature
uint8_t max31856_get_cold_junction_temperature (max31856_handle_t *handle, int16_t *temperature)
 get cold junction temperature
uint8_t max31856_get_fault_status (max31856_handle_t *handle, uint8_t *status)
 get fault status
uint8_t max31856_cold_junction_fault_threshold_convert_to_register (max31856_handle_t *handle, float deg, int8_t *reg)
 convert the cold junction fault threshold to the register raw data
uint8_t max31856_cold_junction_fault_threshold_convert_to_data (max31856_handle_t *handle, int8_t reg, float *deg)
 convert the register raw data to the cold junction fault threshold
uint8_t max31856_temperature_fault_threshold_convert_to_register (max31856_handle_t *handle, float deg, int16_t *reg)
 convert the temperature fault threshold to the register raw data
uint8_t max31856_temperature_fault_threshold_convert_to_data (max31856_handle_t *handle, int16_t reg, float *deg)
 convert the register raw data to the temperature fault threshold
uint8_t max31856_cold_junction_temperature_offset_convert_to_register (max31856_handle_t *handle, float deg, int8_t *reg)
 convert the cold junction temperature offset to the register raw data
uint8_t max31856_cold_junction_temperature_offset_convert_to_data (max31856_handle_t *handle, int8_t reg, float *deg)
 convert the register raw data to the cold junction temperature offset
uint8_t max31856_cold_junction_temperature_convert_to_register (max31856_handle_t *handle, float deg, int16_t *reg)
 convert the cold junction temperature to the register raw data
uint8_t max31856_cold_junction_temperature_convert_to_data (max31856_handle_t *handle, int16_t reg, float *deg)
 convert the register raw data to the cold junction temperature

Detailed Description

max31856 base driver modules

Typedef Documentation

◆ max31856_handle_t

max31856 handle structure definition

◆ max31856_info_t

max31856 information structure definition

Enumeration Type Documentation

◆ max31856_bool_t

max31856 bool enumeration definition

Enumerator
MAX31856_BOOL_FALSE 

false

MAX31856_BOOL_TRUE 

true

Definition at line 62 of file driver_max31856.h.

◆ max31856_fault_mask_t

max31856 fault mask enumeration definition

Enumerator
MAX31856_FAULT_MASK_CJHIGH 

cold junction high fault threshold mask

MAX31856_FAULT_MASK_CJLOW 

cold junction low fault threshold mask

MAX31856_FAULT_MASK_TCHIGH 

thermocouple temperature high fault threshold mask

MAX31856_FAULT_MASK_TCLOW 

thermocouple temperature low fault threshold mask

MAX31856_FAULT_MASK_OVUV 

over voltage or undervoltage input fault mask

MAX31856_FAULT_MASK_OPEN 

thermocouple open circuit fault mask

Definition at line 129 of file driver_max31856.h.

◆ max31856_fault_mode_t

max31856 fault mode enumeration definition

Enumerator
MAX31856_FAULT_MODE_COMPARATOR 

comparator mode

MAX31856_FAULT_MODE_INTERRUPT 

interrupt mode

Definition at line 82 of file driver_max31856.h.

◆ max31856_fault_status_t

max31856 fault status enumeration definition

Enumerator
MAX31856_FAULT_STATUS_CJRANGE 

cold junction out of range

MAX31856_FAULT_STATUS_TCRANGE 

thermocouple out of range

MAX31856_FAULT_STATUS_CJHIGH 

cold junction high fault

MAX31856_FAULT_STATUS_CJLOW 

cold junction low fault

MAX31856_FAULT_STATUS_TCHIGH 

thermocouple temperature high fault

MAX31856_FAULT_STATUS_TCLOW 

thermocouple temperature low fault

MAX31856_FAULT_STATUS_OVUV 

overvoltage or undervoltage input fault

MAX31856_FAULT_STATUS_OPEN 

thermocouple open circuit fault

Definition at line 142 of file driver_max31856.h.

◆ max31856_noise_rejection_filter_t

max31856 noise rejection filter enumeration definition

Enumerator
MAX31856_NOISE_REJECTION_FILTER_60HZ 

60hz

MAX31856_NOISE_REJECTION_FILTER_50HZ 

50hz

Definition at line 91 of file driver_max31856.h.

◆ max31856_open_circuit_detection_t

max31856 open circuit detection enumeration definition

Enumerator
MAX31856_OPEN_CIRCUIT_DETECTION_DISABLE 

disable

MAX31856_OPEN_CIRCUIT_DETECTION_MODE1 

13.3ms / 40ms

MAX31856_OPEN_CIRCUIT_DETECTION_MODE2 

33.4ms / 60ms

MAX31856_OPEN_CIRCUIT_DETECTION_MODE3 

113.4ms / 140ms

Definition at line 71 of file driver_max31856.h.

◆ max31856_sample_average_t

max31856 sample average enumeration definition

Enumerator
MAX31856_SAMPLE_AVERAGE_1 

1 sample

MAX31856_SAMPLE_AVERAGE_2 

2 samples

MAX31856_SAMPLE_AVERAGE_4 

4 samples

MAX31856_SAMPLE_AVERAGE_8 

8 samples

MAX31856_SAMPLE_AVERAGE_16 

16 samples

Definition at line 100 of file driver_max31856.h.

◆ max31856_thermocouple_type_t

max31856 thermocouple type enumeration definition

Enumerator
MAX31856_THERMOCOUPLE_TYPE_B 

b type

MAX31856_THERMOCOUPLE_TYPE_E 

e type

MAX31856_THERMOCOUPLE_TYPE_J 

j type

MAX31856_THERMOCOUPLE_TYPE_K 

k type

MAX31856_THERMOCOUPLE_TYPE_N 

n type

MAX31856_THERMOCOUPLE_TYPE_R 

r type

MAX31856_THERMOCOUPLE_TYPE_S 

s type

MAX31856_THERMOCOUPLE_TYPE_T 

t type

MAX31856_THERMOCOUPLE_TYPE_VOLTAGE_GAIN_8 

8 * 1.6 * 2^17 * vin

MAX31856_THERMOCOUPLE_TYPE_VOLTAGE_GAIN_32 

32 * 1.6 * 2^17 * vin

Definition at line 112 of file driver_max31856.h.

Function Documentation

◆ max31856_clear_fault()

uint8_t max31856_clear_fault ( max31856_handle_t * handle)

clear fault

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

Definition at line 836 of file driver_max31856.c.

◆ max31856_cold_junction_fault_threshold_convert_to_data()

uint8_t max31856_cold_junction_fault_threshold_convert_to_data ( max31856_handle_t * handle,
int8_t reg,
float * deg )

convert the register raw data to the cold junction fault threshold

Parameters
[in]*handlepointer to a max31856 handle structure
[in]regregister raw data
[out]*degpointer to a degrees celsius buffer
Returns
status code
  • 0 success
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1722 of file driver_max31856.c.

◆ max31856_cold_junction_fault_threshold_convert_to_register()

uint8_t max31856_cold_junction_fault_threshold_convert_to_register ( max31856_handle_t * handle,
float deg,
int8_t * reg )

convert the cold junction fault threshold to the register raw data

Parameters
[in]*handlepointer to a max31856 handle structure
[in]degdegrees celsius
[out]*regpointer to a register raw buffer
Returns
status code
  • 0 success
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1695 of file driver_max31856.c.

◆ max31856_cold_junction_temperature_convert_to_data()

uint8_t max31856_cold_junction_temperature_convert_to_data ( max31856_handle_t * handle,
int16_t reg,
float * deg )

convert the register raw data to the cold junction temperature

Parameters
[in]*handlepointer to a max31856 handle structure
[in]regregister raw data
[out]*degpointer to a degrees celsius buffer
Returns
status code
  • 0 success
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1884 of file driver_max31856.c.

◆ max31856_cold_junction_temperature_convert_to_register()

uint8_t max31856_cold_junction_temperature_convert_to_register ( max31856_handle_t * handle,
float deg,
int16_t * reg )

convert the cold junction temperature to the register raw data

Parameters
[in]*handlepointer to a max31856 handle structure
[in]degdegrees celsius
[out]*regpointer to a register raw buffer
Returns
status code
  • 0 success
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1857 of file driver_max31856.c.

◆ max31856_cold_junction_temperature_offset_convert_to_data()

uint8_t max31856_cold_junction_temperature_offset_convert_to_data ( max31856_handle_t * handle,
int8_t reg,
float * deg )

convert the register raw data to the cold junction temperature offset

Parameters
[in]*handlepointer to a max31856 handle structure
[in]regregister raw data
[out]*degpointer to a degrees celsius buffer
Returns
status code
  • 0 success
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1830 of file driver_max31856.c.

◆ max31856_cold_junction_temperature_offset_convert_to_register()

uint8_t max31856_cold_junction_temperature_offset_convert_to_register ( max31856_handle_t * handle,
float deg,
int8_t * reg )

convert the cold junction temperature offset to the register raw data

Parameters
[in]*handlepointer to a max31856 handle structure
[in]degdegrees celsius
[out]*regpointer to a register raw buffer
Returns
status code
  • 0 success
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1803 of file driver_max31856.c.

◆ max31856_continuous_read()

uint8_t max31856_continuous_read ( max31856_handle_t * handle,
int32_t * raw,
double * deg )

read data from the chip continuously

Parameters
[in]*handlepointer to a max31856 handle structure
[out]*rawpointer to a raw adc buffer
[out]*degpointer to a converted temperature buffer
Returns
status code
  • 0 success
  • 1 continuous read failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 open circuit fault
  • 5 overvoltage or undervoltage input fault
  • 6 thermocouple out of range
  • 7 cold junction out of range
Note
this function can be used only after run max31856_start_continuous_read and can be stopped by max31856_stop_continuous_read

Definition at line 378 of file driver_max31856.c.

◆ max31856_deinit()

uint8_t max31856_deinit ( max31856_handle_t * handle)

close the chip

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

Definition at line 193 of file driver_max31856.c.

◆ max31856_get_cold_junction_high_fault_threshold()

uint8_t max31856_get_cold_junction_high_fault_threshold ( max31856_handle_t * handle,
int8_t * threshold )

get cold junction high fault threshold

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

Definition at line 1248 of file driver_max31856.c.

◆ max31856_get_cold_junction_low_fault_threshold()

uint8_t max31856_get_cold_junction_low_fault_threshold ( max31856_handle_t * handle,
int8_t * threshold )

get cold junction low fault threshold

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

Definition at line 1322 of file driver_max31856.c.

◆ max31856_get_cold_junction_sensor()

uint8_t max31856_get_cold_junction_sensor ( max31856_handle_t * handle,
max31856_bool_t * enable )

get cold junction sensor status

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

Definition at line 718 of file driver_max31856.c.

◆ max31856_get_cold_junction_temperature()

uint8_t max31856_get_cold_junction_temperature ( max31856_handle_t * handle,
int16_t * temperature )

get cold junction temperature

Parameters
[in]*handlepointer to a max31856 handle structure
[out]*temperaturepointer to a temperature buffer
Returns
status code
  • 0 success
  • 1 get cold junction temperature failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1621 of file driver_max31856.c.

◆ max31856_get_cold_junction_temperature_offset()

uint8_t max31856_get_cold_junction_temperature_offset ( max31856_handle_t * handle,
int8_t * offset )

get cold junction temperature offset

Parameters
[in]*handlepointer to a max31856 handle structure
[out]*offsetpointer to a temperature offset buffer
Returns
status code
  • 0 success
  • 1 get cold junction temperature offset failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1546 of file driver_max31856.c.

◆ max31856_get_fault_mask()

uint8_t max31856_get_fault_mask ( max31856_handle_t * handle,
max31856_fault_mask_t mask,
max31856_bool_t * enable )

get fault mask

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

Definition at line 1174 of file driver_max31856.c.

◆ max31856_get_fault_mode()

uint8_t max31856_get_fault_mode ( max31856_handle_t * handle,
max31856_fault_mode_t * mode )

get fault mode

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

Definition at line 800 of file driver_max31856.c.

◆ max31856_get_fault_status()

uint8_t max31856_get_fault_status ( max31856_handle_t * handle,
uint8_t * status )

get fault status

Parameters
[in]*handlepointer to a max31856 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 1658 of file driver_max31856.c.

◆ max31856_get_noise_rejection_filter()

uint8_t max31856_get_noise_rejection_filter ( max31856_handle_t * handle,
max31856_noise_rejection_filter_t * filter )

get noise rejection filter

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

Definition at line 926 of file driver_max31856.c.

◆ max31856_get_open_circuit_detection()

uint8_t max31856_get_open_circuit_detection ( max31856_handle_t * handle,
max31856_open_circuit_detection_t * detection )

get open circuit detection

Parameters
[in]*handlepointer to a max31856 handle structure
[out]*detectionpointer to an open circuit detection buffer
Returns
status code
  • 0 success
  • 1 get open circuit detection failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 636 of file driver_max31856.c.

◆ max31856_get_sample_average()

uint8_t max31856_get_sample_average ( max31856_handle_t * handle,
max31856_sample_average_t * average )

get sample average

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

Definition at line 1008 of file driver_max31856.c.

◆ max31856_get_temperature_high_fault_threshold()

uint8_t max31856_get_temperature_high_fault_threshold ( max31856_handle_t * handle,
int16_t * threshold )

get temperature high fault threshold

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

Definition at line 1397 of file driver_max31856.c.

◆ max31856_get_temperature_low_fault_threshold()

uint8_t max31856_get_temperature_low_fault_threshold ( max31856_handle_t * handle,
int16_t * threshold )

get temperature low fault threshold

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

Definition at line 1472 of file driver_max31856.c.

◆ max31856_get_thermocouple_type()

uint8_t max31856_get_thermocouple_type ( max31856_handle_t * handle,
max31856_thermocouple_type_t * type )

get thermocouple type

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

Definition at line 1090 of file driver_max31856.c.

◆ max31856_info()

uint8_t max31856_info ( max31856_info_t * info)

get chip's information

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

Definition at line 2073 of file driver_max31856.c.

◆ max31856_init()

uint8_t max31856_init ( max31856_handle_t * handle)

initialize the chip

Parameters
[in]*handlepointer to a max31856 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_max31856.c.

◆ max31856_irq_handler()

uint8_t max31856_irq_handler ( max31856_handle_t * handle)

irq handler

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

Definition at line 1910 of file driver_max31856.c.

◆ max31856_read_cold_junction_temperature()

uint8_t max31856_read_cold_junction_temperature ( max31856_handle_t * handle,
int16_t * raw,
double * deg )

read cold junction temperature

Parameters
[in]*handlepointer to a max31856 handle structure
[out]*rawpointer to a raw adc buffer
[out]*degpointer to a converted temperature buffer
Returns
status code
  • 0 success
  • 1 read cold junction temperature failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 546 of file driver_max31856.c.

◆ max31856_set_cold_junction_high_fault_threshold()

uint8_t max31856_set_cold_junction_high_fault_threshold ( max31856_handle_t * handle,
int8_t threshold )

set cold junction high fault threshold

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

Definition at line 1211 of file driver_max31856.c.

◆ max31856_set_cold_junction_low_fault_threshold()

uint8_t max31856_set_cold_junction_low_fault_threshold ( max31856_handle_t * handle,
int8_t threshold )

set cold junction low fault threshold

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

Definition at line 1285 of file driver_max31856.c.

◆ max31856_set_cold_junction_sensor()

uint8_t max31856_set_cold_junction_sensor ( max31856_handle_t * handle,
max31856_bool_t enable )

enable or disable cold junction sensor

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

Definition at line 673 of file driver_max31856.c.

◆ max31856_set_cold_junction_temperature()

uint8_t max31856_set_cold_junction_temperature ( max31856_handle_t * handle,
int16_t temperature )

set cold junction temperature

Parameters
[in]*handlepointer to a max31856 handle structure
[in]temperatureinput temperature
Returns
status code
  • 0 success
  • 1 set cold junction temperature failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1583 of file driver_max31856.c.

◆ max31856_set_cold_junction_temperature_offset()

uint8_t max31856_set_cold_junction_temperature_offset ( max31856_handle_t * handle,
int8_t offset )

set cold junction temperature offset

Parameters
[in]*handlepointer to a max31856 handle structure
[in]offsettemperature offset
Returns
status code
  • 0 success
  • 1 set cold junction temperature offset failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1509 of file driver_max31856.c.

◆ max31856_set_fault_mask()

uint8_t max31856_set_fault_mask ( max31856_handle_t * handle,
max31856_fault_mask_t mask,
max31856_bool_t enable )

set fault mask

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

Definition at line 1128 of file driver_max31856.c.

◆ max31856_set_fault_mode()

uint8_t max31856_set_fault_mode ( max31856_handle_t * handle,
max31856_fault_mode_t mode )

set fault mode

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

Definition at line 755 of file driver_max31856.c.

◆ max31856_set_noise_rejection_filter()

uint8_t max31856_set_noise_rejection_filter ( max31856_handle_t * handle,
max31856_noise_rejection_filter_t filter )

set noise rejection filter

Parameters
[in]*handlepointer to a max31856 handle structure
[in]filternoise rejection filter
Returns
status code
  • 0 success
  • 1 set noise rejection filter failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 881 of file driver_max31856.c.

◆ max31856_set_open_circuit_detection()

uint8_t max31856_set_open_circuit_detection ( max31856_handle_t * handle,
max31856_open_circuit_detection_t detection )

set open circuit detection

Parameters
[in]*handlepointer to a max31856 handle structure
[in]detectionopen circuit detection
Returns
status code
  • 0 success
  • 1 set open circuit detection failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 591 of file driver_max31856.c.

◆ max31856_set_sample_average()

uint8_t max31856_set_sample_average ( max31856_handle_t * handle,
max31856_sample_average_t average )

set sample average

Parameters
[in]*handlepointer to a max31856 handle structure
[in]averagesample average
Returns
status code
  • 0 success
  • 1 set sample average failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 963 of file driver_max31856.c.

◆ max31856_set_temperature_high_fault_threshold()

uint8_t max31856_set_temperature_high_fault_threshold ( max31856_handle_t * handle,
int16_t threshold )

set temperature high fault threshold

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

Definition at line 1359 of file driver_max31856.c.

◆ max31856_set_temperature_low_fault_threshold()

uint8_t max31856_set_temperature_low_fault_threshold ( max31856_handle_t * handle,
int16_t threshold )

set temperature low fault threshold

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

Definition at line 1434 of file driver_max31856.c.

◆ max31856_set_thermocouple_type()

uint8_t max31856_set_thermocouple_type ( max31856_handle_t * handle,
max31856_thermocouple_type_t type )

set thermocouple type

Parameters
[in]*handlepointer to a max31856 handle structure
[in]typethermocouple type
Returns
status code
  • 0 success
  • 1 set thermocouple type failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1045 of file driver_max31856.c.

◆ max31856_single_read()

uint8_t max31856_single_read ( max31856_handle_t * handle,
int32_t * raw,
double * deg )

read data from the chip once

Parameters
[in]*handlepointer to a max31856 handle structure
[out]*rawpointer to a raw adc buffer
[out]*degpointer to a converted temperature buffer
Returns
status code
  • 0 success
  • 1 single read failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 read timeout
  • 5 open circuit fault
  • 6 overvoltage or undervoltage input fault
  • 7 thermocouple out of range
  • 8 cold junction out of range
Note
none

Definition at line 252 of file driver_max31856.c.

◆ max31856_start_continuous_read()

uint8_t max31856_start_continuous_read ( max31856_handle_t * handle)

start the chip reading

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

Definition at line 455 of file driver_max31856.c.

◆ max31856_stop_continuous_read()

uint8_t max31856_stop_continuous_read ( max31856_handle_t * handle)

stop the chip reading

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

Definition at line 500 of file driver_max31856.c.

◆ max31856_temperature_fault_threshold_convert_to_data()

uint8_t max31856_temperature_fault_threshold_convert_to_data ( max31856_handle_t * handle,
int16_t reg,
float * deg )

convert the register raw data to the temperature fault threshold

Parameters
[in]*handlepointer to a max31856 handle structure
[in]regregister raw data
[out]*degpointer to a degrees celsius buffer
Returns
status code
  • 0 success
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1776 of file driver_max31856.c.

◆ max31856_temperature_fault_threshold_convert_to_register()

uint8_t max31856_temperature_fault_threshold_convert_to_register ( max31856_handle_t * handle,
float deg,
int16_t * reg )

convert the temperature fault threshold to the register raw data

Parameters
[in]*handlepointer to a max31856 handle structure
[in]degdegrees celsius
[out]*regpointer to a register raw buffer
Returns
status code
  • 0 success
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1749 of file driver_max31856.c.