LibDriver MAX31865
Loading...
Searching...
No Matches
driver_max31865.h File Reference

driver max31865 header file More...

#include <math.h>
#include <stdio.h>
#include <stdint.h>
#include <string.h>
Include dependency graph for driver_max31865.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

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

Macros

#define DRIVER_MAX31865_LINK_INIT(HANDLE, STRUCTURE)
 initialize max31865_handle_t structure
#define DRIVER_MAX31865_LINK_SPI_INIT(HANDLE, FUC)
 link spi_init function
#define DRIVER_MAX31865_LINK_SPI_DEINIT(HANDLE, FUC)
 link spi_deinit function
#define DRIVER_MAX31865_LINK_SPI_READ(HANDLE, FUC)
 link spi_read function
#define DRIVER_MAX31865_LINK_SPI_WRITE(HANDLE, FUC)
 link spi_write function
#define DRIVER_MAX31865_LINK_DELAY_MS(HANDLE, FUC)
 link delay_ms function
#define DRIVER_MAX31865_LINK_DEBUG_PRINT(HANDLE, FUC)
 link debug_print function

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
uint8_t max31865_set_reg (max31865_handle_t *handle, uint8_t reg, uint8_t value)
 set the chip register
uint8_t max31865_get_reg (max31865_handle_t *handle, uint8_t reg, uint8_t *value)
 get the chip register

Detailed Description

driver max31865 header file

Copyright (c) 2015 - present LibDriver All rights reserved

The MIT License (MIT)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Version
2.0.0
Author
Shifeng Li
Date
2021-02-22

history

Date Version Author Description
2021/02/22 2.0 Shifeng Li format the code
2020/10/17 1.0 Shifeng Li first upload

Definition in file driver_max31865.h.