Adafruit PCT2075 Arduino Library
Adafruit_PCT2075.h
Go to the documentation of this file.
1 
16 #ifndef _ADAFRUIT_PCT2075_H
17 #define _ADAFRUIT_PCT2075_H
18 
19 #include "Arduino.h"
20 #include <Adafruit_BusIO_Register.h>
21 #include <Adafruit_I2CDevice.h>
22 #include <Wire.h>
23 
24 //#define PCT2075_I2CADDR_DEFAULT 0x37 ///< Address is configured with pins
25 // A0-A2
26 #define PCT2075_I2CADDR_DEFAULT 0x37
27 #define PCT2075_REGISTER_TEMP 0x00
28 #define PCT2075_REGISTER_CONFIG 0x01
29 #define PCT2075_REGISTER_THYST 0x02
30 #define PCT2075_REGISTER_TOS 0x03
31 #define PCT2075_REGISTER_TIDLE \
32  0x04
33 
34 
40 typedef enum {
57 typedef enum {
63 
69 public:
71  boolean begin(uint8_t i2c_addr = PCT2075_I2CADDR_DEFAULT,
72  TwoWire *wire = &Wire);
73 
74  float getTemperature(void);
75 
76  float getIdleTime(void);
77  void setIdleTime(float new_idle_time);
78 
79  void setActiveHigh(bool active_high);
80 
81  float getHighTemperatureThreshold(void);
82  void setHighTemperatureThreshold(float new_temp_threshold);
83 
84  float getTemperatureHysteresis(void);
85  void setTemperatureHysteresis(float temp_hysteresis);
86 
87  pct2075_mode_t getMode(void);
88  void setMode(pct2075_mode_t mode);
89 
92 
93  Adafruit_BusIO_Register *CONFIG;
94 
95 private:
96  bool _init(void);
97 
98  Adafruit_I2CDevice *i2c_dev;
99 };
100 
101 #endif
Class that stores state and functions for interacting with the PCT2075 I2C Digital Potentiometer...
Definition: Adafruit_PCT2075.h:68
float getTemperatureHysteresis(void)
Gets the temperature hysteresis value in degrees C.
Definition: Adafruit_PCT2075.cpp:139
Definition: Adafruit_PCT2075.h:46
float getHighTemperatureThreshold(void)
Gets the high temperature threshold in degrees C.
Definition: Adafruit_PCT2075.cpp:164
void setHighTemperatureThreshold(float new_temp_threshold)
Sets the high temperature threshold in degrees C.
Definition: Adafruit_PCT2075.cpp:177
Raise an alert after 1 fault.
Definition: Adafruit_PCT2075.h:58
pct2075_fault_count_t
Faut count options.
Definition: Adafruit_PCT2075.h:57
void setFaultCount(pct2075_fault_count_t)
Sets the fault count.
Definition: Adafruit_PCT2075.cpp:222
float getTemperature(void)
Gets the current temperature measurement.
Definition: Adafruit_PCT2075.cpp:83
void setIdleTime(float new_idle_time)
Sets the amount of time the sensor waits between measurements.
Definition: Adafruit_PCT2075.cpp:112
pct2075_fault_count_t getFaultCount(void)
Gets the fault count.
Definition: Adafruit_PCT2075.cpp:211
Adafruit_PCT2075()
Instantiates a new PCT2075 class.
Definition: Adafruit_PCT2075.cpp:43
void setMode(pct2075_mode_t mode)
Sets the high temperature alert mode.
Definition: Adafruit_PCT2075.cpp:199
pct2075_mode_t getMode(void)
Gets the high temperature alert mode.
Definition: Adafruit_PCT2075.cpp:188
Definition: Adafruit_PCT2075.h:41
Raise an alert after 2 faults.
Definition: Adafruit_PCT2075.h:59
float getIdleTime(void)
Gets the amount of time the sensor waits between measurements.
Definition: Adafruit_PCT2075.cpp:95
void setTemperatureHysteresis(float temp_hysteresis)
Sets the temperature hysteresis value in degrees C.
Definition: Adafruit_PCT2075.cpp:152
pct2075_mode_t
Mode options.
Definition: Adafruit_PCT2075.h:40
#define PCT2075_I2CADDR_DEFAULT
Address is configured with pins A0-A2.
Definition: Adafruit_PCT2075.h:26
boolean begin(uint8_t i2c_addr=PCT2075_I2CADDR_DEFAULT, TwoWire *wire=&Wire)
Sets up the hardware and initializes I2C.
Definition: Adafruit_PCT2075.cpp:53
void setActiveHigh(bool active_high)
Sets the polarity of the INT pin.
Definition: Adafruit_PCT2075.cpp:128
Raise an alert after 4 faults.
Definition: Adafruit_PCT2075.h:60
Adafruit_BusIO_Register * CONFIG
BusIO Register for CONFIG.
Definition: Adafruit_PCT2075.h:93
Raise an alert after 6 faults.
Definition: Adafruit_PCT2075.h:61