• 大小: 12KB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2021-06-16
  • 语言: 其他
  • 标签: KSZ8851  lwip  

资源简介

KSZ8851 在lwip下的驱动程序。经过实际测试,已经用在成熟的产品上了。
KSZ8851是一款并口接口的以太网控制器,可以连接STM32单片机,这个程序已经成功在STM32F437IIT6上运行, 多个产品都在用,非常稳定。

资源截图

代码片段和文件信息

/*
 *   @file:ksz8851.c
 *
 *         A Davicom ksz8851 Ethernet driver for STM32F4XX.
 *
 *
 */

/* include file */
//#include “global.h“
//#include “timer.h“
#include “bsp_ksz8851.h“
#include “eth.h“
#include 
#ifdef DUAL_CORE
#include “share.h“
#endif


/** 芯片相关宏定义 */

/**
 * 寄存器地址定义
 */
#define KSZ8851_CCR           (0x08)        /** 配置寄存器 */
#define KSZ8851_MARL          (0x10)        /** MAC地址低字 */
#define KSZ8851_MARM          (0x12)        /** MAC地址中字 */
#define KSZ8851_MARH          (0x14)        /** MAC地址高字-6字节表示法中的前两字节 */
#define KSZ8851_OBCR          (0x20)        /** 芯片总线控制 */
#define KSZ8851_EEPCR         (0x22)        /** EEPROM控制 */
#define KSZ8851_MBIR          (0x24)        /** 芯片内存自测试状态 */
#define KSZ8851_GRR           (0x26)        /** 全局复位寄存器 */
#define KSZ8851_WFCR          (0x2A)        /** 唤醒帧控制 */
#define KSZ8851_WF0CRC0       (0x30)        /** 唤醒帧0CRC0寄存器 */
#define KSZ8851_WF0CRC1       (0x32)        /** 唤醒帧0CRC1寄存器 */
#define KSZ8851_WF0BM0        (0x34)        /** 唤醒帧0字节掩码0寄存器 */
#define KSZ8851_WF0BM1        (0x36)        /** 唤醒帧0字节掩码1寄存器 */
#define KSZ8851_WF0BM2        (0x38)        /** 唤醒帧0字节掩码2寄存器 */
#define KSZ8851_WF0BM3        (0x3A)        /** 唤醒帧0字节掩码3寄存器 */

#define KSZ8851_WF1CRC0       (0x40)        /** 唤醒帧1CRC0寄存器 */
#define KSZ8851_WF1CRC1       (0x42)        /** 唤醒帧1CRC1寄存器 */
#define KSZ8851_WF1BM0        (0x44)        /** 唤醒帧1字节掩码0寄存器 */
#define KSZ8851_WF1BM1        (0x46)        /** 唤醒帧1字节掩码1寄存器 */
#define KSZ8851_WF1BM2        (0x48)        /** 唤醒帧1字节掩码2寄存器 */
#define KSZ8851_WF1BM3        (0x4A)        /** 唤醒帧1字节掩码3寄存器 */

#define KSZ8851_WF2CRC0       (0x50)        /** 唤醒帧2CRC0寄存器 */
#define KSZ8851_WF2CRC1       (0x52)        /** 唤醒帧2CRC1寄存器 */
#define KSZ8851_WF2BM0        (0x54)        /** 唤醒帧2字节掩码0寄存器 */
#define KSZ8851_WF2BM1        (0x56)        /** 唤醒帧2字节掩码1寄存器 */
#define KSZ8851_WF2BM2        (0x58)        /** 唤醒帧2字节掩码2寄存器 */
#define KSZ8851_WF2BM3        (0x5A)        /** 唤醒帧2字节掩码3寄存器 */

#define KSZ8851_WF3CRC0       (0x60)        /** 唤醒帧3CRC0寄存器 */
#define KSZ8851_WF3CRC1       (0x62)        /** 唤醒帧3CRC1寄存器 */
#define KSZ8851_WF3BM0        (0x64)        /** 唤醒帧3字节掩码0寄存器 */
#define KSZ8851_WF3BM1        (0x66)        /** 唤醒帧3字节掩码1寄存器 */
#define KSZ8851_WF3BM2        (0x68)        /** 唤醒帧3字节掩码2寄存器 */
#define KSZ8851_WF3BM3        (0x6A)        /** 唤醒帧3字节掩码3寄存器 */

#define KSZ8851_TXCR          (0x70)        /** 发送控制寄存器 */
#define KSZ8851_TXSR          (0x72)        /** 发送状态寄存器 */

#define KSZ8851_RXCR1         (0x74)        /** 接收状态寄存器1 */
#define KSZ8851_RXCR2         (0x76)        /** 接收状态寄存器2 */

#define KSZ8851_TXMIR         (0x78)        /** TXQ存储区信息寄存器 */
#define KSZ8851_RXFHSR        (0x7C)        /** 接收帧头状态寄存器 */
#define KSZ8851_RXFHBCR       (0x7E)        /** 接收帧头字节数寄存器 */
#define KSZ8851_TXQCR         (0x80)        /** TXQ命令寄存器 */
#define KSZ8851_RXQCR         (0x82)        /** RXQ命令寄存器 */

#define KSZ8851_TXFDPR        (0x84)        /** 发送帧数据地址指针寄存器 */
#define KSZ88

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件      43948  2016-10-27 13:01  bsp_ksz8851.c

     文件       2619  2016-10-27 13:01  bsp_ksz8851.h

----------- ---------  ---------- -----  ----

                46567                    2


评论

共有 条评论