CMSIS-Driver Implementations: Ethernet

| CMSIS-Driver Implementations Version 2.7.0 MCU independent device driver implementations and template files of the CMSIS-Driver API specification

- Main Page
- Usage and Description

All Pages
Ethernet

# Driver Implementations

The ARM::CMSIS-Driver Pack contains implementations of CMSIS-Ethernet drivers for the following devices:

Driver | Description
--- | ---
KSZ8851SNL/SNLI | Ethernet PHY and MAC interfaces for KSZ8851.
LAN9220 | Ethernet PHY and MAC interfaces for LAN9220.
DP83848C | Ethernet PHY interface for DP83848C.
KSZ8061RNB | Ethernet PHY interface for KSZ8061.
KSZ8081RNA | Ethernet PHY interface for KSZ8081.
LAN8710A | Ethernet PHY interface for LAN8710A.
LAN8720 | Ethernet PHY interface for LAN8720.
LAN8740A | Ethernet PHY interface for LAN8740A.
LAN8742A | Ethernet PHY interface for LAN8742A.
ST802RT1 | Ethernet PHY interface for ST802RT1.

# Multiple Driver Instances

CMSIS-Driver API supports multiple driver instances. The Ethernet drivers are implemented within a single C module and several driver instances of the same type can be used in a project as follows:

- Add the first driver instance to the project. In IDEs with CMSIS-pack management support this can be done from the Run-Time Environment (RTE).
- Create a copy of the driver's .c file with a different file name and add it to the project. This will be the second driver instance. For example, copy `ETH_LAN9220.c` file as `ETH2_LAN9220.c`.
- Copy the driver's .h file to the project or add the driver's folder to the compiler include search path.
- Specify the driver parameters for the second instance. For example, in `ETH2_LAN9220.c` new values to the following parameters are needed instead of default ones:
  #define ETH_MAC_NUM 1
  #define ETH_PHY_NUM 1
  #define LAN9220_BASE (0x53000000UL)
- Now both Ethernet instances can be accessed from the application. For example:
  #include "Driver_ETH_MAC.h"
  #include "Driver_ETH_PHY.h"
  extern ARM_DRIVER_ETH_MAC Driver_ETH_MAC0;
  extern ARM_DRIVER_ETH_MAC Driver_ETH_MAC1;
  extern ARM_DRIVER_ETH_PHY Driver_ETH_PHY0;
  extern ARM_DRIVER_ETH_PHY Driver_ETH_PHY1;
  #define eth0 (&Driver_ETH_MAC0)
  #define eth1 (&Driver_ETH_MAC1)
  #define phy0 (&Driver_ETH_PHY0)
  #define phy1 (&Driver_ETH_PHY1)