• Join
  • Sign In with my.TI Login
Texas Instruments
  • Products
  • Applications
  • Tools & Software
  • Support & Community
  • Sample & Buy
  • About TI
Sample & Purchase Cart Sample & Purchase Cart
  • Search
  • Advanced
TI E2E™ Community
  • Support Forums
  • Blogs
  • Groups
  • Videos
  • 简体中文
  • More ...
TI Home » TI E2E Community » Support Forums » Embedded Software » StarterWare » StarterWare forum » SitaraWare GPIOSetDirMode
Share
StarterWare
  • Forum
Options
  • Subscribe via RSS

Forums

SitaraWare GPIOSetDirMode

This question is answered
Eric Wetzel
Posted by Eric Wetzel
on Jul 26 2011 07:08 AM
Prodigy100 points

In the GPIOSetDirMode function in SitaraWare, the second argument is "the serial number of the GPIO pin." Where is this documented?

It's mentioned in the SitaraWare User's Guide, but finding it for a given pin isn't documented. The AM17x/AM18x GPIO User's Guide (SPRUFV2A) contains no mention of a serial number. The AM1808 datasheet (SPRS653B), which contains the Pin Map of the device, contains the GPx[y] names and the BGA grid references (e.g. V3 = GP7[13]), but still no mention of a serial number.

According to the SitaraWare Migration Notes, the pin serial number was used to keep the number of arguments the same. The first argument to the StellarisWare function was the base address of the relevant GPIO bank, but since Sitara only has one base register, I think that the first argument to this function could be made more useful; perhaps something that implies the bank you're trying to set. Perhaps, to be more like StellarisWare, some defines could be added like:

#define GPIO_O_DIR 0x0
#define GPIO_O_OUT_DATA 0x4
#define GPIO_O_SET_DATA 0x8
...
#define GPIO_O_INTSTAT 0x24

#define GPIO_BANK01_BASE (SOC_GPIO_0_REGS + 0x10)
#define GPIO_BANK23_BASE (SOC_GPIO_0_REGS + 0x38)

 

I accept that some things are going to change between these two platforms, but in the interests of migrating from Stellaris to Sitara, the very first function in the Migration Notes could have been made more consistent.

Report Abuse
  • Reply
You have posted to a forum that requires a moderator to approve posts before they are publicly available.
All Replies
  • Frank Walzer
    Posted by Frank Walzer
    on Jul 26 2011 09:36 AM
    Genius13765 points

    See table 1 in the GPIO UG. The first column 'GPIO Pin Number' is the value you need.

    I ran into the same issue recently and I already told the Sitaraware team that I see no reason why there can't be a header file which defines this values for a certain platform... So no need for PDF juggling.

    Regards.

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Eric Wetzel
    Posted by Eric Wetzel
    on Jul 26 2011 10:00 AM
    Prodigy100 points

    Ah, there it is.

    On a similar note, the macro for calculating the offset of the GPIO direction register in include/hw/hw_gpio.h won't work intuitively:

    #define GPIO_DIR(n)        (0x10 + (0x28 * n))

    GPIO_DIR(0) will work correctly, but GPIO_DIR(1) will not. GPIO_DIR(1) will be the offset to DIR23 instead of DIR01.

    Do you know if anyone who was involved with the creation of StellarisWare is on the SitaraWare team? Should I bring up issues like these through the mailing list sitaraware_support@list.ti.com, or do they monitor the forums? Do they accept patches?

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Frank Walzer
    Posted by Frank Walzer
    on Jul 26 2011 10:07 AM
    Genius13765 points

    Eric,

    no, I think Sitaraware is done by different people really.

    Yes, I think we welcome feedback. Safe way would be to send the info (especially bugs) to the support list. I assume forums will be watched too but there is a chance it gets missed.

    Patches might make it easier to verify and confirm issues. But I can't speak for the team if and when any changes get accepted. 

    Regards.

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Baskaran Chidambaram
    Posted by Baskaran Chidambaram
    on Oct 11 2011 10:30 AM
    Verified Answer
    Verified by Baskaran Chidambaram
    Expert4435 points

    Eric,

    In the macro #define GPIO_DIR(n)        (0x10 + (0x28 * n))   'n' refers to the register number (nth DIRxx register) and not the pin number. We will add appropriate comment in the header file.

    The GPIO DAL API's (in drivers/gpio.c) the function GPIODirModeSet() takes pin number as one of the parameters, calculates the register number and passes the register number to the above macro to calculate exact register address.

    So the above macro will work as expected.

     

    Regards

    Baskaran

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
TI E2E™ Community
  • Support Forums
  • Blogs
  • Videos
  • Groups
  • Site Support & Feedback
  • Settings
TI E2E™ Community Groups
  • TI University Program
  • Make the Switch
  • Microcontroller Projects
  • Motor Drive & Control
Other Communities
  • Deyisupport
  • Designsomething.org
  • beagleboard.org
  • TI on Element 14
  • TI on TechXchangeSM
Other Technical & Support Resources
  • WEBENCH® Design Center
  • Product Information Centers
  • Technical Documents
  • TI Design Network
  • TI Technical Articles
  • TI Training

All content and materials on this site are provided "as is". TI and its respective suppliers and providers of content 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. TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with respect to these materials. 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, its suppliers and providers of content 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.

Follow Us Texas Instruments on Facebook Texas Instruments on Twitter Texas Instruments on LinkedIn Texas Instruments on Google+
TI Worldwide | Contact Us | my.TI Login | Site Map | Corporate Citizenship | mobile m.ti.com (Mobile Version)

TI is a global semiconductor design and manufacturing company. Innovate with 100,000+ analog ICs and
embedded processors, along with software, tools and the industry’s largest sales/support staff.

© Copyright 1995-2013 Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy Policy | Terms of Use