no-OS
All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
max31855.h
Go to the documentation of this file.
1/***************************************************************************/
33
34#ifndef __MAX31855_H__
35#define __MAX31855_H__
36
37#include <stdint.h>
38#include "no_os_spi.h"
39#include "no_os_util.h"
40
41#define MAX31855_GET_INTERNAL_TEMP(x) (no_os_field_get(NO_OS_GENMASK(15, 4), x))
42#define MAX31855_GET_FAULT_BIT(x) (no_os_field_get(NO_OS_BIT(16), x))
43#define MAX31855_GET_THERMOCOUPLE_TEMP(x) (no_os_field_get(NO_OS_GENMASK(31, 18), x))
44#define MAX31855_GET_FAULTS(x) (no_os_field_get(NO_OS_GENMASK(2, 0), x))
45
50#define MAX31855_THERMOCOUPLE_TEMP_DEC_DIV 4
51#define MAX31855_INTERNAL_TEMP_DEC_DIV 16
52
54#define MAX31855_THERMOCOUPLE_TEMP_SIGN_POS 13
55#define MAX31855_INTERNAL_TEMP_SIGN_POS 11
56
63
68 int32_t integer;
69 int32_t decimal;
70};
71
74 uint8_t SCV: 1;
76 uint8_t SCG: 1;
78 uint8_t OC: 1;
79};
80
85
93
95int max31855_init(struct max31855_dev **, struct max31855_init_param *);
96
98int max31855_remove(struct max31855_dev *);
99
101int max31855_read_raw(struct max31855_dev *, uint32_t *);
102
105 struct max31855_decimal *);
106
107#endif
int max31855_remove(struct max31855_dev *)
Remove resources allocated by the init function.
Definition max31855.c:77
int max31855_init(struct max31855_dev **, struct max31855_init_param *)
Device and comm init function.
Definition max31855.c:50
int max31855_read_raw(struct max31855_dev *, uint32_t *)
Read raw register value.
Definition max31855.c:98
int max31855_read_temp(struct max31855_dev *, struct max31855_decimal *, struct max31855_decimal *)
Read thermocouple and internal temperatures (converted in deg. C)
Definition max31855.c:124
Header file of SPI Interface.
Header file of utility functions.
Definition max31855.h:72
uint8_t SCG
Definition max31855.h:76
uint8_t SCV
Definition max31855.h:74
uint8_t OC
Definition max31855.h:78
interger/decimal format used for temperature representation
Definition max31855.h:67
int32_t integer
Definition max31855.h:68
int32_t decimal
Definition max31855.h:69
MAX31855 descriptor.
Definition max31855.h:89
union max31855_fault_sts fault
Definition max31855.h:91
struct no_os_spi_desc * comm_desc
Definition max31855.h:90
MAX31855 comm init param.
Definition max31855.h:60
struct no_os_spi_init_param spi_init
Definition max31855.h:61
Structure holding SPI descriptor.
Definition no_os_spi.h:180
Structure holding the parameters for SPI initialization.
Definition no_os_spi.h:128
Definition max31855.h:81
struct _max31855_fault_sts_mask fields
Definition max31855.h:82
uint8_t value
Definition max31855.h:83