Definitions for MAX6642 I2C Temperature Sensor.
More...
Go to the source code of this file.
Definitions for MAX6642 I2C Temperature Sensor.
- Author
- Henrique Silva henri.nosp@m.que..nosp@m.silva.nosp@m.@lnl.nosp@m.s.br, LNLS
◆ MAX6642_CFG_ALERT_MASK
#define MAX6642_CFG_ALERT_MASK (1 << 7) |
◆ MAX6642_CFG_EXT_ONLY_MASK
#define MAX6642_CFG_EXT_ONLY_MASK (1 << 5) |
◆ MAX6642_CFG_FAULT_QUEUE_MASK
#define MAX6642_CFG_FAULT_QUEUE_MASK (1 << 4) |
◆ MAX6642_CFG_STOP_RUN_MASK
#define MAX6642_CFG_STOP_RUN_MASK (1 << 6) |
◆ MAX6642_CMD_READ_CONFIG
#define MAX6642_CMD_READ_CONFIG 0x03 |
◆ MAX6642_CMD_READ_LOCAL
#define MAX6642_CMD_READ_LOCAL 0x00 |
◆ MAX6642_CMD_READ_LOCAL_EXTD
#define MAX6642_CMD_READ_LOCAL_EXTD 0x11 |
◆ MAX6642_CMD_READ_LOCAL_LIMIT
#define MAX6642_CMD_READ_LOCAL_LIMIT 0x05 |
◆ MAX6642_CMD_READ_MANUF_ID
#define MAX6642_CMD_READ_MANUF_ID 0xFE |
◆ MAX6642_CMD_READ_REMOTE
#define MAX6642_CMD_READ_REMOTE 0x01 |
◆ MAX6642_CMD_READ_REMOTE_EXTD
#define MAX6642_CMD_READ_REMOTE_EXTD 0x10 |
◆ MAX6642_CMD_READ_REMOTE_LIMIT
#define MAX6642_CMD_READ_REMOTE_LIMIT 0x07 |
◆ MAX6642_CMD_READ_STATUS
#define MAX6642_CMD_READ_STATUS 0x02 |
◆ MAX6642_CMD_SINGLESHOT
#define MAX6642_CMD_SINGLESHOT 0x0D |
◆ MAX6642_CMD_WRITE_CONFIG
#define MAX6642_CMD_WRITE_CONFIG 0x09 |
◆ MAX6642_CMD_WRITE_LOCAL_LIMIT
#define MAX6642_CMD_WRITE_LOCAL_LIMIT 0x0B |
◆ MAX6642_CMD_WRITE_REMOTE_LIMIT
#define MAX6642_CMD_WRITE_REMOTE_LIMIT 0x0D |
◆ MAX6642_STATUS_BUSY_MASK
#define MAX6642_STATUS_BUSY_MASK (1 << 7) |
◆ MAX6642_STATUS_LOCAL_HIGH_MASK
#define MAX6642_STATUS_LOCAL_HIGH_MASK (1 << 6) |
◆ MAX6642_STATUS_OPEN_MASK
#define MAX6642_STATUS_OPEN_MASK (1 << 4) |
◆ MAX6642_STATUS_REMOTE_HIGH_MASK
#define MAX6642_STATUS_REMOTE_HIGH_MASK (1 << 5) |
◆ MAX6642_UPDATE_RATE
#define MAX6642_UPDATE_RATE 500 |
◆ MAX6642_init()
void MAX6642_init |
( |
void | | ) |
|
Initializes MAX6642 sensor and creates vTaskMAX6642.
- Returns
- None
◆ max6642_read_cfg()
uint8_t max6642_read_cfg |
( |
sensor_t * | sensor | ) |
|
Reads MAX6642 configuration byte.
Cfg byte:
[7] - MASK1 - Disables 'ALERT interrupts
[6] - STOP/RUN - Puts MAX6642 in standby mode
[5] - External Only - disables local temperature measurements so that only remote temperature is measured. The measurement rate becomes 8Hz.
[4] - Fault queue - (0):'ALERT is set by single fault; (1):Two consecutive faults are required to assert 'ALERT
[3:0] - Reserved
- Parameters
-
sensor | Pointer to sensor info struct |
- Returns
- Configuration byte
◆ max6642_read_local()
Bool max6642_read_local |
( |
sensor_t * | sensor, |
|
|
uint8_t * | temp ) |
Reads MAX6642's local temperature value.
- Parameters
-
sensor | Pointer to sensor struct |
- Returns
- Temperature value
◆ max6642_read_local_extd()
Bool max6642_read_local_extd |
( |
sensor_t * | sensor, |
|
|
uint8_t * | temp ) |
Reads MAX6642's local extended temperature value.
The extended value is the fractional part of the reading, with 0.25 oC steps. The value is the 2 MSBits returned.
- Parameters
-
sensor | Pointer to sensor struct |
- Returns
- Extended temperature value (2 MSB)
◆ max6642_read_remote()
Bool max6642_read_remote |
( |
sensor_t * | sensor, |
|
|
uint8_t * | temp ) |
Reads MAX6642's remote temperature value.
- Parameters
-
sensor | Pointer to sensor struct |
- Returns
- Temperature value
◆ max6642_read_remote_extd()
Bool max6642_read_remote_extd |
( |
sensor_t * | sensor, |
|
|
uint8_t * | temp ) |
Reads MAX6642's remote extended temperature value.
The extended value is the fractional part of the reading, with 0.25 oC steps. The value is the 2 MSBits returned.
- Parameters
-
sensor | Pointer to sensor info struct |
- Returns
- Extended temperature value (2 MSB)
◆ max6642_read_status()
uint8_t max6642_read_status |
( |
sensor_t * | sensor | ) |
|
Reads MAX6642 status byte.
Status byte:
[7] - BUSY - Indicates the MAX6642 is busy converting data
[6] - LHIGH - Internal high temperature fault
[5] - Reserved
[4] - RHIGH - External high temperature fault
[3] - Reserved
[2] - OPEN - Diode open condition
[1:0] - Reserved
- Parameters
-
sensor | Pointer to sensor info struct |
- Returns
- Status byte
◆ max6642_write_cfg()
void max6642_write_cfg |
( |
sensor_t * | sensor, |
|
|
uint8_t | cfg ) |
Writes MAX6642 configuration byte.
Cfg byte:
[7] - MASK1 - Disables 'ALERT interrupts
[6] - STOP/RUN - Puts MAX6642 in standby mode
[5] - External Only - disables local temperature measurements so that only remote temperature is measured. The measurement rate becomes 8Hz.
[4] - Fault queue - (0):'ALERT is set by single fault; (1):Two consecutive faults are required to assert 'ALERT
[3:0] - Reserved
- Parameters
-
sensor | Pointer to sensor info struct |
cfg | Configuration byte |
- Returns
- None
◆ max6642_write_local_limit()
void max6642_write_local_limit |
( |
sensor_t * | sensor, |
|
|
uint8_t | limit ) |
Sets internal high temperature limit that asserts 'ALERT.
- Parameters
-
sensor | Pointer to sensor info struct |
limit | High temperature limit value |
◆ max6642_write_remote_limit()
void max6642_write_remote_limit |
( |
sensor_t * | sensor, |
|
|
uint8_t | limit ) |
Sets external high temperature limit that asserts 'ALERT.
- Parameters
-
sensor | Pointer to sensor info struct |
limit | High temperature limit value |
◆ vTaskMAX6642()
void vTaskMAX6642 |
( |
void * | Parameters | ) |
|
MAX6642 Monitor Task.
- Parameters
-
Parameters | Pointer to parameter list passed to task upon initialization (not used here) |
◆ SDR_MAX6642_FPGA
◆ vTaskMAX6642_Handle
TaskHandle_t vTaskMAX6642_Handle |
|
extern |
MAX6642 monitor Task Handle.