- GPIB/ECB modules completed, ecb motor driver in progress

This commit is contained in:
cvs
2003-01-17 16:09:34 +00:00
parent bbc0b64c43
commit f45c3ebf55
27 changed files with 2030 additions and 84 deletions

61
ecb.h Normal file
View File

@@ -0,0 +1,61 @@
/*-----------------------------------------------------------------------
The ECB is a rack controller from Risoe based on a Z80 processor.
This module provides some functions for communicating with such a
device.
WARNING: This contains code which may be endian dependent!
copyright: see file COPYRIGHT
Mark Koennecke, January 2002, with some bits taken out of the
original tascom code.
------------------------------------------------------------------------*/
#ifndef ECBCON
#define ECBCON
#include "gpibcontroller.h"
typedef struct {
unsigned char d; /* D register in Z80 */
unsigned char e; /* E register in Z80 */
unsigned char b; /* B register in Z80 */
unsigned char c; /* C register in Z80 */
} Z80_reg;
/*-----------------------------------------------------------------------*/
typedef struct __ECB *pECB;
int ecbExecute(pECB self, int func, Z80_reg in, Z80_reg *out);
int ecbRead(pECB self, unsigned short address,
void *buffer, int byteCount);
int ecbWrite(pECB self, unsigned short address,
void *buffer, int byteCount);
void ecbClear(pECB self);
int fixECBError(pECB self);
void ecbErrorDescription(pECB self, char *buffer, int maxBytes);
/*-----------------------------------------------------------------------*/
int MakeECB(SConnection *pCon, SicsInterp *pSics,
void *pData,
int ragc, char *argv[]);
/*----------------------------------------------------------------------
for byte packing. result must be an 32 bit integer
----------------------------------------------------------------------*/
typedef union /* Used to extract and load data to Z80 regs. */{
unsigned int result;
struct
{
unsigned char byt0; /* Least significant byte */
unsigned char byt1;
unsigned char byt2;
unsigned char byt3; /* Most significant byte */
}b;
}Ecb_pack;
#endif