⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ptransb.bas

📁 本CD-ROM包括《Verilog-HDL实践与应用系统设计》一书中的全部例子
💻 BAS
字号:
Attribute VB_Name = "nptrans"
Option Explicit

Declare Function rsft Lib "c:\windows\system\ptrans.dll" Alias "_rsft@8" (ByVal use As Integer, ByVal num As Integer) As Integer
Declare Function lsft Lib "c:\windows\system\ptrans.dll" Alias "_lsft@8" (ByVal use As Integer, ByVal num As Integer) As Integer


' for P8255B
Declare Sub Ptrans_out_to_DP Lib "c:\windows\system\ptrans.dll" Alias "_Ptrans_out_to_DP@4" (ByVal num As Integer)
Declare Sub Ptrans_out_to_CP Lib "c:\windows\system\ptrans.dll" Alias "_Ptrans_out_to_CP@4" (ByVal num As Integer)
Declare Function Ptrans_read_SSP Lib "c:\windows\system\ptrans.dll" Alias "_Ptrans_read_SSP@4" (ByVal use As Integer) As Integer

Declare Sub P8255B_set_A1A0 Lib "c:\windows\system\ptrans.dll" Alias "_P8255B_set_A1A0@4" (ByVal num As Integer)
Declare Sub P8255B_write_data Lib "c:\windows\system\ptrans.dll" Alias "_P8255B_write_data@4" (ByVal num As Integer)

Declare Sub P8255B_init_8255 Lib "c:\windows\system\ptrans.dll" Alias "_P8255B_init_8255@4" (ByVal num As Integer)
Declare Sub P8255B_out_data Lib "c:\windows\system\ptrans.dll" Alias "_P8255B_out_data@8" (ByVal use As Integer, ByVal num As Integer)
Declare Function P8255B_read_data Lib "c:\windows\system\ptrans.dll" Alias "_P8255B_read_data@4" (ByVal num As Integer) As Integer


Global Const APORTIN = &H90    '    /* for APORT IN              */
Global Const BPORTIN = &H82    '    /* for BPORT IN              */
Global Const CPORTIN = &H89    '    /* for CPORT IN              */
Global Const ALLIN = &H9B      '    /* for ALL PORT IN           */
Global Const ALLOUT = &H80     '    /* for ALL PORT OUT          */
Global Const APORTOUT = &H8B   '    /* for APORT OUT             */
Global Const BPORTOUT = &H99   '    /* for BPORT OUT             */
Global Const CPORTOUT = &H92   '    /* for CPORT OUT             */


Global Const A_port = 0
Global Const B_port = 1
Global Const C_port = 2

Global Const Data_port = 3
Global Const Con_port = 4
Global Const Sts_port = 5


Global t8255_sts As Integer
Global t8255_flg As Integer





















⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -