亚洲春色中文字幕久久久-三上亚,91精品国产亚一区二区三区,久久久九色综合亚洲成色777,涩涩视频下载,国产午夜亚洲精品午夜鲁丝片,国产精品A一区二区三区腾讯导航,影音先锋色情AV在线看片,蜜臀国产在线视频,极品少妇高潮啪啪无码吴梦梦 ,精品人妻无码一区二区三区手机版

 找回密碼
 立即注冊

QQ登錄

只需一步,快速開始

搜索
查看: 4116|回復: 0
打印 上一主題 下一主題
收起左側

STM8外部中斷配置詳解

[復制鏈接]
跳轉到指定樓層
樓主
ID:90014 發表于 2015-9-14 12:56 | 只看該作者 回帖獎勵 |倒序瀏覽 |閱讀模式
1:引用STM8 的中斷庫
  #include "stm8s_exti.h"
2:配置外部中斷的觸發管腳
GPIO_Init(LEDS_PORT,MB,GPIO_MODE_IN_FL_IT );
或者
GPIO_Init(LEDS_PORT,MB,GPIO_MODE_IN_PU_IT );
3:初始化中斷
EXTI_DeInit();
EXTI_SetTLISensitivity(EXTI_TLISENSITIVITY_RISE_ONLY);//下降沿觸發中斷
EXTI_SetExtIntSensitivity((EXTI_PORT_GPIOD),EXTI_SENSITIVITY_RISE_ONLY);

4:中斷服務子程序的配置
(1)外部定義中斷服務子程序
@far @interrupt void EXTI3 (void)
{
  disableInterrupts();
  counter ();
  enableInterrupts();
}
(2)聲明外部中斷子程序
extern void EXTI3 ();
(3)配置外部中斷子程序向量表
struct interrupt_vector const _vectab[] = {
{0x82, (interrupt_handler_t)_stext},
{0x82, NonHandledInterrupt},
{0x82, NonHandledInterrupt},
{0x82, NonHandledInterrupt},
{0x82, NonHandledInterrupt},
{0x82, NonHandledInterrupt},
{0x82, NonHandledInterrupt},
{0x82, NonHandledInterrupt},
{0x82, EXTI3              },
{0x82, NonHandledInterrupt},
{0x82, NonHandledInterrupt},
{0x82, NonHandledInterrupt},
{0x82, NonHandledInterrupt},
{0x82, NonHandledInterrupt},
{0x82, NonHandledInterrupt},
{0x82, TIM2_UPD_OVF_TRG_IRQHandler },
{0x82, NonHandledInterrupt},
{0x82, NonHandledInterrupt},
{0x82, NonHandledInterrupt},
{0x82, NonHandledInterrupt},
{0x82, UART_RI            },
{0x82, NonHandledInterrupt},
{0x82, NonHandledInterrupt},
{0x82, NonHandledInterrupt},
{0x82, NonHandledInterrupt},
{0x82, NonHandledInterrupt},
{0x82, NonHandledInterrupt},
{0x82, NonHandledInterrupt},
{0x82, NonHandledInterrupt},
{0x82, NonHandledInterrupt},
{0x82, NonHandledInterrupt},
{0x82, NonHandledInterrupt},
};
注:在配置中斷實以上三部缺一不可



分享到:  QQ好友和群QQ好友和群 QQ空間QQ空間 騰訊微博騰訊微博 騰訊朋友騰訊朋友
收藏收藏 分享淘帖 頂 踩
回復

使用道具 舉報

您需要登錄后才可以回帖 登錄 | 立即注冊

本版積分規則

小黑屋|51黑電子論壇 |51黑電子論壇6群 QQ 管理員QQ:125739409;技術交流QQ群281945664

Powered by 單片機教程網

快速回復 返回頂部 返回列表