Other Parts Discussed in Thread: CC3200
Hi everyone,
I'm reading the cc3200 datasheet (
) and I'm reading some topics on the argument, but I don't understand clearly How distinguish the GPIO of cc3200.
If i read the email example, it uses the pins 4 and 15 of the cc3200 that matches with the GPIO 13(Pin 4) and GPIO 22(pin 15).
Then the GPIO_13 -> GPIOA1_BASE and GPIO_22 ->GPIOA2_BASE.
From the pin multiplexing configuration I see that I can configure the pin as I need, so, if I need of GPIO_13 for pin 4 I must set the pinout #6 that corresponds to GPIO_PIN_5, now if I want to use the GPIO 16, and 17 that matches with pin 7,8
GPIO_16->GPIOA1_BASE and GPIO_17->GPIOA1_BASE and for use them as GPIO_16 and GPIO_17 I must set pinout #6
but for distinguish them I've selected the #2 for 16 and #5 for 17
so in the pinmux I write
//I don't know if I got it right, because I don't understand How set ucPins
PinTypeGPIO(PIN_07, PIN_MODE_0, false);
GPIODirModeSet(GPIOA1_BASE, 0x20, GPIO_DIR_MODE_IN);
PinTypeGPIO(PIN_08, PIN_MODE_0, false);
GPIODirModeSet(GPIOA1_BASE, 0x20, GPIO_DIR_MODE_IN);
And when I set interrupt for them
MAP_GPIOIntClear(GPIOA1_BASE,GPIO_PIN_1);
MAP_IntPendClear(INT_GPIOA1);
MAP_IntEnable(INT_GPIOA1);
MAP_GPIOIntEnable(GPIOA1_BASE,GPIO_PIN_1);
MAP_GPIOIntClear(GPIOA1_BASE,GPIO_PIN_5);
MAP_IntPendClear(INT_GPIOA1);
MAP_IntEnable(INT_GPIOA1);
MAP_GPIOIntEnable(GPIOA1_BASE,GPIO_PIN_5);
And for the handler
void Button_IF_Init(P_INT_HANDLER S2InterruptHdl,P_INT_HANDLER S3InterruptHdl )
{
if(S3InterruptHdl != NULL)
{
//
// Set Interrupt Type for GPIO
//
MAP_GPIOIntTypeSet(GPIOA1_BASE,GPIO_PIN_2,GPIO_FALLING_EDGE);
g_S3InterruptHdl = S3InterruptHdl;
//
// Register Interrupt handler
//
#if defined(USE_TIRTOS) || defined(USE_FREERTOS) || defined(SL_PLATFORM_MULTI_THREADED)
// USE_TIRTOS: if app uses TI-RTOS (either networking/non-networking)
// USE_FREERTOS: if app uses Free-RTOS (either networking/non-networking)
// SL_PLATFORM_MULTI_THREADED: if app uses any OS + networking(simplelink)
osi_InterruptRegister(INT_GPIOA1,(P_OSI_INTR_ENTRY)GPIOs3IntHandler, \
INT_PRIORITY_LVL_1);
#else
MAP_IntPrioritySet(INT_GPIOA1, INT_PRIORITY_LVL_1);
MAP_GPIOIntRegister(GPIOA1_BASE, GPIOs3IntHandler);
#endif
//
// Enable Interrupt
//
MAP_GPIOIntClear(GPIOA1_BASE,GPIO_PIN_2);
MAP_GPIOIntEnable(GPIOA1_BASE,GPIO_INT_PIN_2);
}
if(S2InterruptHdl != NULL)
{
//
// Set Interrupt Type for GPIO
//
MAP_GPIOIntTypeSet(GPIOA1_BASE,GPIO_PIN_5,GPIO_FALLING_EDGE);
g_S2InterruptHdl = S2InterruptHdl;
//
// Register Interrupt handler
//
#if defined(USE_TIRTOS) || defined(USE_FREERTOS) || defined(SL_PLATFORM_MULTI_THREADED)
// USE_TIRTOS: if app uses TI-RTOS (either networking/non-networking)
// USE_FREERTOS: if app uses Free-RTOS (either networking/non-networking)
// SL_PLATFORM_MULTI_THREADED: if app uses any OS + networking(simplelink)
osi_InterruptRegister(INT_GPIOA1,(P_OSI_INTR_ENTRY)GPIOs2IntHandler, \
INT_PRIORITY_LVL_1);
#else
MAP_IntPrioritySet(INT_GPIOA1, INT_PRIORITY_LVL_1);
MAP_GPIOIntRegister(GPIOA1_BASE, GPIOs2IntHandler);
#endif
//
// Enable Interrupt
//
MAP_GPIOIntClear(GPIOA1_BASE,GPIO_PIN_1);
MAP_GPIOIntEnable(GPIOA1_BASE,GPIO_INT_PIN_1);
}
}
I do not know if I understand it and I would like some clarification on the use of GPIO as previously outlined by me. I see how i did the entire procedure of setting the interrupt as shown in the email.
Also known ever since that GPIO datasheets 26 and 27 are not used, it means that I can not write a program that uses them?
I would also like to use your own configuration as shown in the examples, I can leave SW1 and SW2 to enable the buttons?