My Documents/icctest/ASIO/asio.h File Reference


Defines

#define ASIO_PIN_MAP(pin)   (1 << pin)
#define ASIO_TX_PIN_MAP   ASIO_PIN_MAP(30)
#define ASIO_RX_PIN_MAP   ASIO_PIN_MAP(31)
#define ASIO_STOP_BITS   2
#define ASIO_RT_INVERTED   0
#define ASIO_TX_INVERTED   ASIO_RT_INVERTED
#define ASIO_RX_INVERTED   ASIO_RT_INVERTED

Enumerations

enum  asio_speed

Functions

void asio_handler (void)
void asio_init (int rxmap, int txmap, int rxflowmap, int txflowmap, ASIO_SPEED_EN speed)
void asio_tx (char c)
void asio_txString (char *str)
int asio_rx (void)
int asio_rxString (char *str, int len)

Detailed Description


Define Documentation

#define ASIO_PIN_MAP ( pin   )     (1 << pin)

Macro to get pinmap

#define ASIO_RT_INVERTED   0

Use this define to invert the interface sense (or not)

#define ASIO_RX_INVERTED   ASIO_RT_INVERTED

Use this define to invert the RX interface sense (or not)

#define ASIO_RX_PIN_MAP   ASIO_PIN_MAP(31)

Define RX pin map. Using bit 31 for rx works fine.

#define ASIO_STOP_BITS   2

Use large number (100+) of TX stop or "idle" bits for slow interfaces adjust at your liesure.

#define ASIO_TX_INVERTED   ASIO_RT_INVERTED

Use this define to invert the TX interface sense (or not)

#define ASIO_TX_PIN_MAP   ASIO_PIN_MAP(30)

Define TX pin map. This code works with ICC April Alpha update. Early ICC March 29 Alpha release has issues with asm(...) parameters. Hard-coding the setbit asm call will make this work. i.e. asm("or OUTA, $40000000");


Enumeration Type Documentation

enum asio_speed

Typedef enum defining speed to use for the interface. The number in the enum is actually the tick period used by the driver.


Function Documentation

void asio_handler ( void   ) 

Handle transmit and receive here. Hard to make our deadline ... again :) LMM/Time lessons learned with beta preview:

void asio_init ( int  rxmap,
int  txmap,
int  rxflowmap,
int  txflowmap,
ASIO_SPEED_EN  speed 
)

Init interface direction bits and speed. Interface uses "N,1,8": no parity, 1 stop bit, 8 data bits.

Note:
A pin map is a power of 2 integer representing the pin used for a function. If pin 0 is to be the receive pin, then 0x1 (2^0) would be passed via rxmap.

Flow control parameters are reserved and have no affect today except the direction is set if the pinmap is non-zero for rxflow (backpressure bit).

The only way to do invert on an interface today is to define override the default constant value. Using a variable would likely change timing.

Parameters:
rxmap is receive pin map.
txmap is transmit pin map.
rxflowmap is receive flow control pin map; disabled if 0.
txflowmap is transmit flow control pin map; disabled if 0.
speed is a typedef enum integer indicating interface bit rate.

int asio_rx ( void   ) 

Get a byte from the serial interface. param are set by # define constants in asio.h

Returns:
int representing byte received.

int asio_rxString ( char *  str,
int  len 
)

Use calls to asio_rx until a terminator like "\r" is found. All strings returned are null terminated.

Parameters:
str is a predefined input buffer of len.
len is maximum number of chars to receive in buffer.
Returns:
number of bytes received.

void asio_tx ( char  val  ) 

Transmit a char on interface.

Parameters:
val is byte to send

void asio_txString ( char *  str  ) 

Transmit a string on interface.

Parameters:
str is string to send.


Generated on Thu Apr 17 12:27:00 2008 for ASIO by  doxygen 1.5.4