Header file of MAX31875 Driver.
More...
#include <stdint.h>
#include "no_os_i2c.h"
#include "no_os_util.h"
Header file of MAX31875 Driver.
- Author
- Andrei Drimbarean (andre.nosp@m.i.dr.nosp@m.imbar.nosp@m.ean@.nosp@m.analo.nosp@m.g.co.nosp@m.m)
Copyright 2022(c) Analog Devices, Inc.
SPDX-License-Identifier: BSD-3-Clause
◆ MAX31875_COMP_INT_MASK
◆ MAX31875_CONFIGURATION_REG
| #define MAX31875_CONFIGURATION_REG 0x1 |
◆ MAX31875_CONVERSION_RATE_MASK
◆ MAX31875_DATA_FORMAT_MASK
| #define MAX31875_DATA_FORMAT_MASK NO_OS_BIT(7) |
◆ MAX31875_FAULT_QUEUE_MASK
◆ MAX31875_ONESHOT_MASK
◆ MAX31875_OVER_TEMP_STATUS_MASK
| #define MAX31875_OVER_TEMP_STATUS_MASK NO_OS_BIT(15) |
◆ MAX31875_PEC_MASK
◆ MAX31875_RESOLUTION_MASK
◆ MAX31875_SHUTDOWN_MASK
◆ MAX31875_TEMPERATURE_REG
| #define MAX31875_TEMPERATURE_REG 0x0 |
◆ MAX31875_THYST_REG
| #define MAX31875_THYST_REG 0x2 |
◆ MAX31875_TIMEOUT_MASK
◆ MAX31875_TOS_REG
| #define MAX31875_TOS_REG 0x3 |
◆ max31875_i2c_addr
Defines the potential device I2C addresses.
| Enumerator |
|---|
| MAX31875R0 | |
| MAX31875R1 | |
| MAX31875R2 | |
| MAX31875R3 | |
| MAX31875R4 | |
| MAX31875R5 | |
| MAX31875R6 | |
| MAX31875R7 | |
◆ max31875_init()
Initialize the device driver befre use.
Initialize the device driver befre use.
- Parameters
-
| [out] | device | - Driver handler pointer. |
| [in] | init_param | - Pointer to the initialization structure. |
- Returns
- 0 in case of success, error code otherwise.
◆ max31875_reg_read()
| int32_t max31875_reg_read |
( |
struct max31875_dev * | dev, |
|
|
uint32_t | reg, |
|
|
uint32_t * | readval ) |
Read a device register through the I2C interface.
Read a device register through the I2C interface.
- Parameters
-
| [in] | dev | - Driver handler pointer. |
| [in] | reg | - Address of the register to be read. |
| [out] | readval | - Pointer to the register value. |
- Returns
- 0 in case of success, error code otherwise.
◆ max31875_reg_write()
| int32_t max31875_reg_write |
( |
struct max31875_dev * | dev, |
|
|
uint32_t | reg, |
|
|
uint32_t | writeval ) |
Write a device register through the I2C interface.
Write a device register through the I2C interface.
- Parameters
-
| [in] | dev | - Driver handler pointer. |
| [in] | reg | - Address of the register to be written. |
| [in] | writeval | - New value for the register. |
- Returns
- 0 in case of success, error code otherwise.
◆ max31875_reg_write_mask()
| int32_t max31875_reg_write_mask |
( |
struct max31875_dev * | dev, |
|
|
uint32_t | reg, |
|
|
uint32_t | val, |
|
|
uint32_t | mask ) |
Read-modify-write operation on a field of a register.
Read-modify-write operation on a field of a register.
- Parameters
-
| [in] | dev | - Driver handler pointer. |
| [in] | reg | - Address of the register. |
| [in] | val | - New value for the bit field. |
| [in] | mask | - Mask of the bit field. |
- Returns
- 0 in case of success, error code otherwise.
◆ max31875_remove()
Free memory allocated by max31875_init().
Free memory allocated by max31875_init().
- Parameters
-
| [in] | dev | - Device driver handler. |
- Returns
- 0 in case of success, error code otherwise.