AnsweredAssumed Answered

Accessing DAI_P19 and DAIP_20

Question asked by MikeSmithCanada on Dec 6, 2010
Latest reply on Jan 13, 2011 by BartW

Hi

 

I am trying to read the 4 switches on the 21469

I have worked out how to access SW1 and SW2 as FLAG1 and FLAG2

 

unsigned int ReadSwitches(void) {
    int value = 0;
   
    value = (value << 1) | poll_flag_in (READ_FLAG2, RETURN_FLAG_STATE);
    value = (value << 1) | poll_flag_in (READ_FLAG1, RETURN_FLAG_STATE);


    return value;
}

 

However, I can't find how to access the SW3 and SW4 via DAI_P19 and DAIP_20.

I presume the 21469 help pages mean  DAI_P19 and DAI_P20 rather than DAI_P19 and DAIP_20

 

These don't seem to be specifically defined in 21469.h, cdef21469,h  or def21469.h  include files

 

Any help would be appreciated

 

The pbled.c file (power-up-test) only shows these pins accessed as interrupts and not as push-bottons and the other 21469 examplesdon't seem to mention simple push button operations

 

I found this in pbled.c but I am missing the reads operations

 

/* pin assignments in SRU_PIN3 (Group D) */

 

    SRU(LOW,DAI_PB19_I);    /* assign pin buffer 19 low so it is an input */
    SRU(LOW,DAI_PB20_I);    /* assign pin buffer 20 low so it is an input */

 

    /* route MISCA signals in SRU_EXT_MISCA (Group E) */

 

  SRU(DAI_PB19_O,MISCA1_I);    /* route so that DAI pin buffer 19 connects to MISCA1 */
  SRU(DAI_PB20_O,MISCA2_I);    /* route so that DAI pin buffer 20 connects to MISCA2 */

 

  /* pin buffer disable in SRU_PINEN0 (Group F) */
   
  SRU(LOW,PBEN19_I);    /* assign pin 19 low so it is an input */
    SRU(LOW,PBEN20_I);    /* assign pin 20 low so it is an input */

 

Thanks

Mike Smith

Outcomes