Implementation of MAX31827 Driver.
More...
|
| int | max31827_reg_read (struct max31827_device *dev, uint8_t addr, uint16_t *val) |
| | Read a register value.
|
| |
| int | max31827_reg_write (struct max31827_device *dev, uint8_t addr, uint16_t val) |
| | Write a register value.
|
| |
| int | max31827_reg_update_bits (struct max31827_device *dev, uint8_t addr, uint16_t mask, uint16_t val) |
| | Read-modify-write operation.
|
| |
| int | max31827_init (struct max31827_device **dev, struct max31827_init_param *init_param) |
| | Device and comm init function.
|
| |
| int | max31827_remove (struct max31827_device *dev) |
| | Free resources allocated by the init function.
|
| |
| int | max31827_init_client (struct max31827_device *dev, struct max31827_init_param *init_param) |
| | Initialize MAX31827 device setup.
|
| |
| int | max31827_read_temp (struct max31827_device *dev, uint8_t addr, int32_t *val) |
| | Read a temperature from a register.
|
| |
| int | max31827_read_temp_input (struct max31827_device *dev, int32_t *val) |
| | Read input temperature.
|
| |
| int | max31827_shutdown_write (struct max31827_device *dev, uint8_t reg, uint16_t mask, uint16_t val) |
| | Shutdown then write register value.
|
| |
| int | max31827_write_alarm_val (struct max31827_device *dev, unsigned int reg, int32_t val) |
| | Write the alarm value to the specified register.
|
| |
Implementation of MAX31827 Driver.
- Author
- John Erasmus Mari Geronimo (johne.nosp@m.rasm.nosp@m.usmar.nosp@m.i.ge.nosp@m.ronim.nosp@m.o@an.nosp@m.alog..nosp@m.com)
Copyright 2024(c) Analog Devices, Inc.
SPDX-License-Identifier: BSD-3-Clause
◆ max31827_init()
Device and comm init function.
- Parameters
-
| dev | - MAX31827 descriptor to be initialized |
| init_param | - Init parameter for descriptor |
- Returns
- 0 in case of success, errno errors otherwise
◆ max31827_init_client()
Initialize MAX31827 device setup.
- Parameters
-
| dev | - MAX31827 descriptor to be initialized |
| init_param | - Init parameter for descriptor |
- Returns
- 0 in case of success, errno errors otherwise
◆ max31827_read_temp()
| int max31827_read_temp |
( |
struct max31827_device * | dev, |
|
|
uint8_t | addr, |
|
|
int32_t * | val ) |
Read a temperature from a register.
- Parameters
-
| dev | - MAX31827 descriptor |
| addr | - register address |
| val | - temperature value |
- Returns
- 0 in case of success, negative error code otherwise
◆ max31827_read_temp_input()
| int max31827_read_temp_input |
( |
struct max31827_device * | dev, |
|
|
int32_t * | val ) |
Read input temperature.
- Parameters
-
| dev | - MAX31827 descriptor |
| val | - temperature value |
- Returns
- 0 in case of success, negative error code otherwise
For 12-bit resolution the conversion time is 140 ms, thus an additional 15 ms is needed to complete the conversion: 125 ms + 15 ms = 140 ms
◆ max31827_reg_read()
| int max31827_reg_read |
( |
struct max31827_device * | dev, |
|
|
uint8_t | addr, |
|
|
uint16_t * | val ) |
Read a register value.
- Parameters
-
| dev | - MAX31827 descriptor |
| addr | - register address |
| val | - register value |
- Returns
- 0 in case of success, negative error code otherwise
◆ max31827_reg_update_bits()
| int max31827_reg_update_bits |
( |
struct max31827_device * | dev, |
|
|
uint8_t | addr, |
|
|
uint16_t | mask, |
|
|
uint16_t | val ) |
Read-modify-write operation.
- Parameters
-
| dev | - MAX31827 descriptor |
| addr | - register address |
| mask | - Mask for specific register bits to be updated |
| val | - register value |
- Returns
- 0 in case of success, negative error code otherwise
◆ max31827_reg_write()
| int max31827_reg_write |
( |
struct max31827_device * | dev, |
|
|
uint8_t | addr, |
|
|
uint16_t | val ) |
Write a register value.
- Parameters
-
| dev | - MAX31827 descriptor |
| addr | - register address |
| val | - register value |
- Returns
- 0 in case of success, negative error code otherwise
◆ max31827_remove()
Free resources allocated by the init function.
- Parameters
-
- Returns
- 0 in case of success, errno errors otherwise
◆ max31827_shutdown_write()
| int max31827_shutdown_write |
( |
struct max31827_device * | dev, |
|
|
uint8_t | reg, |
|
|
uint16_t | mask, |
|
|
uint16_t | val ) |
Shutdown then write register value.
- Parameters
-
| dev | - MAX31827 descriptor |
| reg | - register address |
| mask | - Mask for specific register bits to be updated |
| val | - register value (requires prior bit shifting) |
- Returns
- 0 in case of success, negative error code otherwise
Before the Temperature Threshold Alarm, Alarm Hysteresis Threshold and Resolution bits from Configuration register are changed over I2C, the part must be in shutdown mode.
◆ max31827_write_alarm_val()
| int max31827_write_alarm_val |
( |
struct max31827_device * | dev, |
|
|
unsigned int | reg, |
|
|
int32_t | val ) |
Write the alarm value to the specified register.
- Parameters
-
| dev | - MAX31827 descriptor |
| reg | - register address |
| val | - temperature value |
- Returns
- 0 in case of success, negative error code otherwise
◆ max31827_conv_times
| const int max31827_conv_times[] |
Initial value:= {
}
@ MAX31827_RES_9_BIT
Definition max31827.h:70
@ MAX31827_RES_10_BIT
Definition max31827.h:71
@ MAX31827_RES_8_BIT
Definition max31827.h:69
@ MAX31827_RES_12_BIT
Definition max31827.h:72
MAX31827 temperature conversion times in us.
◆ max31827_conversions
| const uint16_t max31827_conversions[] |
Initial value:= {
}
@ MAX31827_CNV_1_DIV_16_HZ
Definition max31827.h:58
@ MAX31827_CNV_1_HZ
Definition max31827.h:60
@ MAX31827_CNV_1_DIV_4_HZ
Definition max31827.h:59
@ MAX31827_CNV_1_DIV_32_HZ
Definition max31827.h:57
@ MAX31827_CNV_4_HZ
Definition max31827.h:61
@ MAX31827_CNV_8_HZ
Definition max31827.h:62
@ MAX31827_CNV_1_DIV_64_HZ
Definition max31827.h:56
MAX31827 conversion period in ms.
◆ max31827_resolutions
| const uint16_t max31827_resolutions[] |
Initial value:
MAX31827 temperature resolution.