Skip to content

Commit 911fb76

Browse files
committed
added set interupt persistency API
1 parent e82486d commit 911fb76

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

src/Arduino_LTR381RGB.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
at http://mozilla.org/MPL/2.0/
66
*/
77

8-
#ifndef _ARUDINO_LTR381RGB_H_
9-
#define _ARUDINO_LTR381RGB_H_
8+
#ifndef _ARUDINO_LTR381RGB_H_
9+
#define _ARUDINO_LTR381RGB_H_
1010

1111
#include "LTR381RGB.h"
1212

src/LTR381RGB.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,10 @@ int LTR381RGBClass::getADCRate(int rate) {
303303
}
304304
}
305305

306+
void LTR381RGBClass::setInteruptPersistence(int persistence) {
307+
writeRegister(LTR381RGB_INT_PST, (persistence << 4));
308+
}
309+
306310
void LTR381RGBClass::enableALSInterrupt() {
307311
uint8_t res = readRegister(LTR381RGB_INT_CFG);
308312
writeRegister(LTR381RGB_INT_CFG, res | 0x04);

src/LTR381RGB.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ class LTR381RGBClass {
2929
void setTimeout(unsigned long timeout = 200);
3030
int getADCResTime(int resolution);
3131
int getADCRate(int rate);
32+
void setInteruptPersistence(int persistence);
3233
void enableALSInterrupt();
3334
void disableALSInterrupt();
3435
void resetSW();

0 commit comments

Comments
 (0)