嵌入式开发者社区

标题: C6748 上跑SYSBIOS 实现SPI通信 [打印本页]

作者: zero    时间: 2014-8-29 14:38
标题: C6748 上跑SYSBIOS 实现SPI通信
StarterWare的裸板程序里面有个中断映射过程,我在SYSBIOS下如何实现?需要这个过程么?

作者: 希望缄默    时间: 2014-8-29 19:01



1、可以使用 Starterware 中断管理 但不推荐
2、使用 HWI

作者: zero    时间: 2014-8-30 15:08
希望缄默 发表于 2014-8-29 19:01
1、可以使用 Starterware 中断管理 但不推荐
2、使用 HWI

昨天已经找到方法了,就是用HWI,忘记过来写答案了,谢谢啦
static void SetUpInt(void)
{
        Hwi_Params hwiParams;
      Error_Block eb;
   
      Hwi_Params_init(&hwiParams);
      Error_init(&eb);
  
      
   
      // set the event id 37 of the peripheral assigned to this interrupt
      hwiParams.eventId = SYS_INT_SPI0_INT;   
   
      // don't allow any interrupt to nest
      hwiParams.maskSetting = Hwi_MaskingOption_ALL;
   
      //
      // Configure interrupt 4 to invoke "SPIIsr".
      // Automatically enables interrupt 4 by default
      // set params.enableInt = FALSE if you want to control
      // when the interrupt is enabled using Hwi_enableInterrupt()
      //
   
      myHwi = Hwi_create(4, SPIIsr, &hwiParams, &eb);
   
      if (Error_check(&eb)) {
          // handle the error
                  System_abort  ("SPI Interrupt initialization is failed\n");
                  
      }
}
我是这样写的,请问对么?





欢迎光临 嵌入式开发者社区 (https://www.51ele.net/) Powered by Discuz! X3.4