Microchip® Advanced Software Framework

mcp980x.h File Reference

MCP980X driver.

Copyright (c) 2012-2018 Microchip Technology Inc. and its subsidiaries.

#include "twi_master.h"

Macros

#define BOARD_MCP980X_ADDR   0 /* TWI sensor address (0x48u) */
 
#define BOARD_MCP980X_TWI_INSTANCE   0 /* TWI instance (TWI0) */
 Checking board configuration of the MCP980X Temperature Sensor. More...
 
#define MCP980X_CONFIG_ALERT_POLARITY_ACTIVE_HIGH   (1 << 2)
 
#define MCP980X_CONFIG_ALERT_POLARITY_ACTIVE_LOW   (0 << 2)
 
#define MCP980X_CONFIG_COMPARATOR_MODE   (0 << 1)
 
#define MCP980X_CONFIG_FAULT_QUEUE_1   (0 << 3)
 
#define MCP980X_CONFIG_FAULT_QUEUE_2   (1 << 3)
 
#define MCP980X_CONFIG_FAULT_QUEUE_4   (2 << 3)
 
#define MCP980X_CONFIG_FAULT_QUEUE_6   (3 << 3)
 
#define MCP980X_CONFIG_INTERRUPT_MODE   (1 << 1)
 
#define MCP980X_CONFIG_ONE_SHOT_ENABLE   (1 << 7)
 MCP980X Configuration Register Setting. More...
 
#define MCP980X_CONFIG_RESOLUTION_10_BIT   (1 << 5)
 
#define MCP980X_CONFIG_RESOLUTION_11_BIT   (2 << 5)
 
#define MCP980X_CONFIG_RESOLUTION_12_BIT   (3 << 5)
 
#define MCP980X_CONFIG_RESOLUTION_9_BIT   (0 << 5)
 
#define MCP980X_CONFIG_SHUTDOWN_ENABLE   (1 << 0)
 

Functions

uint32_t mcp980x_disable (void)
 Disable the sensor. More...
 
uint32_t mcp980x_enable (void)
 Enable the sensor. More...
 
uint32_t mcp980x_get_configuration (uint8_t *p_config)
 Get MCP980X configuration. More...
 
uint32_t mcp980x_get_temperature (int8_t *p_integer, uint32_t *p_decimal)
 Get ambient temperature. More...
 
uint32_t mcp980x_get_temperature_hysteresis (int8_t *p_integer, uint32_t *p_decimal)
 Get temperature hysteresis. More...
 
uint32_t mcp980x_get_temperature_limit (int8_t *p_integer, uint32_t *p_decimal)
 Get temperature limit. More...
 
uint32_t mcp980x_init (void)
 Init the sensor. More...
 
uint32_t mcp980x_one_shot_mode (void)
 Enable One-Shot mode and perform a single temperature measure. More...
 
uint32_t mcp980x_set_configuration (uint8_t uc_config)
 Set MCP980X configuration. More...
 
uint32_t mcp980x_set_temperature_hysteresis (int8_t c_integer, uint32_t ul_decimal)
 Set temperature hysteresis. More...
 
uint32_t mcp980x_set_temperature_limit (int8_t c_integer, uint32_t ul_decimal)
 Set temperature limit. More...
 

#define BOARD_MCP980X_ADDR   0 /* TWI sensor address (0x48u) */
#define BOARD_MCP980X_TWI_INSTANCE   0 /* TWI instance (TWI0) */

Checking board configuration of the MCP980X Temperature Sensor.

Referenced by mcp980x_interface_init(), mcp980x_read_register(), and mcp980x_write_register().

#define MCP980X_CONFIG_ALERT_POLARITY_ACTIVE_HIGH   (1 << 2)
#define MCP980X_CONFIG_ALERT_POLARITY_ACTIVE_LOW   (0 << 2)
#define MCP980X_CONFIG_COMPARATOR_MODE   (0 << 1)
#define MCP980X_CONFIG_FAULT_QUEUE_1   (0 << 3)
#define MCP980X_CONFIG_FAULT_QUEUE_2   (1 << 3)
#define MCP980X_CONFIG_FAULT_QUEUE_4   (2 << 3)
#define MCP980X_CONFIG_FAULT_QUEUE_6   (3 << 3)
#define MCP980X_CONFIG_INTERRUPT_MODE   (1 << 1)
#define MCP980X_CONFIG_ONE_SHOT_ENABLE   (1 << 7)

MCP980X Configuration Register Setting.

Referenced by mcp980x_one_shot_mode().

#define MCP980X_CONFIG_RESOLUTION_10_BIT   (1 << 5)
#define MCP980X_CONFIG_RESOLUTION_11_BIT   (2 << 5)
#define MCP980X_CONFIG_RESOLUTION_12_BIT   (3 << 5)
#define MCP980X_CONFIG_RESOLUTION_9_BIT   (0 << 5)
#define MCP980X_CONFIG_SHUTDOWN_ENABLE   (1 << 0)