📄 ethernet_main.h
字号:
/*
* File: ethernet_main.h
* Purpose:
*
* Notes:
*
*/
#ifndef __ETHERNET_MAIN_H__
#define __ETHERNET_MAIN_H__
/********************************************************************/
#include "m5275evb.h"
#include "stdlib.h"
#include "ethernet/nbuf.h"
#include "ethernet/mii.h"
#include "ethernet/ks8721.h"
/* Buffer Descriptors -- must be aligned on a 4-byte boundary but a
* 16-byte boundary is recommended. To avoid playing games with the
* various compilers and their different extension to ANSI C, these
* buffers are aligned by allocating an extra line of data and
* adjusting the pointers in nbuf_init().
*/
uint8 unaligned_txbd[(sizeof(NBUF) * NUM_TXBDS) + 16];
uint8 unaligned_rxbd[(sizeof(NBUF) * NUM_RXBDS) + 16];
NBUF *TxNBUF;
NBUF *RxNBUF;
/* Data Buffers -- must be aligned on a 16-byte boundary. To avoid
* playing games with the various compilers and their different
* extension to ANSI C, these buffers are aligned by allocating an
* extra line of data and adjusting the pointers in nbuf_init().
*/
uint8 unaligned_txbuffer[(TX_BUFFER_SIZE * NUM_TXBDS) + 16];
uint8 unaligned_rxbuffer[(RX_BUFFER_SIZE * NUM_RXBDS) + 16];
uint8 *TxBuffer;
uint8 *RxBuffer;
/* Data to be transmitted */
const uint8 packet[] =
{
0x00, 0xCF, 0x52, 0x35, 0xC3, 0x01, 0x00, 0xCF,
0x52, 0x35, 0xC3, 0x01, 0x08, 0x00, 0x45, 0x00,
0x00, 0x3C, 0x2B, 0xE8, 0x00, 0x00, 0x20, 0x01,
0xA6, 0x1B, 0xA3, 0x0A, 0x41, 0x55, 0xA3, 0x0A,
0x41, 0x54, 0x08, 0x00, 0x0C, 0x5C, 0x01, 0x00,
0x40, 0x00, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66,
0x67, 0x68, 0x69, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E,
0x6F, 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76
};
/*
* Functions provided
*/
void ethernet0_example(void);
void ethernet1_example(void);
/********************************************************************/
#endif /* __ETHERNET_MAIN_H__*/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -