I am also facing the same problem. I am giving 3 chip select lines to the external decoder. The decoder will convert the 3 chip select lines in to 7 chip select lines. Hence, I want to control the either 1 or 2 or all 3 chip select lines simultaneously. Could you please let me know how I can do that. I am attaching the code what I am using at present. When I execute the below mentioned code then all the 3 CS lines are drawn simultaneously. This is an issue because in this case i cannot output the combination 011. Could you please let me know how can I solve the problem
param = QSPI_CS3;// QSPI_CS1;
printf ("Setting Chip select as CS3, CS2 and CS0 to %d ... ", param);
if (result == ioctl (fd, IO_IOCTL_QSPI_CHIP_SELECT, ¶m))
{
printf ("OK\n");
} else {
printf ("ERROR\n");
}
param = QSPI_CHIP_SELECT_SET_0;
ioctl(fd, IO_IOCTL_QSPI_SET_CHIP_SELECT_STATE, ¶m);
param = QSPI_CS2;
printf ("Setting Chip select as CS3, CS2 and CS0 to %d ... ", param);
if (result == ioctl (fd, IO_IOCTL_QSPI_CHIP_SELECT, ¶m))
{
printf ("OK\n");
} else {
printf ("ERROR\n");
}
param = QSPI_CHIP_SELECT_SET_0;
ioctl(fd, IO_IOCTL_QSPI_SET_CHIP_SELECT_STATE, ¶m);
param = QSPI_CS0;// QSPI_CS1;
printf ("Setting Chip select as CS3, CS2 and CS0 to %d ... ", param);
if (result == ioctl (fd, IO_IOCTL_QSPI_CHIP_SELECT, ¶m))
{
printf ("OK\n");
} else {
printf ("ERROR\n");
}
/* Bring CS low test*/
param = QSPI_CHIP_SELECT_SET_0;
ioctl(fd, IO_IOCTL_QSPI_SET_CHIP_SELECT_STATE, ¶m);
/* Bring CS high */
param = QSPI_CHIP_SELECT_SET_1;
ioctl(fd, IO_IOCTL_QSPI_SET_CHIP_SELECT_STATE, ¶m);