欢迎来到天天文库
浏览记录
ID:6330966
大小:228.00 KB
页数:38页
时间:2018-01-10
《驱动开发-6x6矩阵键盘驱动》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、AT91SAM9263WINCE6.0R2驱动开发-6X6矩阵键盘驱动1.原理图2.代码viewplaincopytoclipboardprint?01.#include02.#include03.#include04.#include05.#include06.#include07.#include08.#include09.#include"matrixke
2、y.h"10.#include"Oal_timer.h"11.#include"at91_pio.h"12.//Controllerincludes13.#include"at91sam9263_gpio.h"14.#include"AT91SAM9263_oal_intr.h"15.#include"atmel_oal_ioctl.h"16.staticHANDLEm_hMute;17.18.staticBYTEVirtualkey0=VK_NUMPAD0;19.staticHANDLEm_hevInterrupt0;
3、20.staticHANDLEgintThread0;21.staticDWORDg_dwSysIntrToIrq0=SYSINTR_UNDEFINED;22.23.staticBYTEVirtualkey1=VK_NUMPAD0;24.staticHANDLEm_hevInterrupt1;25.staticHANDLEgintThread1;26.staticDWORDg_dwSysIntrToIrq1=SYSINTR_UNDEFINED;27.28.staticBYTEVirtualkey2=VK_NUMPAD0;
4、29.staticHANDLEm_hevInterrupt2;30.staticHANDLEgintThread2;31.staticDWORDg_dwSysIntrToIrq2=SYSINTR_UNDEFINED;32.33.staticBYTEVirtualkey3=VK_NUMPAD0;34.staticHANDLEm_hevInterrupt3;35.staticHANDLEgintThread3;36.staticDWORDg_dwSysIntrToIrq3=SYSINTR_UNDEFINED;37.38.st
5、aticBYTEVirtualkey4=VK_NUMPAD0;39.staticHANDLEm_hevInterrupt4;40.staticHANDLEgintThread4;41.staticDWORDg_dwSysIntrToIrq4=SYSINTR_UNDEFINED;42.43.staticBYTEVirtualkey5=VK_NUMPAD0;44.staticHANDLEm_hevInterrupt5;45.staticHANDLEgintThread5;46.staticDWORDg_dwSysIntrTo
6、Irq5=SYSINTR_UNDEFINED;47.////////////////////////////////////////48.49.staticBYTEint9keyup=0;50.51.staticvoidloopn(UINT32wCount)52.{53.volatileunsignedinti,k,j=0;54.for(k=0;k7、RDdwStatus;61.62.dwStatus=WaitForSingleObject(m_hMute,INFINITE);63.if(dwStatus==WAIT_OBJECT_0){64.dwStatus=ERROR_SUCCESS;65.}else{66.dwStatus=GetLastError();67.}68.69.returndwStatus;70.}71.72.staticDWORDKeyPadUnLock()73.{74.DWORDdwStatus=ERROR_SUCCESS;75.BOOLfOk;8、76.77.fOk=ReleaseMutex(m_hMute);78.if(!fOk){79.dwStatus=GetLastError();80.}81.82.returndwStatus;83.}84.85.//中断脚输入为低则返回TRUE,否则返回FALSE86.staticBOOLIsIntPortLow(u
7、RDdwStatus;61.62.dwStatus=WaitForSingleObject(m_hMute,INFINITE);63.if(dwStatus==WAIT_OBJECT_0){64.dwStatus=ERROR_SUCCESS;65.}else{66.dwStatus=GetLastError();67.}68.69.returndwStatus;70.}71.72.staticDWORDKeyPadUnLock()73.{74.DWORDdwStatus=ERROR_SUCCESS;75.BOOLfOk;
8、76.77.fOk=ReleaseMutex(m_hMute);78.if(!fOk){79.dwStatus=GetLastError();80.}81.82.returndwStatus;83.}84.85.//中断脚输入为低则返回TRUE,否则返回FALSE86.staticBOOLIsIntPortLow(u
此文档下载收益归作者所有