I am trying to get a very precise timestamp of when a GPIO IRQ occurs. I've already altered gpiolib to create a new object: "/sys/class/gpio/gpioXXX/timestamp"
What i can't figure out is how to write to it from within the ISR. Should be fairly simple:
do_gettimeofday(&tv);
sprintf((char *)pointertotimestamp,"%08u.%06u\n",(int)(tv.tv_sec%100000000),(int)tv.tv_usec));
What I can't seem to figure out is how to get (or create) the pointer to "/sys/class/gpio/gpioXXX/timestamp" inside the interrupt routine.
Thank you everyone in advance.
Rory
We have not got your response yet and will close the discussion. If you still need help, please feel free to reply with an update to this discussion.
Thanks,
Yixing
Hi Rory,
Sorry for the delay,
Are you still having problems?
Do you want to modify the value of the GPIO?
In kernel space you could try to use the gpio_set_value in case you want to modify the value of a pin.
If that is not what you want, please give me more details.
Best Regards,
Alejandro