nckernel  0.1
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Enumerations | Functions
DMA Controller 드라이버 구현

DMA 콘트롤러를 제어하는 코드를 구현 More...

Data Structures

struct  dma_ctrl_port_entry_t
 
struct  dma_port_entry_t
 

Enumerations

enum  dma_channel_t {
  DMA_CH0 = 0x00, DMA_CH1 = 0x01, DMA_CH2 = 0x02, DMA_CH3 = 0x03,
  DMA_8BIT = 0x00, DMA_16BIT = 0x01, DMA_MAX_TYPE = 0x02, DMA_MAX_CHANNEL = 0x08
}
 
enum  dma_mask_bit_t { DMA_MASK_DISABLE_CH = 0x04 }
 
enum  dma_mode_bit_t {
  DMA_MODE_DEMAND = 0x00, DMA_MODE_SINGLE = 0x40, DMA_MODE_BLOCK = 0x80, DMA_MODE_CASCADE = 0xC0,
  DMA_MODE_ADDR_DEC = 0x20, DMA_MODE_AUTO_INIT = 0x10, DMA_MODE_TX_VERYFY = 0x00, DMA_MODE_TX_WRITE = 0x04,
  DMA_MODE_TX_READ = 0x08, DMA_MODE_TX_ILLEGAL = 0x0C
}
 

Functions

struct dma_ctrl_port_entry_tdma_get_ctrl_port (int type)
 type 에 해당하는 DMA 제어 포트 정보를 가져온다. More...
 
struct dma_port_entry_tdma_get_port (int channel)
 channel 에 해당하는 port 를 가져온다. More...
 
void dma_init (int ch, int mode, unsigned long address, int count)
 DMA Controller 를 초기화 한다. More...
 
int dma_is_done (int ch)
 DMA 가 종료 되었는지 확인한다. More...
 

Detailed Description

DMA 콘트롤러를 제어하는 코드를 구현

Author
Sung-jae Park nices.nosp@m.j@ni.nosp@m.cesj..nosp@m.com
Date
2011-7-29

Direct Memory Access Controller 를 사용하기 위해 초기화 하는 코드를 구현한다.

Enumeration Type Documentation

Enumerator
DMA_CH0 
DMA_CH1 
DMA_CH2 
DMA_CH3 
DMA_8BIT 
DMA_16BIT 
DMA_MAX_TYPE 
DMA_MAX_CHANNEL 

Definition at line 35 of file dma.h.

0x0A (8 Bit DMAC) 0x0D (16 Bit DMAC)

Enumerator
DMA_MASK_DISABLE_CH 

Set Mask Bit (Disable Channel)

Definition at line 52 of file dma.h.

0x0B (8 Bit DMAC) 0xD6 (16 Bit DMAC)

Enumerator
DMA_MODE_DEMAND 
DMA_MODE_SINGLE 
DMA_MODE_BLOCK 
DMA_MODE_CASCADE 
DMA_MODE_ADDR_DEC 

DEC

DMA_MODE_AUTO_INIT 
DMA_MODE_TX_VERYFY 
DMA_MODE_TX_WRITE 

Input from an I/O port and WRITE to memory

DMA_MODE_TX_READ 

READ from memory and output to an I/O port

DMA_MODE_TX_ILLEGAL 

Definition at line 17 of file dma.h.

Function Documentation

struct dma_ctrl_port_entry_t* dma_get_ctrl_port ( int  type)

type 에 해당하는 DMA 제어 포트 정보를 가져온다.

Parameters
[in]type종류
Returns
struct dma_ctrl_port_entry_t * 제어 포트 정보
See Also
dma_get_port()

Definition at line 134 of file dma.c.

References DMA_MAX_TYPE, and NULL.

struct dma_port_entry_t* dma_get_port ( int  channel)

channel 에 해당하는 port 를 가져온다.

Parameters
[in]channel채널
Returns
struct dma_port_entry_t * 포트 정보를 가져온다.
See Also
dma_get_ctrl_port()

Definition at line 143 of file dma.c.

References DMA_MAX_CHANNEL, and NULL.

void dma_init ( int  ch,
int  mode,
unsigned long  address,
int  count 
)

DMA Controller 를 초기화 한다.

Parameters
[in]ch채널
[in]mode모드
[in]address주소
[in]count갯수
Returns
void 없음
See Also
dma_is_done()

Definition at line 152 of file dma.c.

References DMA_DISABLE, DMA_ENABLE, DMA_RESET_PTR, DMA_SET_ADDRESS, DMA_SET_MODE, DMA_SET_PAGE, DMA_SET_TX_SIZE, irq_local_restore(), and irq_local_save().

Here is the call graph for this function:

int dma_is_done ( int  ch)

DMA 가 종료 되었는지 확인한다.

Parameters
[in]ch채널
Returns
int 성공시 0, 실패시 -1
See Also
dma_init()

Definition at line 172 of file dma.c.

References DMA_CTRL_FROM_CH, and inb().

Here is the call graph for this function: