Esempio n. 1
0
/**
 ******************************************************************************
 ** \brief Init External Interrupts
 **
 ** This function initializes the external interrupts according the given
 ** configuration.
 **
 ** \param [in]  Config        EXINT configuration parameters
 **
 ** \retval Ok                     EXINT initialized
 ** \retval ErrorInvalidParameter  pstcConfig == NULL or Illegal mode
 ******************************************************************************/
err_t WyzBee_Exint_Init(WyzBee_exint_config_t* Config)
{
   stc_exint_config_t pstcConfig;
   uint8 ret;
   pstcConfig.abEnable[11]   =   Config->abEnable[11];
   pstcConfig.aenLevel[11]	 =	 Config->aenLevel[11];
   pstcConfig.apfnExintCallback[11]   =   Config->apfnExintCallback[11];
   WyzBeeSetPin_INT11_1(0u);
   if(!(Exint_Init(&pstcConfig)))
	   return ERR_NONE;
   else return ERR_INVALID_PARMS;


} // Exint_DisableChannel
Esempio n. 2
0
/**
 * @fn			void rsi_irq_start(void)
 * @brief		Starts and enables the SPI interrupt
 * @param[in]	none
 * @param[out]	none
 * @return		none
 * @description This HAL API should contain the code to initialize the register related to interrupts.
 */
void rsi_irq_start(void)
{
		extern stc_exint_config_t pstcConfig;

  //PDL_ZERO_STRUCT(pstcConfig);

  pstcConfig.abEnable[RSI_SPI_INTR_NBR] = TRUE;
  pstcConfig.aenLevel[RSI_SPI_INTR_NBR] = ExIntHighLevel;
  pstcConfig.apfnExintCallback[RSI_SPI_INTR_NBR] = &Intr_isr; 


  // Set pin function before enabling external interrupt channel!

	SetPinFunc_INT08_1(0u); 
	

  Exint_Init(&pstcConfig);
  Exint_EnableChannel(RSI_SPI_INTR_NBR);

	return;
}