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), 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.
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.
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 firstname.lastname@example.org, or do they monitor the forums? Do they accept patches?
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.
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.
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.
TI is a global semiconductor design and manufacturing company. Innovate with 100,000+ analog ICs andembedded processors, along with software, tools and the industry’s largest sales/support staff.