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 DOCUMENTATION!!!

This is another documentation complaint.  This times its the PSP User's Guide and the Gpio driver.

There are a few struct's that appear in call to the Gpio driver.  There is no documentation whatsoever on how to use them.  See the PSP 1.30.01 user's guide section 4. and ask youself if you could write a Gpio program from what is there.

The following gives a more concrete example.

Several of the Gpio functions have an argument of type Gpio_PinCmdArg. So, what is in the struct?  Well you have to go the source code to find out.  In Gpio.h you find that the structure has two elements, Uint32 pin, and Uint32 value.  So, how do you specify the pin?   Well again, look in the source code.  In Gpio.c you find that pin is numbered from 1, not from  0, and, its the lower 4 bits.  What about specifying the bank? Well, the code shifts left 4 bits to get the bank index, this time it runs from 0. 

It seems to me that with a little consideration for the user/customer, that could have been in the documentation for the driver along with a description of each function and struct.

 

 

  • Dear Mitch Nelson,

    Thanks for your valuable feebback. We will adress this documentation issue in our next release

    Regards

    Shanmuga

  • Mitch,

     

    First of all sorry for the inconvenience. Yes, the Gpio_PinCmdArg struct is no where explained/documented in the User guides.

     

    (Gpio_PinCmdArg) has two fields:

                    pin – Pin number to be specified here

                    value – Pin value

     

    If you refer the GPIO User guide section: 2.5 Table1 lists all the GPIO pins, associated banks and control registers. There are about 1-144 pins divided into 9 banks.

     Once you decide the bank, and the pin, you can simply set pin to any 1-144 pins and the value can be either setting a value to the pin or setting a direction for the pin(Depending on the API requirement). By specifying this pin number, the driver will internally take care of setting the appropriate bit fields in the registers and the associated banks.

     NOTE: There is a wrong comment made in the example description. It should be - This example demonstrates the use of GPIO driver/module. The sample does this by taking input on GPIO pin GPIO4_0(configured as input pin), via an MMCSD card inserted in the MMCSD slot.

     

    More Info:

    #define GPIO_BANK_0                 0x00       /* BANK 0 */

    #define GPIO_BANK_4                 4u           /* BANK 4 */

    #define GPIO4_0_PIN                  65u         /* This is the Pin Number for the 0th pin of GPIO bank 4 */

     

    Hope this helps..

      

    Thanks & regards,

    Raghavendra