Go to the documentation of this file.
35 #ifndef __MAX31865_H__
36 #define __MAX31865_H__
49 #define MAX31865_READ_MASK 0x7F
50 #define MAX31865_WRITE_MASK 0x80
52 #define MAX31865_CONFIG_BIAS 0x80
53 #define MAX31865_CONFIG_MODEAUTO 0x40
54 #define MAX31865_CONFIG_MODEOFF 0xBF
55 #define MAX31865_CONFIG_1SHOT 0x20
56 #define MAX31865_CONFIG_3WIRE 0x10
57 #define MAX31865_CONFIG_2_4WIRE 0xEF
58 #define MAX31865_CONFIG_CLRFAULT_MASK 0xD3
59 #define MAX31865_CONFIG_FAULTSTAT 0x02
60 #define MAX31865_CONFIG_FILT50HZ 0x01
61 #define MAX31865_CONFIG_FILT60HZ 0xFE
63 #define MAX31865_CONFIG_REG 0x00
64 #define MAX31865_RTDMSB_REG 0x01
65 #define MAX31865_RTDLSB_REG 0x02
66 #define MAX31865_HFAULTMSB_REG 0x03
67 #define MAX31865_HFAULTLSB_REG 0x04
68 #define MAX31865_LFAULTMSB_REG 0x05
69 #define MAX31865_LFAULTLSB_REG 0x06
70 #define MAX31865_FAULTSTAT_REG 0x07
137 #endif // __MAX31865_H__
int max31865_read_fault(struct max31865_dev *, uint8_t *)
#define MAX31865_CONFIG_3WIRE
Definition: max31865.h:56
int max31865_set_threshold(struct max31865_dev *device, uint16_t lower, uint16_t upper)
Update the contents of the HIGH and LOW FAULT registers of max31865.
Definition: max31865.c:287
#define MAX31865_CONFIG_MODEAUTO
Definition: max31865.h:53
#define MAX31865_CONFIG_CLRFAULT_MASK
Definition: max31865.h:58
int max31865_get_lower_threshold(struct max31865_dev *, uint16_t *)
Read the raw 16-bit lower threshold value.
Definition: max31865.c:321
int max31865_clear_fault(struct max31865_dev *device)
Clear all faults in FAULTSTAT.
Definition: max31865.c:217
Header file of SPI Interface.
int max31865_set_threshold(struct max31865_dev *, uint16_t, uint16_t)
Update the contents of the HIGH and LOW FAULT registers of max31865.
Definition: max31865.c:287
int max31865_enable_bias(struct max31865_dev *device, bool bias_en)
Enable the bias voltage on the RTD sensor.
Definition: max31865.c:236
#define MAX31865_CONFIG_FILT50HZ
Definition: max31865.h:60
Definition: no_os_spi.h:100
int max31865_init(struct max31865_dev **device, struct max31865_init_param *init_param)
Device and comm init function.
Definition: max31865.c:59
Header file of Delay functions.
Structure holding max31865 descriptor.
Definition: max31865.h:76
int max31865_enable_bias(struct max31865_dev *, bool)
Enable the bias voltage on the RTD sensor.
Definition: max31865.c:236
bool is_filt_50
Definition: max31865.h:78
#define MAX31865_RTDLSB_REG
Definition: max31865.h:65
float rtd_rc
Definition: max31865.h:89
#define MAX31865_CONFIG_BIAS
Definition: max31865.h:52
Definition: ad9361_util.h:69
#define MAX31865_LFAULTMSB_REG
Definition: max31865.h:68
void * no_os_calloc(size_t nitems, size_t size)
Allocate memory and return a pointer to it, set memory to 0.
Definition: chibios_alloc.c:54
int max31865_read(struct max31865_dev *device, uint8_t reg_addr, uint8_t *reg_data)
Read raw register value.
Definition: max31865.c:149
#define MAX31865_READ_MASK
Definition: max31865.h:49
#define MAX31865_CONFIG_FAULTSTAT
Definition: max31865.h:59
#define MAX31865_CONFIG_MODEOFF
Definition: max31865.h:54
int max31865_remove(struct max31865_dev *)
Remove resources allocated by the init function.
Definition: max31865.c:100
int max31865_read(struct max31865_dev *, uint8_t, uint8_t *)
Read raw register value.
Definition: max31865.c:149
int max31865_enable_50Hz(struct max31865_dev *device, bool filt_en)
Option for 50Hz or 60Hz noise filters.
Definition: max31865.c:268
int max31865_get_upper_threshold(struct max31865_dev *device, uint16_t *up_threshold)
Read the raw 16-bit upper threshold value.
Definition: max31865.c:347
uint8_t * rx_buff
Definition: no_os_spi.h:104
int max31865_write(struct max31865_dev *, uint8_t, uint8_t)
Write raw register value.
Definition: max31865.c:186
int max31865_reg_update(struct max31865_dev *, uint8_t, uint8_t, bool)
update register contents
Definition: max31865.c:124
int max31865_enable_50Hz(struct max31865_dev *, bool)
Option for 50Hz or 60Hz noise filters.
Definition: max31865.c:268
int max31865_auto_convert(struct max31865_dev *device, bool auto_conv_en)
Option for continuous conversions between 50/60 Hz.
Definition: max31865.c:252
struct no_os_spi_desc * comm_desc
Definition: max31865.h:77
#define MAX31865_CONFIG_2_4WIRE
Definition: max31865.h:57
Header File of MAX31865 Driver.
struct no_os_spi_init_param spi_init
Definition: max31865.h:88
Structure holding SPI descriptor.
Definition: no_os_spi.h:192
Structure holding the parameters for max31865 initialization.
Definition: max31865.h:87
int max31865_clear_fault(struct max31865_dev *)
Clear all faults in FAULTSTAT.
Definition: max31865.c:217
#define MAX31865_WRITE_MASK
Definition: max31865.h:50
int max31865_reg_update(struct max31865_dev *device, uint8_t reg_addr, uint8_t reg_update, bool or_mask)
update register contents
Definition: max31865.c:124
int max31865_set_wires(struct max31865_dev *, bool)
N-wire option for RTD measurement setup.
Definition: max31865.c:373
int32_t no_os_spi_transfer(struct no_os_spi_desc *desc, struct no_os_spi_msg *msgs, uint32_t len)
Iterate over head list and send all spi messages.
Definition: no_os_spi.c:185
int max31865_remove(struct max31865_dev *device)
Remove resources allocated by the init function.
Definition: max31865.c:100
uint32_t no_os_field_get(uint32_t mask, uint32_t word)
#define MAX31865_HFAULTMSB_REG
Definition: max31865.h:66
bool is_odd_wire
Definition: max31865.h:79
void no_os_free(void *ptr)
Deallocate memory previously allocated by a call to no_os_calloc or no_os_malloc.
Definition: chibios_alloc.c:69
#define MAX31865_CONFIG_REG
Definition: max31865.h:63
void no_os_udelay(uint32_t usecs)
Wait until usecs microseconds passed.
Definition: aducm3029_delay.c:114
struct ad7616_init_param init_param
Definition: ad7616_sdz.c:113
#define MAX31865_FAULTSTAT_REG
Definition: max31865.h:70
int max31865_init(struct max31865_dev **, struct max31865_init_param *)
Device and comm init function.
Definition: max31865.c:59
int max31865_set_wires(struct max31865_dev *device, bool is_odd_wire)
N-wire option for RTD measurement setup.
Definition: max31865.c:373
#define MAX31865_LFAULTLSB_REG
Definition: max31865.h:69
int32_t no_os_spi_remove(struct no_os_spi_desc *desc)
Free the resources allocated by no_os_spi_init().
Definition: no_os_spi.c:116
#define MAX31865_CONFIG_1SHOT
Definition: max31865.h:55
int max31865_get_lower_threshold(struct max31865_dev *device, uint16_t *low_threshold)
Read the raw 16-bit lower threshold value.
Definition: max31865.c:321
#define MAX31865_CONFIG_FILT60HZ
Definition: max31865.h:61
int max31865_read_rtd(struct max31865_dev *device, uint16_t *rtd_reg)
Read the raw 16-bit value from the RTD_REG in one shot mode.
Definition: max31865.c:391
int t_rc_delay
Definition: max31865.h:80
int32_t no_os_spi_init(struct no_os_spi_desc **desc, const struct no_os_spi_init_param *param)
Initialize the SPI communication peripheral.
Definition: no_os_spi.c:52
#define MAX31865_RTDMSB_REG
Definition: max31865.h:64
int max31865_read_rtd(struct max31865_dev *, uint16_t *)
Read the raw 16-bit value from the RTD_REG in one shot mode.
Definition: max31865.c:391
Header file of utility functions.
int max31865_auto_convert(struct max31865_dev *, bool)
Option for continuous conversions between 50/60 Hz.
Definition: max31865.c:252
int max31865_write(struct max31865_dev *device, uint8_t reg_addr, uint8_t reg_data)
Write raw register value.
Definition: max31865.c:186
int max31865_get_upper_threshold(struct max31865_dev *, uint16_t *)
Read the raw 16-bit upper threshold value.
Definition: max31865.c:347
Error macro definition for ARM Compiler.
#define MAX31865_HFAULTLSB_REG
Definition: max31865.h:67
Structure holding the parameters for SPI initialization.
Definition: no_os_spi.h:140