Go to the documentation of this file.
34 #ifndef __MAX31855_H__
35 #define __MAX31855_H__
49 #define MAX31855_GET_INTERNAL_TEMP(x) (no_os_field_get(NO_OS_GENMASK(15, 4), x))
50 #define MAX31855_GET_FAULT_BIT(x) (no_os_field_get(NO_OS_BIT(16), x))
51 #define MAX31855_GET_THERMOCOUPLE_TEMP(x) (no_os_field_get(NO_OS_GENMASK(31, 18), x))
52 #define MAX31855_GET_FAULTS(x) (no_os_field_get(NO_OS_GENMASK(2, 0), x))
58 #define MAX31855_THERMOCOUPLE_TEMP_DEC_DIV 4
59 #define MAX31855_INTERNAL_TEMP_DEC_DIV 16
62 #define MAX31855_THERMOCOUPLE_TEMP_SIGN_POS 13
63 #define MAX31855_INTERNAL_TEMP_SIGN_POS 11
int64_t no_os_div_s64_rem(int64_t dividend, int32_t divisor, int32_t *remainder)
int32_t no_os_spi_write_and_read(struct no_os_spi_desc *desc, uint8_t *data, uint16_t bytes_number)
Write and read data to/from SPI.
Definition: no_os_spi.c:159
Header file of SPI Interface.
#define MAX31855_THERMOCOUPLE_TEMP_DEC_DIV
Definition: max31855.h:58
struct no_os_spi_desc * comm_desc
Definition: max31855.h:98
#define MAX31855_GET_FAULT_BIT(x)
Definition: max31855.h:50
uint8_t OC
Definition: max31855.h:86
Definition: ad9361_util.h:69
Definition: max31855.h:89
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
int32_t integer
Definition: max31855.h:76
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:131
MAX31855 descriptor.
Definition: max31855.h:97
struct _max31855_fault_sts_mask fields
Definition: max31855.h:90
int max31855_read_raw(struct max31855_dev *device, uint32_t *val)
Read raw register value.
Definition: max31855.c:105
#define MAX31855_GET_INTERNAL_TEMP(x)
Definition: max31855.h:49
union max31855_fault_sts fault
Definition: max31855.h:99
#define MAX31855_GET_THERMOCOUPLE_TEMP(x)
Definition: max31855.h:51
Structure holding SPI descriptor.
Definition: no_os_spi.h:192
int max31855_init(struct max31855_dev **, struct max31855_init_param *)
Device and comm init function.
Definition: max31855.c:57
MAX31855 comm init param.
Definition: max31855.h:68
int max31855_read_raw(struct max31855_dev *, uint32_t *)
Read raw register value.
Definition: max31855.c:105
int32_t decimal
Definition: max31855.h:77
interger/decimal format used for temperature representation
Definition: max31855.h:75
#define MAX31855_THERMOCOUPLE_TEMP_SIGN_POS
Definition: max31855.h:62
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
int max31855_remove(struct max31855_dev *)
Remove resources allocated by the init function.
Definition: max31855.c:84
Definition: max31855.h:80
struct no_os_spi_init_param spi_init
Definition: max31855.h:69
uint32_t no_os_get_unaligned_be32(uint8_t *buf)
struct ad7616_init_param init_param
Definition: ad7616_sdz.c:113
#define MAX31855_INTERNAL_TEMP_DEC_DIV
Definition: max31855.h:59
#define MAX31855_GET_FAULTS(x)
Definition: max31855.h:52
uint8_t SCG
Definition: max31855.h:84
#define MAX31855_INTERNAL_TEMP_SIGN_POS
Definition: max31855.h:63
uint8_t value
Definition: max31855.h:91
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
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
Header file of utility functions.
int32_t no_os_sign_extend32(uint32_t value, int index)
int max31855_init(struct max31855_dev **device, struct max31855_init_param *init_param)
Device and comm init function.
Definition: max31855.c:57
uint8_t SCV
Definition: max31855.h:82
Error macro definition for ARM Compiler.
int max31855_remove(struct max31855_dev *device)
Remove resources allocated by the init function.
Definition: max31855.c:84
int max31855_read_temp(struct max31855_dev *device, struct max31855_decimal *thermocouple_temp, struct max31855_decimal *internal_temp)
Read thermocouple and internal temperatures (converted in deg. C)
Definition: max31855.c:131
Structure holding the parameters for SPI initialization.
Definition: no_os_spi.h:140