-
Notifications
You must be signed in to change notification settings - Fork 17
Add interrupt feature #7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Memory usage change @ 8af9c21
Click for full report table
Click for full report CSV
|
enableDataReady KEYWORD2 | ||
disableDataReady KEYWORD2 | ||
setOpenDrain KEYWORD2 | ||
setPushPull KEYWORD2 | ||
setActiveHigh KEYWORD2 | ||
setActiveLow KEYWORD2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
enableDataReady KEYWORD2 | |
disableDataReady KEYWORD2 | |
setOpenDrain KEYWORD2 | |
setPushPull KEYWORD2 | |
setActiveHigh KEYWORD2 | |
setActiveLow KEYWORD2 | |
enableDataReady KEYWORD2 | |
disableDataReady KEYWORD2 | |
setOpenDrain KEYWORD2 | |
setPushPull KEYWORD2 | |
setActiveHigh KEYWORD2 | |
setActiveLow KEYWORD2 |
In order to be recognized by the Arduino IDE, the keyword fields must be separated by a single true tab (not spaces):
https://arduino.github.io/arduino-cli/latest/library-specification/#keywordstxt-format
######################################### | ||
# Constants | ||
######################################### | ||
|
||
FAHRENHEIT LITERAL1 | ||
FAHRENHEIT LITERAL1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FAHRENHEIT LITERAL1 | |
FAHRENHEIT LITERAL1 |
@@ -26,6 +26,7 @@ | |||
#define HTS221_WHO_AM_I_REG 0x0f | |||
#define HTS221_CTRL1_REG 0x20 | |||
#define HTS221_CTRL2_REG 0x21 | |||
#define HTS221_CTRL3_REG 0x22 //Dara Ready (b7 0 active high)(open drain, b6 1)(b2, 1 enable data ready) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove the comment
void HTS221Class::enableDataReady(){ | ||
uint8_t data = i2cRead(HTS221_CTRL3_REG) & 0b11111000; | ||
i2cWrite(HTS221_CTRL3_REG, data | 0b1 << 2); | ||
} | ||
|
||
void HTS221Class::disableDataReady(){ | ||
uint8_t data = i2cRead(HTS221_CTRL3_REG) & 0b11111000; | ||
i2cWrite(HTS221_CTRL3_REG, data | 0b0 << 2); | ||
} | ||
|
||
void HTS221Class::setOpenDrain(){ | ||
uint8_t data = i2cRead(HTS221_CTRL3_REG) & 0b10111100; | ||
i2cWrite(HTS221_CTRL3_REG, data | 0b1 << 6); | ||
} | ||
|
||
void HTS221Class::setPushPull(){ | ||
uint8_t data = i2cRead(HTS221_CTRL3_REG) & 0b10111100; | ||
i2cWrite(HTS221_CTRL3_REG, data); | ||
} | ||
|
||
void HTS221Class::setActiveHigh(){ | ||
uint8_t data = i2cRead(HTS221_CTRL3_REG) & 0b01111111; | ||
i2cWrite(HTS221_CTRL3_REG, data); | ||
} | ||
|
||
void HTS221Class::setActiveLow(){ | ||
uint8_t data = i2cRead(HTS221_CTRL3_REG) & 0b01111111; | ||
i2cWrite(HTS221_CTRL3_REG, data | 0b1 << 7); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do you need all these methods? where are they used? i think that is better implement only the part we need for the library
I've added the minimun configuration to enable the interrupt pin