pins[0] |= GPIO_PIN_STATUS_1; //LED1 on
pins[1] &= ~GPIO_PIN_STATUS_0; //LED2 off
pins[2] |= GPIO_PIN_STATUS_1; //LED3 on
ioctl(output_port, GPIO_IOCTL_WRITE, &pins);
This code is not working correctly.
Please try as follow...
// write something
pins1[0] |= GPIO_PIN_STATUS_1;
pins1[1] &= ~GPIO_PIN_STATUS_0;
pins1[2] |= GPIO_PIN_STATUS_1;
ioctl(ptf1, GPIO_IOCTL_WRITE, &pins1);
// toggle something
pins1[0] &= ~GPIO_PIN_STATUS_0;
pins1[1] |= GPIO_PIN_STATUS_1;
pins1[2] &= ~GPIO_PIN_STATUS_0;
ioctl(ptf1, GPIO_IOCTL_WRITE, &pins1);
This code makes all LEDs to ON.
Because GPIO_PIN_STATUS_0 is defined as 0x00000000.
As a result,
pins1[0] &= ~GPIO_PIN_STATUS_0;
this code can't change pins1[0]'s output.
Follow code is woring well.
// write something
pins1[0] |= GPIO_PIN_STATUS_1;
pins1[1] &= ~GPIO_PIN_STATUS_1;
pins1[2] |= GPIO_PIN_STATUS_1;
ioctl(ptf1, GPIO_IOCTL_WRITE, &pins1);
// toggle something
pins1[0] &= ~GPIO_PIN_STATUS_1;
pins1[1] |= GPIO_PIN_STATUS_1;
pins1[2] &= ~GPIO_PIN_STATUS_1;
ioctl(ptf1, GPIO_IOCTL_WRITE, &pins1);
FYI.
BR.