用EVC4.0编写程序,可以读写硬件I/O口地址吗?(高分求答)

gdsdyl 2004-07-06 09:08:49
用EVC4.0编写程序,可以读写硬件I/O口地址吗?请给出详细方法或相关资料!
...全文
300 12 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
12 条回复
切换为时间正序
请发表友善的回复…
发表回复
zhangqb 2004-11-02
  • 打赏
  • 举报
回复
SetKMode(TRUE);
.
.(读写硬件I/O口地址的函数)
.
SetKMode(FALSE);
chen_fei 2004-11-01
  • 打赏
  • 举报
回复
用地址映射,因为在操作系统下不能访问物理地址,要映射到虚拟内存
映射文件如下:

;WINCE420\PLATFORM\SMDK2410\KERNEL\HAL\ARM\MAP.A
;
; Copyright (c) Microsoft Corporation. All rights reserved.
;
;
; Use of this source code is subject to the terms of the Microsoft end-user
; license agreement (EULA) under which you licensed this SOFTWARE PRODUCT.
; If you did not accept the terms of the EULA, you are not authorized to use
; this source code. For a copy of the EULA, please see the LICENSE.RTF on your
; install media.
;
;******************************************************************************
;*
;* System On Chip(SOC)
;*
;* Copyright (c) 2002 Software Center, Samsung Electronics, Inc.
;* All rights reserved.
;*
;* This software is the confidential and proprietary information of Samsung
;* Electronics, Inc("Confidential Information"). You Shall not disclose such
;* Confidential Information and shall use it only in accordance with the terms
;* of the license agreement you entered into Samsung.
;*
;*-----------------------------------------------------------------------------
;*
;* S3C2410 BSP (WinCE3.0 & PocketPC2002)
;*
;* map920.a : S3C2410 Memory MAP
;*
;* @author zartoven@samsung.com (SOC, SWC, SAMSUNG Electronics)
;*
;* @date 2002/04/04
;*
;* Log:
;* 2002/04/04 Start(From SOC Cho's Original BSP)
;*
;******************************************************************************

EXPORT OEMAddressTable[DATA]

; LTORG

AREA OEMAddressTable, DATA, READONLY
;OEMAddressTable
;;;-------------------------------------------------------------
;;; Virt Addr Phys Addr MB
;;;-------------------------------------------------------------
DCD 0x80000000, 0x00000000, 32 ; 32 MB SROM(SRAM/ROM) BANK 0
DCD 0x82000000, 0x08000000, 32 ; 32 MB SROM(SRAM/ROM) BANK 1
DCD 0x84000000, 0x10000000, 32 ; 32 MB SROM(SRAM/ROM) BANK 2
DCD 0x86000000, 0x18000000, 32 ; 32 MB SROM(SRAM/ROM) BANK 3
DCD 0x88000000, 0x20000000, 32 ; 32 MB SROM(SRAM/ROM) BANK 4
DCD 0x8A000000, 0x28000000, 32 ; 32 MB SROM(SRAM/ROM) BANK 5
DCD 0x8C000000, 0x30000000, 64 ; 64 MB DRAM BANK 0
DCD 0x90800000, 0x48000000, 1 ; Memory control register
DCD 0x90900000, 0x49000000, 1 ; USB Host register
DCD 0x90A00000, 0x4A000000, 1 ; Interrupt Control register
DCD 0x90B00000, 0x4B000000, 1 ; DMA control register
DCD 0x90C00000, 0x4C000000, 1 ; Clock & Power register
DCD 0x90D00000, 0x4D000000, 1 ; LCD control register
DCD 0x90E00000, 0x4E000000, 1 ; NAND flash control register
DCD 0x91000000, 0x50000000, 1 ; UART control register
DCD 0x91100000, 0x51000000, 1 ; PWM timer register
DCD 0x91200000, 0x52000000, 1 ; USB device register
DCD 0x91300000, 0x53000000, 1 ; Watchdog Timer register
DCD 0x91400000, 0x54000000, 1 ; IIC control register
DCD 0x91500000, 0x55000000, 1 ; IIS control register
DCD 0x91600000, 0x56000000, 1 ; I/O Port register
DCD 0x91700000, 0x57000000, 1 ; RTC control register
DCD 0x91800000, 0x58000000, 1 ; A/D convert register
DCD 0x91900000, 0x59000000, 1 ; SPI register
DCD 0x91A00000, 0x5A000000, 1 ; SD Interface register
DCD 0x00000000, 0x00000000, 0 ; End of Table (MB MUST BE ZERO!)

END

我用的是S3C2410
不过扩展IO用了CPLD
gdsdyl 2004-10-29
  • 打赏
  • 举报
回复
不用DDK,嵌入汇编就行了。问题已解决!
kawaya 2004-10-29
  • 打赏
  • 举报
回复
先映射虚地址,然后直接嵌入汇编操作相应端口。
cherishhu 2004-07-31
  • 打赏
  • 举报
回复
我那个代码好像有个密码,cherishq,你试一下吧
baodingwang 2004-07-30
  • 打赏
  • 举报
回复
关注
cherishhu 2004-07-24
  • 打赏
  • 举报
回复
用地址映射,因为在操作系统下不能访问物理地址,要映射到虚拟内存

我的源码和说明在这里,请去下载
http://www.cnsofter.com/download/VirtualADD.rar

我的开发板是Intel的Sitsang板,CPU是PXA255的,大家运行应该是不行了,因为板子上我控制的是32个LED阵列,但代码大家可以参考一下,我试了,是对的,我的LED都亮了,呵呵
cjyun 2004-07-16
  • 打赏
  • 举报
回复
关注,我也遇到同样问题!
baodingwang 2004-07-15
  • 打赏
  • 举报
回复
关注
载舟之水 2004-07-08
  • 打赏
  • 举报
回复
只要有特权和相应lib就可以改
hsz76 2004-07-08
  • 打赏
  • 举报
回复
别的CPU架构我不知道,我只用过ARM系列的,这里是可以直接通过MmMapIoSpace来映射相应的物理地址到程序地址空间的。MmMapIoSpace是ceddk.lib提供的,如果你用的SDK中没有这个lib,那就没辙了。
makeshi 2004-07-06
  • 打赏
  • 举报
回复
不般CPU不一样,方法也不一样的
你能不能不能找到你的GPIO.h,Gpio.c应该有这样的接口
不过一般情况下是不提倡应用程序直接,这样很不安全,一般用驱动的ioctrol

19,519

社区成员

发帖
与我相关
我的任务
社区描述
硬件/嵌入开发 嵌入开发(WinCE)
社区管理员
  • 嵌入开发(WinCE)社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧