/** ******************************************************************************* * * @file p2p_ekeying.c * @authors fatih.bellachia@lapp.in2p3.fr * @date 30/09/2015 * @version v0r1 * @brief Example of backplane E-Keying registration. * For more information see: * 3.7.2 Point-to-Point E-Keying * PICMG 3.0 R3.0 ATCA Base Specification * ******************************************************************************* */ /* Includes ------------------------------------------------------------------*/ #include #include #include #include #include #include /** @addtogroup Component * @{ */ /** @defgroup Backplane_E-Keying * @{ */ /* Private typedef -----------------------------------------------------------*/ /* Private define ------------------------------------------------------------*/ // Must fit with the Link Descriptors defined in PICMG Board // Point-to-Point Connectivity Record information in the FRU #define BASE_IF_CH1_PORT0 0x00001101 #define BASE_IF_CH2_PORT0 0x00001102 /* Private macro -------------------------------------------------------------*/ /* Private variables ---------------------------------------------------------*/ /* Private function prototypes -----------------------------------------------*/ /* Public variables ----------------------------------------------------------*/ /* Private functions ---------------------------------------------------------*/ /*----------------------------------------------------------------------------*/ static bool SetPortStateCallback(linkDescriptor linkInfo, char state) /*----------------------------------------------------------------------------*/ { LED_Mask_t eLedMask; dprintf(DBG_LVL1, "link-info(0x%08x) state(%d)\n", linkInfo, state); // // Emulate activation/deactivation of Link // - Port enabled: LED blinking // - Port disabled: LED Off // // Check Link Descriptor if (linkInfo == BASE_IF_CH1_PORT0) eLedMask = LED_1; else if (linkInfo == BASE_IF_CH2_PORT0) eLedMask = LED_2; else return true; // Change state of Link if (state == 1) LED_Blink(eLedMask, 200, 1800, 0); else LED_Off(eLedMask); return true; } /* Public functions ----------------------------------------------------------*/ /*----------------------------------------------------------------------------*/ bool P2PEKeyingInit(void) /*----------------------------------------------------------------------------*/ { bool bRtn = true; bRtn &= EKRegisterFunc(BASE_IF_CH1_PORT0, SetPortStateCallback); bRtn &= EKRegisterFunc(BASE_IF_CH2_PORT0, SetPortStateCallback); return bRtn; } MODULE_BEGIN_DECL(ekeying, 1) MODULE_NAME("Point-to-Point E-Keying") MODULE_AUTHOR("fatih.bellachia@lapp.in2p3.fr") MODULE_INIT(P2PEKeyingInit) MODULE_CLEANUP(NULL) MODULE_PROCESS(NULL, NULL) MODULE_END_DECL /** * @} */ /** * @} */