Documentation/zorro.txt

Chinese translated version of Documentation/zorro.txt

If you have any comment or update to the content, please contact the
original document maintainer directly.  However, if you have a problem
communicating in English you can also ask the Chinese maintainer for
help.  Contact the Chinese maintainer if this translation is outdated
or if there is a problem with the translation.

Chinese maintainer: 秦芹 18768122412@163.com
---------------------------------------------------------------------
Documentation/zorro.txt的中文翻译

如果想评论或更新本文的内容,请直接联系原文档的维护者。如果你使用英文
交流有困难的话,也可以向中文版维护者求助。如果本翻译更新不及时或者翻
译存在问题,请联系中文版维护者。

中文版维护者: 秦芹 18768122412@163.com
中文版翻译者:秦芹 18768122412@163.com

以下为正文
---------------------------------------------------------------------

 Writing Device Drivers for Zorro Devices
 为Zorro设备编写设备驱动程序
----------------------------------------
 Written by Geert Uytterhoeven <geert@linux-m68k.org>
 以下原文由Geert Uytterhoeven编写,作者邮箱为:geert@linux-m68k.org
 Last revised: September 5, 2003
 最后修订时间为:2003年9月5日

 1. Introduction
    介绍(引言)
 ---------------
 The Zorro bus is the bus used in the Amiga family of computers. Thanks to
 AutoConfig(tm), it's 100% Plug-and-Play.
 Zorro总线是在Amiga计算机系列中使用的总线。由于自动配置(低层)计算机

 中的板卡和其他设备,所以该总线设备完全能实现即插即用。
 There are two types of Zorro busses, Zorro II and Zorro III:
 这里有两种类型的Zerro总线,分别是Zerro2和Zerro3:
 
   - The Zorro II address space is 24-bit and lies within the first 16 MB of the
     Amiga's address map.
   - Zerro2的地址空间是24位,并且Amiga的地址映射范围在0-16MB之间。
   - Zorro III is a 32-bit extension of Zorro II, which is backwards compatible
     with Zorro II. The Zorro III address space lies outside the first 16 MB.
   - Zerro3是基于Zerro2的扩展,地址空间为32位,与Zerro2向后兼容。

     Zerro3的地址空间位于第一个16MB外的的空间。
 
 2. Probing for Zorro Devices
     Zerro设备的探测
 ----------------------------
 
 Zorro devices are found by calling `zorro_find_device()', which returns a
 pointer to the `next' Zorro device with the specified Zorro ID. A probe loop
 for the board with Zorro ID `ZORRO_PROD_xxx' looks like:
 Zorro设备通过调用‘zerro_find_device()’方法被发现,它返回一个指针,

 根据具体的Zerro ID指向下一个Zerro设备。根据Zerro  ID

(如:‘ZERRO_PROD_xxx’)循环探测,模版如下:
     struct zorro_dev *z = NULL;
 
     while ((z = zorro_find_device(ZORRO_PROD_xxx, z))) {
         if (!zorro_request_region(z->resource.start+MY_START, MY_SIZE,
                                   "My explanation"))
         ...
     }
 
 `ZORRO_WILDCARD' acts as a wildcard and finds any Zorro device. If your driver
 supports different types of boards, you can use a construct like:
 `ZORRO_WILDCARD'作为一个通配符,查找任何Zorro设备。如果你的驱动支持不

  同类型的模版,你可以使用如下结构:
     struct zorro_dev *z = NULL;
 
     while ((z = zorro_find_device(ZORRO_WILDCARD, z))) {
         if (z->id != ZORRO_PROD_xxx1 && z->id != ZORRO_PROD_xxx2 && ...)
             continue;
         if (!zorro_request_region(z->resource.start+MY_START, MY_SIZE,
                                   "My explanation"))
         ...
     }


 3. Zorro Resources
     Zorro资源
 ------------------
 
 Before you can access a Zorro device's registers, you have to make sure it's
 not yet in use. This is done using the I/O memory space resource management
 functions:
 你访问Zorro设备寄存器之前,你必须确保这个寄存器没有被使用。这是通过使

 用I/O内存空间资源管理功能函数完成的,函数如下:
     request_mem_region()
     请求内存区域函数
     release_mem_region()
      释放内存区域函数
 Shortcuts to claim the whole device's address space are provided as well:
 快捷方式要求整个设备的地址空间也被提供:
     zorro_request_device
     Zorro请求设备地址空间
     zorro_release_device
      Zorro释放设备地址空间
  
 4. Accessing the Zorro Address Space
访问Zorro地址空间
 ------------------------------------
 
 The address regions in the Zorro device resources are Zorro bus address
 regions. Due to the identity bus-physical address mapping on the Zorro bus,
 they are CPU physical addresses as well.
 Zorro设备资源的地址区域是Zorro总线地址区域。因为映射到Zorro总线的标

 识物理总线地址也是CPU的物理地址。
 The treatment of these regions depends on the type of Zorro space:
 这些区域的处理依赖于不同类型的Zorro空间:
   - Zorro II address space is always mapped and does not have to be mapped
     explicitly using z_ioremap().
   - Zorro2地址空间总是被映射,而不必明确使用z_ioremap()函数进行映射。
     Conversion from bus/physical Zorro II addresses to kernel virtual addresses
     and vice versa is done using:
从总线或者Zorro2物理地址到内核虚拟地址的转换,反之亦然适用,通过使用如下方式完成:
         virt_addr = ZTWO_VADDR(bus_addr);
         bus_addr = ZTWO_PADDR(virt_addr);
 
   - Zorro III address space must be mapped explicitly using z_ioremap() first
     before it can be accessed:
   - Zorro3地址空间被访问前,首先必须明确使用z_ioremap()函数来实现映射:
         virt_addr = z_ioremap(bus_addr, size);
         ...
         z_iounmap(virt_addr);
 
 5. References
     参考文献
 -------------
 linux/include/linux/zorro.h
 linux/include/asm-{m68k,ppc}/zorro.h
 linux/include/linux/zorro_ids.h
 linux/drivers/zorro
 /proc/bus/zorro

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
将QT += core QT -= gui CONFIG += c++11 TARGET = UavRectifyLoadLIb CONFIG += console CONFIG -= app_bundle TEMPLATE = app SOURCES += main.cpp # The following define makes your compiler emit warnings if you use # any feature of Qt which as been marked deprecated (the exact warnings # depend on your compiler). Please consult the documentation of the # deprecated API in order to know how to port your code away from it. DEFINES += QT_DEPRECATED_WARNINGS win32{ CONFIG(debug, debug|release){ DESTDIR = $$PWD/../../../../RasterManager/bin/Debug } else{ DESTDIR = $$PWD/../../../../RasterManager/bin/release } INCLUDEPATH += $$PWD/../../../include/gdal1101 DEPENDPATH += $$PWD/../../../include/gdal1101 } else{ CONFIG(debug, debug|release){ DESTDIR = $$PWD/../../../product/release32 } else{ DESTDIR = $$PWD/../../../product/release32 } } # You can also make your code fail to compile if you use deprecated APIs. # In order to do so, uncomment the following line. # You can also select to disable deprecated APIs only up to a certain version of Qt. #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 unix:!macx: LIBS += -L$$PWD/../../../product/release32/ -lUAVAutoRectifyMt -lUAVAutoRectify -lUAVAutoRectifyFi INCLUDEPATH += $$PWD/../include DEPENDPATH += $$PWD/../include unix:!macx: LIBS += -L$$PWD/../../../lib/opencvf249/ -lopencv_core unix:!macx: LIBS += -L$$PWD/../../../lib/opencvf249/ -lopencv_highgui unix:!macx: LIBS += -L$$PWD/../../../lib/opencvf249/ -lopencv_imgproc INCLUDEPATH += $$PWD/../../../lib/opencvf249 DEPENDPATH += $$PWD/../../../lib/opencvf249 unix:!macx: LIBS += -L$$PWD/../../../../../../../usr/local/lib/ -lopencv_core #unix:!macx: LIBS += -L$$PWD/../../../../../../../usr/local/lib/ -lopencv_highgui unix:!macx: LIBS += -L$$PWD/../../../../../../../usr/local/lib/ -lopencv_imgproc unix:!macx: LIBS += -L$$PWD/../../../../../../../usr/local/lib/ -lopencv_features2d unix:!macx: LIBS += -L$$PWD/../../../../../../../usr/local/lib/ -lopencv_imgcodecs INCLUDEPATH += $$PWD/../../../../../../../usr/local/include DEPENDPATH += $$PWD/../../../../../../../usr/local/include unix:!macx: LIBS += -L$$PWD/../../../product/release32/ -lDEMDriver unix:!macx: LIBS += -L$$PWD/../../../product/release32/ -lProjection unix:!macx: LIBS += -L$$PWD/../../../product/release32/ -lIImage_gC QMAKE_CXXFLAGS_RELEASE = $$QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO QMAKE_LFLAGS_RELEASE = $$QMAKE_LFLAGS_RELEASE_WITH_DEBUGINFO 转为cmake格式
06-11
根据给出的代码,可以将其转化为以下CMake代码: ``` cmake_minimum_required(VERSION 3.5) project(UavRectifyLoadLIb LANGUAGES CXX) set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_AUTOMOC ON) set(CMAKE_AUTORCC ON) set(CMAKE_AUTOUIC ON) find_package(Qt5Core REQUIRED) add_executable(UavRectifyLoadLIb main.cpp ) target_link_libraries(UavRectifyLoadLIb PRIVATE Qt5::Core UAVAutoRectifyMt UAVAutoRectify UAVAutoRectifyFi DEMDriver Projection IImage_gC opencv_core opencv_highgui opencv_imgproc opencv_features2d opencv_imgcodecs ) target_include_directories(UavRectifyLoadLIb PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../../../include/gdal1101 ${CMAKE_CURRENT_SOURCE_DIR}/../include ${CMAKE_CURRENT_SOURCE_DIR}/../../../lib/opencvf249 ${CMAKE_CURRENT_SOURCE_DIR}/../../../../../../../usr/local/include ) if(UNIX AND NOT APPLE) target_link_directories(UavRectifyLoadLIb PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../../../product/release32 ${CMAKE_CURRENT_SOURCE_DIR}/../../../../../../../usr/local/lib ) endif() if(WIN32) if(CMAKE_BUILD_TYPE STREQUAL "Debug") set_target_properties(UavRectifyLoadLIb PROPERTIES RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_CURRENT_SOURCE_DIR}/../../../../RasterManager/bin/Debug ) else() set_target_properties(UavRectifyLoadLIb PROPERTIES RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_CURRENT_SOURCE_DIR}/../../../../RasterManager/bin/release ) endif() else() if(CMAKE_BUILD_TYPE STREQUAL "Debug") set_target_properties(UavRectifyLoadLIb PROPERTIES RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_CURRENT_SOURCE_DIR}/../../../product/release32 ) else() set_target_properties(UavRectifyLoadLIb PROPERTIES RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_CURRENT_SOURCE_DIR}/../../../product/release32 ) endif() endif() ```
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值