Xilinx ps2功能 linux驱动程序

/*

  • Xilinx XPS PS/2 device driver
  • © 2005 MontaVista Software, Inc.
  • © 2008 Xilinx, Inc.
  • This program is free software; you can redistribute it and/or modify it
  • under the terms of the GNU General Public License as published by the
  • Free Software Foundation; either version 2 of the License, or (at your
  • option) any later version.
  • You should have received a copy of the GNU General Public License along
  • with this program; if not, write to the Free Software Foundation, Inc.,
  • 675 Mass Ave, Cambridge, MA 02139, USA.
    */

#include <linux/module.h>
#include <linux/serio.h>
#include <linux/interrupt.h>
#include <linux/errno.h>
#include <linux/slab.h>
#include <linux/list.h>
#include <linux/io.h>
#include <linux/of_address.h>
#include <linux/of_device.h>
#include <linux/of_irq.h>
#include <linux/of_platform.h>

#define DRIVER_NAME “xilinx_ps2”

/* Register offsets for the xps2 device /
#define XPS2_SRST_OFFSET 0x00000000 /
Software Reset register /
#define XPS2_STATUS_OFFSET 0x00000004 /
Status register /
#define XPS2_RX_DATA_OFFSET 0x00000008 /
Receive Data register /
#define XPS2_TX_DATA_OFFSET 0x0000000C /
Transmit Data register /
#define XPS2_GIER_OFFSET 0x0000002C /
Global Interrupt Enable reg /
#define XPS2_IPISR_OFFSET 0x00000030 /
Interrupt Status register /
#define XPS2_IPIER_OFFSET 0x00000038 /
Interrupt Enable register */

/* Reset Register Bit Definitions /
#define XPS2_SRST_RESET 0x0000000A /
Software Reset */

/* Status Register Bit Positions /
#define XPS2_STATUS_RX_FULL 0x00000001 /
Receive Full /
#define XPS2_STATUS_TX_FULL 0x00000002 /
Transmit Full */

/*

  • Bit definitions for ISR/IER registers. Both the registers have the same bit
  • definitions and are only defined once.
    /
    #define XPS2_IPIXR_WDT_TOUT 0x00000001 /
    Watchdog Timeout Interrupt /
    #define XPS2_IPIXR_TX_NOACK 0x00000002 /
    Transmit No ACK Interrupt /
    #define XPS2_IPIXR_TX_ACK 0x00000004 /
    Transmit ACK (Data) Interrupt /
    #define XPS2_IPIXR_RX_OVF 0x00000008 /
    Receive Overflow Interrupt /
    #define XPS2_IPIXR_RX_ERR 0x00000010 /
    Receive Error Interrupt /
    #define XPS2_IPIXR_RX_FULL 0x00000020 /
    Receive Data Interrupt */

/* Mask for all the Transmit Interrupts */
#define XPS2_IPIXR_TX_ALL (XPS2_IPIXR_TX_NOACK | XPS2_IPIXR_TX_ACK)

/* Mask for all the Receive Interrupts */
#define XPS2_IPIX

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

baidu_37552881

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值