You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/SparkFun_MCP9600.h
+10-5Lines changed: 10 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -139,15 +139,20 @@ class MCP9600{
139
139
boolconfigAlertLogicLevel(uint8_t number, bool level); //Configures whether the hardware alert pin is active-high or active-low. Set to 1 for active-high, 0 for active-low.
140
140
boolconfigAlertMode(uint8_t number, bool mode); //Configures whether the MCP9600 treats the alert like a comparator or an interrrupt. Set to 1 for interrupt, 0 for comparator. More information is on pg. 34 of the datasheet.
141
141
boolconfigAlertEnable(uint8_t number, bool enable); //Configures whether or not the interrupt is enabled or not. Set to 1 to enable, or 0 to disable.
142
-
boolclearAlert(uint8_t number); //Clears the interrupt bit on the specified alert channel
143
-
boolisAlertTriggered(uint8_t number);//Returns true if the interrupt has been triggered, false otherwise
142
+
boolclearAlertPin(uint8_t number); //Clears the interrupt on the specified alert channel, resetting the value of the pin.
143
+
boolisTempGreaterThanLimit(uint8_t number); //Returns true if the interrupt has been triggered, false otherwise
144
144
145
+
146
+
//debug
147
+
uint8_treadSingleRegister(MCP9600_Register reg); //Attempts to read a single register, will keep trying for retryAttempts amount of times
148
+
uint16_treadDoubleRegister(MCP9600_Register reg); //Attempts to read two registers, will keep trying for retryAttempts amount of times
149
+
boolwriteSingleRegister(MCP9600_Register reg, uint8_t data); //Attempts to write data into a single 8-bit register. Does not check to make sure it was written successfully. Returns 0 if there wasn't an error on I2C transmission, and 1 otherwise.
150
+
boolwriteDoubleRegister(MCP9600_Register reg, uint16_t data); //Attempts to write data into a double (two 8-bit) registers. Does not check to make sure it was written successfully. Returns 0 if there wasn't an error on I2C transmission, and 1 otherwise.
151
+
152
+
145
153
//Internal I2C Abstraction
146
154
private:
147
155
TwoWire *_i2cPort; //Generic connection to user's chosen I2C port
148
156
uint8_t _deviceAddress; //I2C address of the MCP9600
149
-
uint8_treadSingleRegister(MCP9600_Register reg); //Attempts to read a single register, will keep trying for retryAttempts amount of times
150
-
uint16_treadDoubleRegister(MCP9600_Register reg); //Attempts to read two registers, will keep trying for retryAttempts amount of times
151
-
boolwriteSingleRegister(MCP9600_Register reg, uint8_t data); //Attempts to write data into a single 8-bit register. Does not check to make sure it was written successfully.
0 commit comments