Macros | Functions | Variables
linux/eepromtool/eepromtool.c File Reference

EEprom tool for Simple Open EtherCAT master. More...

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "ethercat.h"
Include dependency graph for linux/eepromtool/eepromtool.c:

Go to the source code of this file.

Macros

#define CRCBUF   14
 
#define IHEXLENGTH   0x20
 
#define MAXBUF   524288
 
#define MAXSLENGTH   256
 
#define MINBUF   128
 
#define MODE_INFO   6
 
#define MODE_NONE   0
 
#define MODE_READBIN   1
 
#define MODE_READINTEL   2
 
#define MODE_WRITEALIAS   5
 
#define MODE_WRITEBIN   3
 
#define MODE_WRITEINTEL   4
 
#define STDBUF   2048
 

Functions

void calc_crc (uint8 *crc, uint8 b)
 
int eeprom_read (int slave, int start, int length)
 
int eeprom_write (int slave, int start, int length)
 
int eeprom_writealias (int slave, int alias, uint16 crc)
 
void eepromtool (char *ifname, int slave, int mode, char *fname)
 
int input_bin (char *fname, int *length)
 
int input_intelhex (char *fname, int *start, int *length)
 
int main (int argc, char *argv[])
 
int output_bin (char *fname, int length)
 
int output_intelhex (char *fname, int length)
 
uint16 SIIcrc (uint8 *buf)
 

Variables

int alias
 
uint8 ebuf [MAXBUF]
 
int mode
 
uint8 ob
 
int os
 
uint16 ow
 
int slave
 
char sline [MAXSLENGTH]
 
ec_timet tdif
 
ec_timet tend
 
ec_timet tstart
 
int wkc
 

Detailed Description

EEprom tool for Simple Open EtherCAT master.

Usage : eepromtool ifname slave OPTION fname|alias ifname is NIC interface, f.e. eth0 slave = slave number in EtherCAT order 1..n -r read EEPROM, output binary format -ri read EEPROM, output Intel Hex format -w write EEPROM, input binary format -wi write EEPROM, input Intel Hex format -i display EEPROM information -walias write slave alias in EEPROM

(c)Arthur Ketels 2010-2012

Definition in file linux/eepromtool/eepromtool.c.

Macro Definition Documentation

◆ CRCBUF

#define CRCBUF   14

Definition at line 26 of file linux/eepromtool/eepromtool.c.

◆ IHEXLENGTH

#define IHEXLENGTH   0x20

Definition at line 49 of file linux/eepromtool/eepromtool.c.

◆ MAXBUF

#define MAXBUF   524288

Definition at line 23 of file linux/eepromtool/eepromtool.c.

◆ MAXSLENGTH

#define MAXSLENGTH   256

Definition at line 36 of file linux/eepromtool/eepromtool.c.

◆ MINBUF

#define MINBUF   128

Definition at line 25 of file linux/eepromtool/eepromtool.c.

◆ MODE_INFO

#define MODE_INFO   6

Definition at line 34 of file linux/eepromtool/eepromtool.c.

◆ MODE_NONE

#define MODE_NONE   0

Definition at line 28 of file linux/eepromtool/eepromtool.c.

◆ MODE_READBIN

#define MODE_READBIN   1

Definition at line 29 of file linux/eepromtool/eepromtool.c.

◆ MODE_READINTEL

#define MODE_READINTEL   2

Definition at line 30 of file linux/eepromtool/eepromtool.c.

◆ MODE_WRITEALIAS

#define MODE_WRITEALIAS   5

Definition at line 33 of file linux/eepromtool/eepromtool.c.

◆ MODE_WRITEBIN

#define MODE_WRITEBIN   3

Definition at line 31 of file linux/eepromtool/eepromtool.c.

◆ MODE_WRITEINTEL

#define MODE_WRITEINTEL   4

Definition at line 32 of file linux/eepromtool/eepromtool.c.

◆ STDBUF

#define STDBUF   2048

Definition at line 24 of file linux/eepromtool/eepromtool.c.

Function Documentation

◆ calc_crc()

void calc_crc ( uint8 crc,
uint8  b 
)

Definition at line 51 of file linux/eepromtool/eepromtool.c.

◆ eeprom_read()

int eeprom_read ( int  slave,
int  start,
int  length 
)

Definition at line 202 of file linux/eepromtool/eepromtool.c.

◆ eeprom_write()

int eeprom_write ( int  slave,
int  start,
int  length 
)

Definition at line 256 of file linux/eepromtool/eepromtool.c.

◆ eeprom_writealias()

int eeprom_writealias ( int  slave,
int  alias,
uint16  crc 
)

Definition at line 289 of file linux/eepromtool/eepromtool.c.

◆ eepromtool()

void eepromtool ( char *  ifname,
int  slave,
int  mode,
char *  fname 
)

Definition at line 313 of file linux/eepromtool/eepromtool.c.

◆ input_bin()

int input_bin ( char *  fname,
int *  length 
)

Definition at line 77 of file linux/eepromtool/eepromtool.c.

◆ input_intelhex()

int input_intelhex ( char *  fname,
int *  start,
int *  length 
)

Definition at line 94 of file linux/eepromtool/eepromtool.c.

◆ main()

int main ( int  argc,
char *  argv[] 
)

Definition at line 433 of file linux/eepromtool/eepromtool.c.

◆ output_bin()

int output_bin ( char *  fname,
int  length 
)

Definition at line 157 of file linux/eepromtool/eepromtool.c.

◆ output_intelhex()

int output_intelhex ( char *  fname,
int  length 
)

Definition at line 173 of file linux/eepromtool/eepromtool.c.

◆ SIIcrc()

uint16 SIIcrc ( uint8 buf)

Definition at line 64 of file linux/eepromtool/eepromtool.c.

Variable Documentation

◆ alias

int alias

Definition at line 43 of file linux/eepromtool/eepromtool.c.

◆ ebuf

uint8 ebuf[MAXBUF]

Definition at line 38 of file linux/eepromtool/eepromtool.c.

◆ mode

int mode

Definition at line 46 of file linux/eepromtool/eepromtool.c.

◆ ob

uint8 ob

Definition at line 39 of file linux/eepromtool/eepromtool.c.

◆ os

int os

Definition at line 41 of file linux/eepromtool/eepromtool.c.

◆ ow

uint16 ow

Definition at line 40 of file linux/eepromtool/eepromtool.c.

◆ slave

int slave

Definition at line 42 of file linux/eepromtool/eepromtool.c.

◆ sline

char sline[MAXSLENGTH]

Definition at line 47 of file linux/eepromtool/eepromtool.c.

◆ tdif

ec_timet tdif

Definition at line 44 of file linux/eepromtool/eepromtool.c.

◆ tend

ec_timet tend

Definition at line 44 of file linux/eepromtool/eepromtool.c.

◆ tstart

ec_timet tstart

Definition at line 44 of file linux/eepromtool/eepromtool.c.

◆ wkc

int wkc

Definition at line 45 of file linux/eepromtool/eepromtool.c.



soem
Author(s): Arthur Ketels and M.J.G. van den Molengraft
autogenerated on Mon Feb 28 2022 23:46:57