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 "ethercattype.h"
#include "nicdrv.h"
#include "ethercatbase.h"
#include "ethercatmain.h"
#include "ethercatcoe.h"
Include dependency graph for eepromtool.c:

Go to the source code of this file.

Defines

#define MAXBUF   32768
#define STDBUF   2048
#define MINBUF   128
#define MODE_NONE   0
#define MODE_READBIN   1
#define MODE_READINTEL   2
#define MODE_WRITEBIN   3
#define MODE_WRITEINTEL   4
#define MAXSLENGTH   256
#define IHEXLENGTH   0x20

Functions

int input_bin (char *fname, int *length)
int input_intelhex (char *fname, int *start, int *length)
int output_bin (char *fname, int length)
int output_intelhex (char *fname, int length)
int eeprom_read (int slave, int start, int length)
int eeprom_write (int slave, int start, int length)
void eepromtool (char *ifname, int slave, int mode, char *fname)
int main (int argc, char *argv[])

Variables

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

Detailed Description

EEprom tool for Simple Open EtherCAT master.

Usage : eepromtool ifname slave OPTION fname 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

(c)Arthur Ketels 2010

Definition in file eepromtool.c.


Define Documentation

#define IHEXLENGTH   0x20

Definition at line 53 of file eepromtool.c.

#define MAXBUF   32768

Definition at line 31 of file eepromtool.c.

#define MAXSLENGTH   256

Definition at line 41 of file eepromtool.c.

#define MINBUF   128

Definition at line 33 of file eepromtool.c.

#define MODE_NONE   0

Definition at line 35 of file eepromtool.c.

#define MODE_READBIN   1

Definition at line 36 of file eepromtool.c.

#define MODE_READINTEL   2

Definition at line 37 of file eepromtool.c.

#define MODE_WRITEBIN   3

Definition at line 38 of file eepromtool.c.

#define MODE_WRITEINTEL   4

Definition at line 39 of file eepromtool.c.

#define STDBUF   2048

Definition at line 32 of file eepromtool.c.


Function Documentation

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

Definition at line 176 of file eepromtool.c.

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 228 of file eepromtool.c.

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 260 of file eepromtool.c.

Here is the call graph for this function:

Here is the caller graph for this function:

int input_bin ( char *  fname,
int *  length 
)

Definition at line 55 of file eepromtool.c.

Here is the caller graph for this function:

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

Definition at line 71 of file eepromtool.c.

Here is the caller graph for this function:

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

Definition at line 351 of file eepromtool.c.

Here is the call graph for this function:

int output_bin ( char *  fname,
int  length 
)

Definition at line 133 of file eepromtool.c.

Here is the caller graph for this function:

int output_intelhex ( char *  fname,
int  length 
)

Definition at line 148 of file eepromtool.c.

Here is the caller graph for this function:


Variable Documentation

uint8 ebuf[MAXBUF]

Definition at line 43 of file eepromtool.c.

int mode

Definition at line 50 of file eepromtool.c.

Definition at line 44 of file eepromtool.c.

int os

Definition at line 46 of file eepromtool.c.

Definition at line 45 of file eepromtool.c.

int slave

Definition at line 47 of file eepromtool.c.

char sline[MAXSLENGTH]

Definition at line 51 of file eepromtool.c.

struct timeval tstart tend tdif

Definition at line 48 of file eepromtool.c.

int wkc

Definition at line 49 of file eepromtool.c.

Generated by  doxygen 1.6.3