#include "asio.h"
#include <propeller.h>
Functions | |
void | asio_init (int rxmap, int txmap, int rxflowmap, int txflowmap, ASIO_SPEED_EN speed) |
void | asio_tx (char val) |
void | asio_txString (char *str) |
int | asio_rx (void) |
int | asio_rxString (char *str, int len) |
void | asio_handler (void) |
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. |