This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

GPIO problem..

hi,sir,

could you help me to check, here is my problem:

i want to set  the GPIO 156 to high,below is my souce code:

 

DWORD g_gpioaudioenable=156;

DWORD PinMode=1;

        DWORD dwMode[2] = {g_gpioaudioenable, GPIO_DIR_OUTPUT};

        HANDLE g_hGpio = CreateFile(GPIO_DEVICE_NAME, 0, 0, NULL, 0, 0, NULL);

DEBUGMSG(ZONE_IST, (

L" PinMode is (%d)\r\n",PinMode

));

DeviceIoControl(g_hGpio, IOCTL_GPIO_GETBIT, &g_gpioaudioenable,

      sizeof(g_gpioaudioenable), &PinMode, sizeof(PinMode), NULL, NULL

     );

DEBUGMSG(ZONE_IST, (

L" init the audio enable pin finished..,PinMode is (%d)\r\n",PinMode

));

DeviceIoControl(g_hGpio, IOCTL_GPIO_SETMODE, &dwMode,

       sizeof(dwMode), 0, 0, NULL, NULL

       );

DEBUGMSG(ZONE_IST, (L" set the audio pin output..\r\n"));

DeviceIoControl(g_hGpio, IOCTL_GPIO_SETBIT, &g_gpioaudioenable,

      sizeof(DWORD), NULL, 0, NULL, NULL

     );

DeviceIoControl(g_hGpio, IOCTL_GPIO_GETBIT, &g_gpioaudioenable,

      sizeof(g_gpioaudioenable), &PinMode, sizeof(PinMode), NULL, NULL

     );

DEBUGMSG(ZONE_IST, (

L" init the audio enable pin finished..,PinMode is (%d)\r\n",PinMode

));

 

and ,the debug message is :

 PinMode is (1)

 init the audio enable pin finished..,PinMode is (0)

 set the audio pin output..

 init the audio enable pin finished..,PinMode is (0)

 

so, after the IOCTL_GPIO_SETBIT command ,it seems that the pinmode is not set to high,could you help me to check?