LP-MSPM0G3507: about the usage of the DL_GPIO_readPins function

Part Number: LP-MSPM0G3507

Tool/software:

Hi  
  I would like to ask about the usage of the DL_GPIO_readPins function.Are there any prerequisites for using it?

Why is it that when I add this function in the interrupt of the example, I can read the pin level and get a value,


but when I use it elsewhere, the value I read is always 0?



B.R.

Robert

  • To read a pin, input has to be enabled on it, specifically the IOMUX INENA bit. In Driverlib, INENA is set only for a pin configured as a GPIO Input, and explicitly cleared for an Output.

    I haven't found a (Driverlib) mechanism for setting INENA for an Output pin. 

    You'll probably have to set it yourself, using something like:

    > IOMUX->SECCFG.PINCM[GPIO_GRP_0_PIN_IOMUX] |= IOMUX_PINCM_INENA_ENABLE; // enable input as well

    [Edit: Minor clarification]

  • Okay, I understand. Thank you very much for your guidance.