📄 dma.h
字号:
/* * OSV * Copyright (C) 2002 Ciprian DOSOFTEI <rocksoul@mail.com> * All rights reserved. * * http://backster.free.fr/osv * * This file is part of the OSV project. OSV is free software, also known as * "open source"; you can redistribute it and/or modify it under the terms * of the GNU General Public License (GPL), version 2, as published by the Free * Software Foundation (FSF). To explore alternate licensing terms, contact * the author at rocksoul@mail.com or +40740649907. * * OSV is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GPL for more details. You should have * received a copy of the GPL along with OSV; see the file COPYING. If * not, write to the FSF, 59 Temple Place #330, Boston, MA 02111-1307, USA. */#ifndef INCDMA#define INCDMA#include <types.h>typedef struct { unsigned channel:2; unsigned mask:1; unsigned dont_care:5;} NOALIGN _MASK_REG;#define CHANNEL0 0#define CHANNEL1 1#define CHANNEL2 2#define CHANNEL3 3typedef union { _MASK_REG fields; byte value;} MASK_REG;typedef struct { unsigned channel:2; unsigned transfer_type:2; unsigned auto_init:1; unsigned address_inc:1; unsigned mode:2;} NOALIGN _MODE_REG;#define VERIFY_TRANSFER 0#define WRITE_TRANSFER 1#define READ_TRANSFER 2typedef enum {VERIFY, WRITE, READ} transfer_type;#define DEMAND_MODE 0#define SINGLE_MODE 1#define BLOCK_MODE 2#define CASCADE_MODE 3typedef enum {DEMAND, SINGLE, BLOCK, CASCADE} mode_type;typedef union { _MODE_REG fields; byte value;} MODE_REG;void setup_dma (dword channel, dword data_ptr, word length, transfer_type trans, mode_type mode, BOOL auto_init, BOOL address_inc);void pause_dma (byte channel);void unpause_dma (byte channel);void stop_dma (byte channel);#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -