Setting up GPIO Input with Polling doesn't seem to work


#1

If I create a GPIO without polling then ioSubscribe seems to work properly. If I set it up with timing values for polling then it always fails. Below is my code.

static s32 gpioEventHandle = -1;
static adl_ioDefs_t gpioDefine = ADL_IO_GPIO | ADL_IO_DIR_IN | 10;
static s32 gpioHandle = -1;

//Turned off keyboard scanning to free up GPIO 10

// In order to set-up an automatic GPIO polling process, the adl_ioEventSubscribe()
// function has to be called before the adl_ioSubscribe().
gpioEventHandle = adl_ioEventSubscribe(GpioHandler);
if (gpioEventHandle < 0 )
{
DEBUG_TRACE((DEBUG_LEVEL_ERROR, “ERROR: adl_ioEventSubscribe() failed. gpioEventHandle=%d”, gpioEventHandle));
DEBUG_PRINT_ADL_ERROR((DEBUG_LEVEL_ERROR, gpioEventHandle));
}

gpioHandle = adl_ioSubscribe(1, &gpioDefine, ADL_TMR_TYPE_100MS, 3, 0);
if (gpioHandle < 0)
{
DEBUG_TRACE((DEBUG_LEVEL_ERROR, “ERROR: adl_ioSubscribe() failed. gpioHandle=%d”, gpioHandle));
DEBUG_PRINT_ADL_ERROR((DEBUG_LEVEL_ERROR, gpioHandle));
if (gpioHandle == ADL_RET_ERR_DONE)
{
DEBUG_TRACE((DEBUG_LEVEL_ERROR, “ERROR: gpioDefine & ADL_IO_GERR_MSK = 0x%x”, gpioDefine & ADL_IO_GERR_MSK));
DEBUG_TRACE((DEBUG_LEVEL_ERROR, “ERROR: gpioDefine & ADL_IO_ERR_MSK = 0x%x”, gpioDefine & ADL_IO_ERR_MSK));
}
}

As written above, adl_ioSubscribe() returns the error ADL_RET_ERR_PARAM always. Unfortunately the documentation isn’t clear on what that means. If I remove the timer type and timer value then adl_ioSubscribe() return success. Why?


#2

http://www.wavecom.com/modules/movie/scenes/forums/viewtopic.php?f=3&t=2106#p13072