AnsweredAssumed Answered

Regarding configuration of GPIOs in TRK KEA128 board

Question asked by Jashan Mahadevu on May 29, 2015
Latest reply on Jun 1, 2015 by Jashan Mahadevu

hi,

    i am working on TRK KEA128 GPIOs, i was able to work with the user buttons (that were on pins PTD0 and PTD1) that were on the board and also by connecting my external switches on to PTD0 and PTD1. Once i started configuring the other GPIO dedicated pins( to be specific PTE7,PTH0 and PTH1), i couldnt read the pin status! Am i missing anything here ??

 

This is what I am using to configure and enable the pins to be input .

 

CONFIG_PIN_AS_GPIO(D,PTD0,INPUT);      /* Configure SW1 (PTD0) as an input */  

CONFIG_PIN_AS_GPIO(D,PTD1,INPUT);      /* Configure SW2 (PTD1) as an input */

CONFIG_PIN_AS_GPIO(E,PTE7,INPUT);      /* Configure PTE7 as an  input from external switch */

CONFIG_PIN_AS_GPIO(H,PTH0,INPUT);      /* Configure PTH0 as an  input from external switch */

CONFIG_PIN_AS_GPIO(H,PTH1,INPUT);      /* Configure PTH1 as an  input from external switch */ 

 

ENABLE_INPUT(D,PTD0);

ENABLE_INPUT(D,PTD1);

ENABLE_INPUT(E,PTE7);

ENABLE_INPUT(H,PTH0);

ENABLE_INPUT(H,PTH1);

 

 

and check status by,

 

if( (GPIOA_PDIR & GPIO_PDIR_PDI(0x1000000)) >> 24){

   LED3_OFF;

}else{

   LED3_ON;

}

 

if( (GPIOA_PDIR & GPIO_PDIR_PDI(0x2000000)) >> 25){

   LED2_OFF;

}else{

   LED2_ON;

}

 

if( (GPIOB_PDIR & GPIO_PDIR_PDI(0x80)) >> 7){

   LED1_OFF;

}else{

   LED1_ON;

}

 

 

this is how (Fig 1) i have connected to external switch !

 

IMG_20150529_134910936.jpg

                                                                                Fig 1

Outcomes