AnsweredAssumed Answered

System Services Library BF534 (BRAEMAR)

Question asked by Colin on Nov 10, 2009
Latest reply on Nov 13, 2009 by PrasanthR

I am using the BF534 device and the SSL.

I am trying to configure a callback on rising edge on pin PH12.

I assume that the peripheral ID is ADI_INT_DMA1_ETHERNET_RX_PORTH_A

 

Q1 Is that the correct Perihperal ID to use?  (How could it ever differ?)

 

My code fragment(without error checking, for clarity):
   adi_flag_Open          (ADI_FLAG_PH12);
   adi_flag_SetDirection(ADI_FLAG_PH12,    ADI_FLAG_DIRECTION_INPUT);

 

    /* Now use the input as an interrupt source */
    adi_flag_InstallCallback(                                            // installs a callback for a flag
        ADI_FLAG_PH12,                                                // ADI_FLAG_ID            FlagID,             // flag ID
        ADI_INT_DMA1_ETHERNET_RX_PORTH_A,         // ADI_INT_PERIPHERAL_ID  PeripheralID,       // peripheral ID
        ADI_FLAG_TRIGGER_RISING_EDGE,                   // ADI_FLAG_TRIGGER       Trigger,            // trigger
        TRUE,                                                                 // u32                    WakeupFlag,         // wakeup flag (TRUE/FALSE) from sleep?
        (void *)0x1234,                                                    // void                  *ClientHandle,       // client handle argument passed in callbacks
        adi_dcb_ManagerHandle,                                   // ADI_DCB_HANDLE         DCBHandle,          // deferred callback service handle
        dist_CallbackFunction                                        // ADI_DCB_CALLBACK_FN    ClientCallback      // client callback function
    );

The result is that the library adi_flag.c has an interrupt handler FlagHandler()

that calls adi_flag_GetInterruptMask() that tries to establish if the bit is enabled

in the mask register. However, it  tests "PeripheralID == ADI_INT_PORTFG_A"

and if false, chooses mask B.

 

Q 2 Surely it should be like:

 

    if (PeripheralID == ADI_INT_PORTFG_A || PeripheralID == ADI_INT_DMA1_ETHERNET_RX_PORTH_A) {
        pRegister = pPort->MaskAData;   // Ports F G & H - Mask A
    } else {
        pRegister = pPort->MaskBData;   // Ports               - Mask B
    }

 

in order to handle the Port H pins too?

 

The modified version seem to work as expected. Is this the correct fix?

 

Regards,

 

Colin.

Outcomes