Hi,
I wrote this code to configure the GPIO ports of c6713. I made port 15 (GPO3 PIN) as input. The code was to toggle led(0) when ever gpo pin3 reads signal 1.
I gave a 3.3v input signal. But i dont see any thing happening .
Kindly suggest what is happening. I also pulled down the resistor by switching on dip switch 3 to ON.
// GPIO.c UPIITA-IPN
// JOSE DAVID VALENCIA PESQUEIRA
//
// THIS PROGRAM ALLOWS THE DSP TO SEND A BIT THROUGH A GPIO PIN (PIN 7 IN THIS EXAMPLE)
// TO TURN ON A LED ON
#include <stdio.h>
#include <stdlib.h>
#include <csl_gpio.h>
#include <csl_gpiohal.h>
#include <csl_irq.h>
// CODE TO DEFINE GPIO HANDLE
GPIO_Handle gpio_handle;
// GPIO REGISTER CONFIGURATION
GPIO_Config gpio_config = {
0x00000000, // gpgc = Interruption passthrough mode
0x0000FFFF, // gpen = All GPIO 0-15 pins enabled
0x00000000, // gdir = All GPIO pins as outputs
0x00000000, // gpval = Saves the logical states of pins
0x00000000, // gphm All interrupts disabled for IO pins
0x00000000, // gplm All interrupts for CPU EDMA disabled
0x00000000 // gppol -- default state */
};
// Function prototypes
void delay();
// Function definitions
{
DSK6713_init();
// Open and configure the GPIO
gpio_handle = GPIO_open( GPIO_DEV0, GPIO_OPEN_RESET );
GPIO_config(gpio_handle,&gpio_config);
// Send values through the pins
GPIO_pinRead(gpio_handle,GPIO_PIN3);
delay();
}
main()
{
while(1)
{
If (GPIO_PIN3 ==1)
DSK6713_LED_on(0);
else
DSK6713_LED_off(0);
delay();
}
}