//--------------------------------------------------------------------------------------------
-
//DSP28377 利用EMIF控制网口DM9000芯片收发数据
//--------------------------------------------------------------------------------------------
-
#include "F28x_Project.h" // Device Headerfile and Examples Include File
#include "string.h"
void Emif1Initialize(void);
//emif 映射地址
#define ASRAM_CS3_START_ADDR 0x37FFF0
#define ASRAM_CS3_SIZE 0x8000
interrupt void xint1_isr(void);
extern void setup_emif1_pinmux_async_16bit(Uint16);
#pragma DATA_SECTION(datafrompc , "RAMGS0");
Uint16 datafrompc[12288];
//地址指定;通过操作指针实现地址对应数据操作
Uint16 *ADDR_POINT = (Uint16 *)(ASRAM_CS3_START_ADDR);
Uint16 *DATA_POINT = (Uint16 *)(ASRAM_CS3_START_ADDR + 1);
//##########DM9000 SETING ######################
#define DM_NCR 0X00
#define DM_NSR 0X01
#define DM_TCR 0X02
#define DM_RCR 0X05
#define DM_BPTR 0X08
#define DM_FCTR 0X09
#define DM_RTFCR 0X0A
#define DM_EPCR 0X0B
#define DM_EPAR 0X0C
#define DM_EPDRL 0X0D
#define DM_EPDRH 0X0E
#define DM_PAB0 0X10
#define DM_PAB1 0X11
#define DM_PAB2 0X12
#define DM_PAB3 0X13
#define DM_PAB4 0X14
#define DM_PAB5 0X15
#define DM_GPCR 0X1E
#define DM_GPR 0X1F
#define DM_SMCR 0X2F
#define DM_MRCMDX 0XF0
#define DM_MRCMD 0XF2
#define DM_MWCMD 0XF8
#define DM_TXPLH 0XFD
#define DM_TXPLL 0XFC
#define DM_ISR 0XFE
#define DM_IMR 0XFF
#define PHY_BADDR 0X40
#define PHY_WCMD 0X0A
#define PHY_RCMD 0X0C
Uint16 NODE_ADDR[6] = {0X5A , 0X5A , 0X5A , 0X5A , 0X5A , 0X5A};
Uint16 PHYIntFlag = 0;
Uint16 RxReady = 0;
Uint16 SweepMode = 0;
Uint16 Index[24] = {0 , 512 , 1024 , 1536 , 2048 , 2560 , 3072 , 3584 , 4096 , 4608 , 5120 ,
5632 , 6144 , 6656 ,
7168 , 7680 , 8192 , 8704 , 9216 , 9728 , 10240 , 10752 ,
11264 ,11776};
//----------------------------------------------------------------------------------
//检测到PHY中断信号并触发中断 ---------------------------------------------------------------
interrupt void xint1_isr(void)
{
GpioDataRegs.GPBCLEAR.all = 0x4; // GPIO34 is low
// Acknowledge this interrupt to get more from group 1
PieCtrlRegs.PIEACK.all = PIEACK_GROUP1;
PHYIntF
dsp28377控制DM9000收发数据——第三版程序,通过外部引脚触发来实现中断接受数据,优化掉帧现象...
最新推荐文章于 2023-03-28 17:04:18 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)