Skip to content

Realtek Unmanaged Switch Class Wrapper is a user-friendly Arduino library for Realtek's unmanaged switch ICs. It wraps around Realtek's original library, making it easier to use with clear, object-oriented classes. This library simplifies coding and improves the way you work with Realtek switches in Arduino projects.

License

Notifications You must be signed in to change notification settings

shiroichiheisen/Realtek-Unmanaged-Switch-Class-Wrapper-Arduino-Library

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

How to Use the Library

Understanding the Library - Files on the Programming Guide Folder

  • API Documentation: Provides details about the library's functions. It's essential to get acquainted with these to effectively utilize the library.
  • Programming Guide: Explains the design of the library and offers guidance on how to use it. Please read the files in the programming guide section to gain a comprehensive understanding.
  • Changes from the original: The name of the functions its diferent from the api documentation and programming guide, the only modification its the rtk_ to rtl_ on the start of the function names.

About This Library

To use include the 'rtl_api.hpp' on your project.

The classes is divided for each function parts, please see the rtl_api.hpp file and each class file for more details.

Example:

#include "rtl_api.hpp"

// Create a new instance of the class
rtl_api rtl;

// Probe the switch chip and get the chip information
switch_chip_t chip;
rtl.rtlSwitch.rtl_switch_probe(&chip);

// Inicialize the switch chip
rtl.rtlSwitch.rtl_switch_init();

// Read the port information
rtl.port.rtl_port_phyStatus_get([portVariables]);

New functions and features

The clearVlan function was added to the library, it's used to clear all the vlans on the switch, to use call the rtl.vlan.clearVlan('vlanId').

You can also change the sda and scl pins on the library, just call the rtl.changeI2cPins(sdaPin,sclPin).

To change the i2c delay use the rtl.changeI2cDelay(delayMs), the default value is 1ms.

To reset the switch use the rtl.reset() function.

About

Realtek Unmanaged Switch Class Wrapper is a user-friendly Arduino library for Realtek's unmanaged switch ICs. It wraps around Realtek's original library, making it easier to use with clear, object-oriented classes. This library simplifies coding and improves the way you work with Realtek switches in Arduino projects.

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Languages