Main Page | Modules | File List | Globals | Related Pages

* 3 Host Routines

Platform dependant functions. More...

Defines

#define XSVFEXEC_VERSION   "1.0.1"
 Executor version string.

#define SET_TMS()   sbi(PORTF, 5)
 Set TMS high on Ethernut 2.

#define CLR_TMS()   cbi(PORTF, 5)
 Set TMS low on Ethernut 2.

#define SET_TDI()   sbi(PORTF, 6)
 Set TDI high on Ethernut 2.

#define CLR_TDI()   cbi(PORTF, 6)
 Set TDI low on Ethernut 2.

#define SET_TCK()   sbi(PORTF, 4)
 Set TCK high on Ethernut 2.

#define CLR_TCK()   cbi(PORTF, 4)
 Set TCK low on Ethernut 2.

#define GET_TDO()   bit_is_set(PINF, 7)
 Get TDO status on Ethernut 2.

#define SET_TMS_TCK()   { SET_TMS(); CLR_TCK(); SET_TCK(); }
 Set TMS high and toggle TCK.

#define CLR_TMS_TCK()   { CLR_TMS(); CLR_TCK(); SET_TCK(); }
 Set TMS low and toggle TCK.


Functions

int XsvfInit (void)
 Initialize the platform dependant interface.

void XsvfExit (int rc)
 Shutdown the platform dependant interface.

int XsvfGetError (void)
 Retrieve the last error occured in this module.

u_char XsvfGetByte (void)
 Get next byte from XSVF buffer.

u_char XsvfGetCmd (void)
 Get next command byte from XSVF buffer.

u_char XsvfGetState (u_char state0, u_char state1)
 Get next byte from XSVF buffer and select a TAP state.

short XsvfGetShort (void)
 Get next short value from XSVF buffer.

long XsvfGetLong (void)
 Get next long value from XSVF buffer.

int XsvfReadBitString (void *buf, int num)
 Read a specified number of bits from XSVF buffer.

int XsvfSkipComment (void)
 Skip comment in the XSVF buffer.

void XsvfDelay (long usecs)
 Microsecond delay.


Variables

int fh
 Handle of XSVF file.

int xsvf_err
 Last error occured in this module.


Detailed Description

Platform dependant functions.

From the very first line of code XSVF-Executor had been created with portability in mind. No other than this module should require changes.


Function Documentation

void XsvfDelay long  usecs  ) 
 

Microsecond delay.

Parameters:
usecs Number of microseconds.

Definition at line 418 of file host.c.

Referenced by ReShift().

void XsvfExit int  rc  ) 
 

Shutdown the platform dependant interface.

On most embedded platforms this routine will never return.

Parameters:
rc Programming result code.

Definition at line 204 of file host.c.

References fh.

Referenced by main().

u_char XsvfGetByte void   ) 
 

Get next byte from XSVF buffer.

Call XsvfGetError() to check for errors,

Returns:
Byte value.

Definition at line 242 of file host.c.

References fh, XE_DATAUNDERFLOW, and xsvf_err.

Referenced by Execute().

u_char XsvfGetCmd void   ) 
 

Get next command byte from XSVF buffer.

Returns:
XSVF command or XUNKNOWN if an error occured.

Definition at line 261 of file host.c.

References fh, and XUNKNOWN.

Referenced by Execute().

int XsvfGetError void   ) 
 

Retrieve the last error occured in this module.

Returns:
Error code or 0 if no error occured.

Definition at line 230 of file host.c.

References xsvf_err.

Referenced by Execute().

long XsvfGetLong void   ) 
 

Get next long value from XSVF buffer.

Call XsvfGetError() to check for errors,

Returns:
Long value.

Definition at line 336 of file host.c.

References fh, XE_DATAUNDERFLOW, and xsvf_err.

Referenced by Execute().

short XsvfGetShort void   ) 
 

Get next short value from XSVF buffer.

Call XsvfGetError() to check for errors,

Returns:
Short value.

Definition at line 312 of file host.c.

References fh, XE_DATAUNDERFLOW, and xsvf_err.

Referenced by Execute().

u_char XsvfGetState u_char  state0,
u_char  state1
 

Get next byte from XSVF buffer and select a TAP state.

Parameters:
state0 Returned state, if the byte value is zero.
state1 Returned state, if the byte value is one.
Returns:
TAP state or UNKNOWN_STATE if an error occured.

Definition at line 284 of file host.c.

References fh, and UNKNOWN_STATE.

Referenced by Execute().

int XsvfInit void   ) 
 

Initialize the platform dependant interface.

All required hardware initializations should be done in this routine. We may also initiate debug output. If the XSVF date is located in a file system, then the file will be opened here as well.

Returns:
Zero on success, otherwise an error code is returned.

Definition at line 153 of file host.c.

References fh, XE_DATAUNDERFLOW, XSVFEXEC_VERSION, and XSVFNAME.

Referenced by main().

int XsvfReadBitString void *  buf,
int  num
 

Read a specified number of bits from XSVF buffer.

Parameters:
buf Pointer to the buffer which receives the bit string.
num Number of bits to read.
Returns:
Error code or 0 if no error occured.

Definition at line 363 of file host.c.

References fh, MAX_BITVEC_BYTES, XE_DATAOVERFLOW, XE_DATAUNDERFLOW, and xsvf_err.

Referenced by Execute(), and Shift().

int XsvfSkipComment void   ) 
 

Skip comment in the XSVF buffer.

Returns:
Error code or 0 if no error occured.

Definition at line 395 of file host.c.

References fh, XE_DATAUNDERFLOW, and xsvf_err.

Referenced by Execute().


© 2004 by egnite Software GmbH - visit http://www.ethernut.de/