I have problems trying to set GPIO5[10] and GPIO5[11].
I add those rows at the end of the gpio_evminit.c file to select the right pin multiplexing:
sysRegs->PINMUX8 |= ( (CSL_SYSCFG_PINMUX8_PINMUX8_23_20_GPIO5_10) << \ (CSL_SYSCFG_PINMUX8_PINMUX8_23_20_SHIFT) );
sysRegs->PINMUX8 |= ( (CSL_SYSCFG_PINMUX8_PINMUX8_27_24_GPIO5_11) << \ (CSL_SYSCFG_PINMUX8_PINMUX8_27_24_SHIFT) );
I had rebuild the evmInit.pjt then I compile my project, but it does not work. What is wrong?
Gpio_Handle gpio0;
void main(void){ Gpio_Params gpioParams = Gpio_PARAMS; Gpio_PinCmdArg UserPinCmdArg; gpioParams.instNum = 0; gpioParams.BankParams[5].inUse = Gpio_InUse_No; gpioParams.BankParams[5].PinConfInfo[10].inUse = Gpio_InUse_No; gpioParams.BankParams[5].PinConfInfo[11].inUse = Gpio_InUse_No; /* open the GPIO driver to get a handle to it */ gpio0 = Gpio_open(&gpioParams); /* Call the EVM specific initialization function */ configureGpio(); /* Configure GPIO5_10 and GPIO5_11 as an output */ UserPinCmdArg.pin = 11; UserPinCmdArg.value = Gpio_Direction_Output; Gpio_setPinDir(gpio0,&UserPinCmdArg); UserPinCmdArg.pin = 12; UserPinCmdArg.value = Gpio_Direction_Output; Gpio_setPinDir(gpio0,&UserPinCmdArg); // Setting GPIO5[10] to LOW UserPinCmdArg.pin = 11; UserPinCmdArg.value = LOW; Gpio_setPinVal(gpio0,&UserPinCmdArg); // Setting GPIO5[11] to HIGH UserPinCmdArg.pin = 12; UserPinCmdArg.value = HIGH; Gpio_setPinVal(gpio0,&UserPinCmdArg); Gpio_close(gpio0); return;}
I was looking for more information and I only found in the cslr_gpio.h was:
// Bank registers and Pin tokens
#define GP5 2
#define GP5P10 (1 << 26)#define GP5P11 (1 << 27)
I thing somewhere I have to select the bank register 2 and bits 26th and 27th but I don't know neither how nor where.
Where can I find more information about how works pin multiplexing and everything I need?
Thanks!
Replace (in all lines that use it):
UserPinCmdArg.pin = 11;
by
UserPinCmdArg.pin = 0x5B;
Also replace (in all lines that use it):
UserPinCmdArg.pin = 12;
UserPinCmdArg.pin = 0x5C;
When you pass the pin number to the driver, the first 4 bits are the pin number, but the next 4 bis have to have the bank number...
How are you testing the state of these pins?
The pins you were using before were tied to the LEDs, but these are not, so I wonder how you are checking the state...
I am using a tester, putting one cable at ground and other at the audio expansion connector pin 69 (T_AXR1[10] / GPIO5_10) and 71 (T_AXR1[11] / GPIO5_11) respectively.
Maybe I am doing something wrong in my program or configuration. Could you send to me an example setting those pins to HIGH and LOW?
I am really frustrated on that and I am loosing to much time.
Thank you very much for helping me.
ALL CONTENT AND MATERIALS ON THIS SITE ARE PROVIDED "AS IS". TI AND ITS RESPECTIVE SUPPLIERS MAKE NO REPRESENTATIONS ABOUT THE SUITABILITY OF THESE MATERIALS FOR ANY PURPOSE AND DISCLAIM ALL WARRANTIES AND CONDITIONS WITH REGARD TO THESE MATERIALS, INCLUDING BUT NOT LIMITED TO, ALL IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT OF ANY THIRD PARTY INTELLECTUAL PROPERTY RIGHT. NO LICENSE, EITHER EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, IS GRANTED BY TI. USE OF THE INFORMATION ON THIS SITE MAY REQUIRE A LICENSE FROM A THIRD PARTY, OR A LICENSE FROM TI.
Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Terms of Use of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Terms of Use of this site. TI and its suppliers reserve the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.