Part Number: PROCESSOR-SDK-OMAPL138
Other Parts Discussed in Thread: OMAP-L138, OMAPL138
Tool/software: Code Composer Studio
Hello,
In OMAP-L138 While configuring GPIO as an Input using ccsv6,
I am unable to read GPIO.
This is my code:
#include <gpio.h>
#include <psc.h>
#include <soc_OMAPL138.h>
#include <lcdkOMAPL138.h>
#include "interrupt.h"
/****************************************************************************/
/* LOCAL FUNCTION PROTOTYPES */
/****************************************************************************/
static void Delay(volatile unsigned int delay);
int i=0,v=0;
//unsigned int cardDetFlag = FALSE;
/****************************************************************************/
/* GLOBAL VARIABLES */
/****************************************************************************/
/****************************************************************************/
/* LOCAL FUNCTION DEFINITIONS */
/****************************************************************************/
int main(void)
{
/* The Local PSC number for GPIO is 3. GPIO belongs to PSC1 module.*/
PSCModuleControl(SOC_PSC_1_REGS, HW_PSC_GPIO, PSC_POWERDOMAIN_ALWAYS_ON,
PSC_MDCTL_NEXT_ENABLE);
/* Pin Multiplexing of pin 12 of GPIO Bank 6.*/
GPIOBank3Pin13PinMuxSetup();
GPIODirModeSet(SOC_GPIO_0_REGS, 62, GPIO_DIR_INPUT);
GPIOIntTypeSet(SOC_GPIO_0_REGS, 62, GPIO_INT_TYPE_BOTHEDGE);
GPIOPinIntClear(SOC_GPIO_0_REGS, 62);
while(1)
{
if ( GPIOPinRead(SOC_GPIO_0_REGS, 62))
{
printf("gpio read 1 .\n\r");
}
else
{
printf("gpio read 0\n\r");
}
}
}
static void Delay(volatile unsigned int delay)
{
while(delay--);
}
/*****************************END OF FILE************************************/
Do you have any example code for GPIO as an Input? (without using interrupt)
I can configure GPIO as an Output but unable to configure as an Input.
Regards,
Kshitika.