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) |
#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");
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.
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.
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.
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
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.
str | is a predefined input buffer of len. | |
len | is maximum number of chars to receive in buffer. |
void asio_tx | ( | char | val | ) |
Transmit a char on interface.
val | is byte to send |
void asio_txString | ( | char * | str | ) |
Transmit a string on interface.
str | is string to send. |