Hello,
I am trying to use GPIO0.09 dr_toggle, dr_set and dr_clear registers on Toradex Apalis imx8qm board running QNX70.
Direct writing to the GPIO0 data register DR works fine. But neither dr_set, dr_clear nor dr_toggle work. I am using the code below.
Thank you.
#define GPIO0_BASE 0x5d080000
#define GPIO2_MASK 0x200
#define DR 0x00
#define GDIR 0x04
#define DR_SET 0x84
#define DR_CLR 0x88
#define DR_TOG 0x8C
int gpio_check(void)
{
// bump priority for scheduling the event
pthread_setschedprio( pthread_self(), HIGH_PRIO );
ThreadCtl( _NTO_TCTL_IO, 0 );
ptr_reg = mmap_device_io(0x400, GPIO0_BASE );
printf ("VG\n");
x0 =in32(ptr_reg+GDIR);
out32(ptr_reg+DR, GPIO2_MASK );
out32(ptr_reg+DR, 0 ); // GPIO pin is low
out32(ptr_reg+DR, GPIO2_MASK ); // GPIO pin is high
out32(ptr_reg+DR_SET, GPIO2_MASK ); // GPIO pin doesn't change
out32(ptr_reg+DR_CLR, GPIO2_MASK ); // GPIO pin doesn't change
out32(ptr_reg+DR_TOG, GPIO2_MASK ); // GPIO pin doesn't change
}