I wrote a code for GPIO interrupt when DRDY pin goes high to low(Data ready) interrupt should occur and call a function but it is not working
Below is a code:
intDRDY = false;
#define GPIO_DRDY 8
#define GPIO1 DT_NODELABEL(gpio1)
const struct device *gpio1_dev = DEVICE_DT_GET(GPIO1);
static struct gpio_callback gpio_cb;
/*call back function */
static void gpio_callback(const struct device *dev,
struct gpio_callback *cb,
uint32_t pins)
{
intDRDY = true;
}
in main function i am calling that function
gpio_pin_configure(gpio1_dev, GPIO_DRDY, GPIO_INPUT);
gpio_pin_interrupt_configure(gpio1_dev, GPIO_DRDY, GPIO_INT_EDGE_FALLING);
gpio_init_callback(&gpio_cb, gpio_callback, BIT(GPIO_DRDY));
gpio_add_callback(gpio1_dev, &gpio_cb);
while(1)
{
if(intDRDY)
{
intDRDY = false;
ADS_RDATA();
}
}
it is not working
Is there a way to occur interrupt in different way or i did any mistake
Thank you in advance