DM9000A
APPLICATION NOTES
Preliminary 36
Version: DM9000A-AN-V121
November 27, 2007
For example,
#define NCR
0x00
#define RCR
0x05
#define WCR
0x0F
#define MWRL
0xFA
#define MWRH
0xFB
#define IMR
0xFF
iow ( RCR , ior ( RCR ) & 0xfe );
iow ( IMR , ior ( IMR ) & 0x3f );
/* Here, the Sample Frame put in the DM9000A FIFO SRAM 16KB: 0x0000~ 0x3FFF */
for (i = 0, sample_ptr = 0; i < sample_length; i++, samp= 4) {
/* set sample_ptr to MWRL as low byte and to MWRH as high byte in DM9000A SRAM */
iow ( MWRL, sample_ptr & 0xff );
iow ( MWRH, (sample_ptr >> 8) & 0xff );
outb ( 0xF8, IOaddr );
/* Output port number MWCMD=0xF8 TX WRITE locking */
if (i % 2) outw ( ( ((u16 *) sample_frame)[(i+1)/2] >> 8), 4 );
else outw ( ((u16 *) sample_frame)[(i+1)/2], 4 ); } /* 16-bit mode */
/* set the condition Byte [0] & Byte [1] of the Sample Frame in 0x2000~ 0x3FFD */
for (i = 0, sample_ptr = 0x2000; i < sample_length; i++, samp= 4) {
/* set sample_ptr to MWRL as low byte and to MWRH as high byte in DM9000A SRAM */
iow ( MWRL, sample_ptr & 0xff );
iow ( MWRH, (sample_ptr >> 8) & 0xff );
outb ( 0xF8, IOaddr );
/* Output port number MWCMD=0xF8 TX WRITE locking */
outw( 0x0002, IOaddr + 4 ); } /* Fill Bit [1:0]="10" of condition 0 in pkt 0 */
// iow ( MWRL, (sam4) & 0xff); iow ( MWRH, ((sam4) >> 8) \
// & 0xff); outw( 0x0003, 4 ); /* Fill Bit [1:0]="11" to stop checking */
iow ( WCR , ior ( WCR ) | 0x10 ); /* Sample Frame enable */
iow ( NCR , ior ( NCR ) | 0x40 ); /* Wake-up remote enable */
iow ( RCR , ior ( RCR ) | 0x01 );