Defines | Functions | Variables
eepromtool.c File Reference

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

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/time.h>
#include <unistd.h>
#include <time.h>
#include "ethercat_soem/ethercattype.h"
#include "ethercat_soem/nicdrv.h"
#include "ethercat_soem/ethercatbase.h"
#include "ethercat_soem/ethercatmain.h"
#include "ethercat_soem/ethercatcoe.h"
Include dependency graph for eepromtool.c:

Go to the source code of this file.

Defines

#define CRCBUF   14
#define IHEXLENGTH   0x20
#define MAXBUF   32768
#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]
struct timeval tstart tend tdif
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 eepromtool.c.


Define Documentation

#define CRCBUF   14

Definition at line 36 of file eepromtool.c.

#define IHEXLENGTH   0x20

Definition at line 59 of file eepromtool.c.

#define MAXBUF   32768

Definition at line 33 of file eepromtool.c.

#define MAXSLENGTH   256

Definition at line 46 of file eepromtool.c.

#define MINBUF   128

Definition at line 35 of file eepromtool.c.

#define MODE_INFO   6

Definition at line 44 of file eepromtool.c.

#define MODE_NONE   0

Definition at line 38 of file eepromtool.c.

#define MODE_READBIN   1

Definition at line 39 of file eepromtool.c.

#define MODE_READINTEL   2

Definition at line 40 of file eepromtool.c.

#define MODE_WRITEALIAS   5

Definition at line 43 of file eepromtool.c.

#define MODE_WRITEBIN   3

Definition at line 41 of file eepromtool.c.

#define MODE_WRITEINTEL   4

Definition at line 42 of file eepromtool.c.

#define STDBUF   2048

Definition at line 34 of file eepromtool.c.


Function Documentation

void calc_crc ( uint8 crc,
uint8  b 
)

Definition at line 61 of file eepromtool.c.

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

Definition at line 212 of file eepromtool.c.

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

Definition at line 266 of file eepromtool.c.

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

Definition at line 300 of file eepromtool.c.

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

Definition at line 325 of file eepromtool.c.

int input_bin ( char *  fname,
int *  length 
)

Definition at line 87 of file eepromtool.c.

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

Definition at line 104 of file eepromtool.c.

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

Definition at line 445 of file eepromtool.c.

int output_bin ( char *  fname,
int  length 
)

Definition at line 167 of file eepromtool.c.

int output_intelhex ( char *  fname,
int  length 
)

Definition at line 183 of file eepromtool.c.

uint16 SIIcrc ( uint8 buf)

Definition at line 74 of file eepromtool.c.


Variable Documentation

int alias

Definition at line 53 of file eepromtool.c.

Definition at line 48 of file eepromtool.c.

int mode

Definition at line 56 of file eepromtool.c.

Definition at line 49 of file eepromtool.c.

int os

Definition at line 51 of file eepromtool.c.

Definition at line 50 of file eepromtool.c.

int slave

Definition at line 52 of file eepromtool.c.

Definition at line 57 of file eepromtool.c.

struct timeval tstart tend tdif

Definition at line 54 of file eepromtool.c.

int wkc

Definition at line 55 of file eepromtool.c.



ethercat_soem
Author(s): Arthur Ketels, M.J.G. van de Molengraft
autogenerated on Wed Aug 26 2015 11:32:40