TI E2E Community
Tiva™ ARM® Microcontrollers
Tiva™ ARM® C Series Microcontrollers Forum
Setting GPIOCTL bits
I trying to use I2C2 on an LM4F231 using CCS5. I understand that the GPIOCTL bits in Port E to select the I2C peripheral. Is this something I must do explicity or is there a StellarisWare library routine that will help me?
I expect to see a call that involves GPIO_PE4_I2C2SCL and GPIO_PE5_I2C2SDA but haven't been able to find it. Also, supporting this is that GPIO_PCTL for port E is at zero after I set up the I2C hardware.
It seems that I'm getting good at answering my own questions - or being able to ask questions with reasonably obvious answers!
The function desired is GPIOPinConfigure() where the parameter is taken from the appropriate section of pin_map.h. This has the prequisite that "driverlib/pin_map.h" be included prior to the call.
To enable the I2C peripheral you must first enable the port then configure the pins for their I2C function. This can all be done using StellarisWare calls:
// GPIO port E needs to be enabled so these pins can be used.
// Configure the pin muxing for I2C0 functions on port E4 and E5.
Also make sure you include the correct headers to support the functions you would like to use:
For more information please see the documentation included within StellarisWare. "<Your StellarisWare install directory>/docs". Also leveraging some existing examples can help as well.
David Pfaltzgraff function desired is GPIOPinConfigure()
You may wish to consider function GPIOPinType() as well. These 2 functions are often bound together - more modern, high performance MCUs require such treatment...
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.