How to use interrupt for TSL2591
Hi
I purchased the TSL2591 product and used it on the STM32 board.
I am reading the datasheet and creating the code.
I initialized the first writable registers to 0x00.
I then looked at the datasheet and gave the control register a value of 0xB0.
The configuration uses 0xD3 in the enable register, 0x00 in the control register, and 0x09 in the persist register.
I read the PID and ID registers and got a 4 digit number.
After that, I read the thresholds 0x14 and 0x15 (the value of 5 came out).
The lower and upper bytes of CH0 and CH1 have been read (CH0 is 21, CH1 is 18).
The two values did not change with illumination.
I have an interrupt in the datasheet and I do not know how to handle it.
Then I got a question, Is the INT pin in the product a pin for an external interrupt?
I think I do not have much use for the INT in the datasheet.
Could you help me?
What is ALS? ALS interrupt is also required.
In the status register, the sixth bit says that the device should be specified when it encounters an interrupt condition that does not persist. Is it written as 1?
Also, is it correct to write the lsb of the status register to 1 if the AEN bit is used?
The fundamental problem is how to use interrupts generated by the TSL2591 to measure the illuminance.
I'll be waiting for a reply.
The board I am using now is STM32F407VGT.
I am using the STM32 HAL library.
I looked in github, but there was only Arduino.
So I wrote here to get technical support.
Additional questions
How can I fix the thresholds?
