buses_configurable.h File Reference


Data Structures

struct  _BUS_BUF_CONF
struct  _BUS_CONFIG
struct  _BUS_INFO

Defines

#define BUS_BUFFERS   8
#define BUS_COUNT   (sizeof(BUS_BUF_CONF))
#define BUSBUF0_SIZE   128
#define BUSBUF1_SIZE   128
#define BUSBUF2_SIZE   64
#define BUSBUF3_SIZE   64
#define BUSBUF4_SIZE   32
#define BUSBUF5_SIZE   32
#define BUSBUF6_SIZE   32
#define BUSBUF7_SIZE   32
#define getBufSize(i)   (i==0?BUSBUF0_SIZE: (i==1?BUSBUF1_SIZE:0))
#define getBufSizeConst(n)   ((n==8)?1: ((n==16)?2: ((n==32)?3: ((n==64)?4: ((n==128)?5: ((n==256)?6: ((n==512)?7:0)))))))

Typedefs

typedef struct _BUS_BUF_CONF BUS_BUF_CONF
typedef struct _BUS_CONFIG BUS_CONFIG
typedef struct _BUS_INFO BUS_INFO

Functions

BYTE busGetArray (BYTE bufID, BYTE *buf, BYTE len)
void busGetByte (BYTE bufID, BYTE b)
void busInit (void)
BYTE busIsGetReady (BYTE bufID)
BYTE busIsPutReady (BYTE bufID)
void busProcess (void)
void busPutArray (BYTE bufID, BYTE *buf, BYTE len)
void busPutByte (BYTE bufID, BYTE b)

Variables

BYTE busBuf0 [BUSBUF0_SIZE]
BYTE busBuf1 [BUSBUF1_SIZE]
BYTE busBuf2 [BUSBUF2_SIZE]
BYTE busBuf3 [BUSBUF3_SIZE]
BYTE busBuf4 [BUSBUF4_SIZE]
BYTE busBuf5 [BUSBUF5_SIZE]
BYTE busBuf6 [BUSBUF6_SIZE]
BYTE busBuf7 [BUSBUF7_SIZE]
BUS_CONFIG busConfig
BUS_INFO busInfo

Define Documentation

#define BUS_BUFFERS   8

#define BUS_COUNT   (sizeof(BUS_BUF_CONF))

The number of buses

#define BUSBUF0_SIZE   128

#define BUSBUF1_SIZE   128

#define BUSBUF2_SIZE   64

#define BUSBUF3_SIZE   64

#define BUSBUF4_SIZE   32

#define BUSBUF5_SIZE   32

#define BUSBUF6_SIZE   32

#define BUSBUF7_SIZE   32

#define getBufSize (  )     (i==0?BUSBUF0_SIZE: (i==1?BUSBUF1_SIZE:0))

#define getBufSizeConst (  )     ((n==8)?1: ((n==16)?2: ((n==32)?3: ((n==64)?4: ((n==128)?5: ((n==256)?6: ((n==512)?7:0)))))))

Returns the constant value from 1 to 7 used to represent a buffer of 8, 16, ... to 512 bytes in size.

Parameters:
n Buffer size, must be one of the following values: 8, 16, 32, 64, 128, 256 or 512
Returns:
Returns a constant value representing the buffer size. For example, 1 is return for a buffer size of 8.


Typedef Documentation

typedef struct _BUS_BUF_CONF BUS_BUF_CONF

Structure used for configuraing TX and RX buffers for each bus.

Bits 0-3 of each element contains a value from 0-7 giving the buffer ID of the buffer assigned to this bus.

Bits 4-7 give the buffer size, where 0=undef, 1=8, 2=16, .. 6=256 and 7=512.

If the bus does not have a bus assigned to it, it will have a value of 0

typedef struct _BUS_CONFIG BUS_CONFIG

Structure for storing bus configuration data that needs fast access. This structure is created in the processors internal RAM, and is initialized with the contents of the corresponding bytes in EEPROM at startup. Whenever the application needs to access any of these variables, it will read them straight from this RAM structure in stead of reading them from the EEPROM.

typedef struct _BUS_INFO BUS_INFO

Structure containing bus data.


Function Documentation

BYTE busGetArray ( BYTE  bufID,
BYTE buf,
BYTE  len 
)

Gets an array of bytes from the given buffer.

Parameters:
bufID The buffer ID, is a number from 0 to n identifying the buffer
buf The byte array to add to the read bytes to
len The number of bytes to read
Returns:
The actual number of bytes read

void busGetByte ( BYTE  bufID,
BYTE  b 
)

Gets a single byte from the given buffer. If any bus is assigned to this buffer, it will transmit this data.

Parameters:
bufID The buffer ID, is a number from 0 to n identifying the buffer
b The byte to add to the given buffer

void busInit ( void   ) 

Initializes "UDP Command Port" and "UDP Command Responce Port". These ports are used for sending and receiving and commands via the UDP port.

BYTE busIsGetReady ( BYTE  bufID  ) 

Returns the number of bytes that can be read from the given buffer.

Parameters:
bufID The buffer ID, is a number from 0 to n identifying the buffer
Returns:
The number of bytes that can be read from the given buffer

BYTE busIsPutReady ( BYTE  bufID  ) 

Returns the number of bytes that can be written to the given buffer.

Parameters:
bufID The buffer ID, is a number from 0 to n identifying the buffer
Returns:
The number of bytes that can be written to the given buffer

void busProcess ( void   ) 

Must be called every couple of ms

void busPutArray ( BYTE  bufID,
BYTE buf,
BYTE  len 
)

Adds the given byte array to the given buffer. If any bus is assigned to this buffer, it will transmit this data.

Parameters:
bufID The buffer ID, is a number from 0 to n identifying the buffer
buf The byte array to add to the given buffer
len The length of the buf array

void busPutByte ( BYTE  bufID,
BYTE  b 
)

Adds the given byte to the given buffer. If any bus is assigned to this buffer, it will transmit this data.

Parameters:
bufID The buffer ID, is a number from 0 to n identifying the buffer
b The byte to add to the given buffer


Variable Documentation

BYTE busBuf0[BUSBUF0_SIZE]

BYTE busBuf1[BUSBUF1_SIZE]

BYTE busBuf2[BUSBUF2_SIZE]

BYTE busBuf3[BUSBUF3_SIZE]

BYTE busBuf4[BUSBUF4_SIZE]

BYTE busBuf5[BUSBUF5_SIZE]

BYTE busBuf6[BUSBUF6_SIZE]

BYTE busBuf7[BUSBUF7_SIZE]


Generated on Wed Feb 3 12:45:34 2010 for SBC65EC Web Server by  doxygen 1.5.8