Skip to main content
Visitor II
January 30, 2007
Question

Bug in GPIO_ANAPinConfig() in 91x_gpio.c

  • January 30, 2007
  • 2 replies
  • 729 views
Posted on January 30, 2007 at 07:20

Bug in GPIO_ANAPinConfig() in 91x_gpio.c

    This topic has been closed for replies.

    2 replies

    Visitor II
    May 17, 2011
    Posted on May 17, 2011 at 09:35

    I think there's a bug in GPIO_ANAPinConfig(), which configures pins of PORT4 for analog input. The line

    SCU->GPIOOUT[4] &= ~(0x3<

    seems wrong, and stomps on other pins in PORT4. I'm not sure if this line is needed at all in this function, but something like this seems correct:

    int shift;

    switch(GPIO_ANAChannel) {

    case GPIO_ANAChannel0:

    shift = 0;

    break;

    case GPIO_ANAChannel1:

    shift = 2;

    break;

    case GPIO_ANAChannel2:

    shift = 4;

    break;

    ... etc. ...

    }

    SCU->GPIOOUT[4] &= ~(0x3<

    Visitor II
    May 17, 2011
    Posted on May 17, 2011 at 09:35

    Hi jonny_h,

    This error will be corrected in the next release v1.2 of the library which will be available next month.

    Thanks and best regards,

    mirou