TMS570學習筆記2 - RTI中斷

RTI實時中斷

  • main.c

    void main(void)
    {
    	/* USER CODE BEGIN (3) */
    	/* Initialize RTI driver */
    	rtiInit();
    	/* Set high end timer GIO port hetPort pin direction to all output */
    	/* Enable RTI Compare 0 interrupt notification */
    	rtiEnableNotification(rtiNOTIFICATION_COMPARE0);
    	/* Enable FIQ - Clear F flag in CPS register */
    	/* Note: This is usually done by the OS or in an svc dispatcher */
    	_enable_IRQ();
    	/* Start RTI Counter Block 0 */
    	rtiStartCounter(rtiCOUNTER_BLOCK0);
    	/* Run forever */
    	while(1);
    	/* USER CODE END */
    }
    
  • 中斷響應函數模塊

    /* USER CODE BEGIN (4) */
    /* RTI Compare 0 interrupt notification */
    void rtiNotification(unsigned notification)
    {
    	/* Toggle NHET1[0] pin */
    }
    /* GIO interrupt notification (Not used but must be provided) */
    /* ESM interrupt notification (Not used but must be provided) */
    void esmGroup1Notification(int bit)
    {
    return;
    }
    void esmGroup2Notification(int bit)
    {
    return;
    }
    /* USER CODE END */
    
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章