GithubHelp home page GithubHelp logo

arduino-ethercat-slave's Introduction

Arduino-EtherCAT-Slave

Be sure to look at the license.

LAN925X_SPI(.cpp&.h):Low Level(SPI peripheral) Source
LAN9252(.cpp&.h):Source for LAN9252

example

LAN925X_SPI_Init();      <- It is absolutely necessary.

// RESET
//LAN9252_RESET();      <- option.

// Chip ID_REV register read.
addr = ID_REV;
rdata = LAN925X_SPI_READ(addr);
sprintf(S1,"ID_REV[0x%04X]: 0x%08lX \n\r",addr,rdata);
UART_TX_Stringth(S1);

// Chip BYTE_TEST register read.
addr = BYTE_TEST;
rdata = LAN925X_SPI_READ(addr);
sprintf(S1,"BYTE_TEST[0x%04X]: 0x%08lX \n\r",addr,rdata);
UART_TX_Stringth(S1);

// Chip FREE_RUN register read.
addr = FREE_RUN;
rdata = LAN925X_SPI_READ(addr);
sprintf(S1,"FREE_RUN[0x%04X]: 0x%08lX \n\r",addr,rdata);
UART_TX_Stringth(S1);

// CSR Type_Register register read.
addr = Type_Register;
rdata = LAN9252_EtherCAT_CSR_READ(CSR_SIZE_32bit,addr);
sprintf(S1,"Type_Register[0x%04X]: 0x%08lX \n\r",addr,rdata);
UART_TX_Stringth(S1);

// CSR Product_ID register read.
addr = Product_ID;
rdata = LAN9252_EtherCAT_CSR_READ(CSR_SIZE_32bit,addr);
sprintf(S1,"Product_ID[0x%04X]: 0x%08lX \n\r",addr,rdata);
UART_TX_Stringth(S1);

// CSR Vendor_ID register read.
addr = Vendor_ID;
rdata = LAN9252_EtherCAT_CSR_READ(CSR_SIZE_32bit,addr);
sprintf(S1,"Vendor_ID[0x%04X]: 0x%08lX \n\r",addr,rdata);
UART_TX_Stringth(S1);

// CSR Process_Data_RAM register read.
addr = Process_Data_RAM;
rdata = LAN9252_EtherCAT_CSR_READ(CSR_SIZE_32bit,addr);
sprintf(S1,"Process_Data_RAM[0x%04X]: 0x%08lX \n\r",addr,rdata);
UART_TX_Stringth(S1);

arduino-ethercat-slave's People

Contributors

nonnoise avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.