I am having a problem with an error that says : "error #20 identifier "GPIO_PB6_T0CCP0" is undefined.
I have included the header file for pin_map where this deceleration is located so how is it saying it is undefined?
#include "inc/hw_types.h"
#include "inc/hw_memmap.h"
#include "driverlib/sysctl.h"
#include "driverlib/gpio.h"
#include "driverlib/pin_map.h"
#include "driverlib/timer.h"
#include "inc/hw_ints.h"
#include "driverlib/interrupt.h"
volatile unsigned long pulseCount;
int main(void)
{
unsigned long ulPeriod, dutyCycle;
//40 MHz system clock
SysCtlClockSet(SYSCTL_SYSDIV_5|SYSCTL_USE_PLL|SYSCTL_XTAL_16MHZ|SYSCTL_OSC_MAIN);
ulPeriod = 1000;
dutyCycle = 250;
//Set the peripherals that will be used
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOC);
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOF);
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOB);
GPIOPinConfigure(GPIO_PB6_T0CCP0);
GPIOPinTypeTimer(GPIO_PORTB_BASE, GPIO_PIN_6);
GPIOPinTypeGPIOOutput(GPIO_PORTF_BASE, GPIO_PIN_1|GPIO_PIN_2|GPIO_PIN_3);
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOC);
//timer config
SysCtlPeripheralEnable(SYSCTL_PERIPH_TIMER0);
TimerConfigure(TIMER0_BASE, TIMER_CFG_SPLIT_PAIR|TIMER_CFG_A_PWM);
TimerLoadSet(TIMER0_BASE, TIMER_A, ulPeriod -1);
TimerMatchSet(TIMER0_BASE, TIMER_A, dutyCycle); //Duty Cycle
TimerEnable(TIMER0_BASE, TIMER_A);
// use PC7 as external interrupt:
GPIOPinTypeGPIOInput(GPIO_PORTC_BASE, GPIO_PIN_7|GPIO_PIN_6);
GPIOPinIntClear(GPIO_PORTC_BASE,GPIO_PIN_7|GPIO_PIN_6);
GPIOIntTypeSet(GPIO_PORTC_BASE, GPIO_PIN_7|GPIO_PIN_6, GPIO_RISING_EDGE);
GPIOPinIntEnable(GPIO_PORTC_BASE, GPIO_PIN_7|GPIO_PIN_6);
IntEnable(INT_GPIOC);
// Enable processor interrupts.
IntMasterEnable();
while(1)
{
}
}
void chAHandler(void){
unsigned int ulInts = GPIOPinIntStatus(GPIO_PORTC_BASE, true) ;
if(ulInts & 0x80)
{
// Handle GPIO pin 7.
GPIOPinIntClear(GPIO_PORTC_BASE,GPIO_PIN_7);
pulseCount++;
}
if(ulInts & 0x40)
{
// Handle GPIO pin 6.
GPIOPinIntClear(GPIO_PORTC_BASE,GPIO_PIN_6);
pulseCount++;
}
}