![]() |
PropWare
3.0.0.229
C++ objects and CMake build system for Parallax Propeller
|
Provides definitions for some low level serial port routines. More...
#include <compiler.h>
Include dependency graph for serial.h:Go to the source code of this file.
Macros | |
| #define | _DEFAULT_SERIAL_PUTCHAR _WEAK int putchar(int c) { return _serial_putchar(c); } |
| Define a default putchar which will use the serial port. More... | |
Functions | |
| int | _serial_tx (int c, unsigned int txmask, unsigned int bitcycles) |
| Transmit a byte out a pin. More... | |
| int | _serial_putchar (int c) |
| Transmit a byte out the serial port. More... | |
Provides definitions for some low level serial port routines.
Copyright (c) 2015 by Total Spectrum Software Inc. MIT Licensed
Definition in file serial.h.
| #define _DEFAULT_SERIAL_PUTCHAR _WEAK int putchar(int c) { return _serial_putchar(c); } |
Define a default putchar which will use the serial port.
This macro defines a default for putchar which will use _serial_putchar. The definition is "weak", so multiple uses of it are harmless, and will be overridden by any "strong" (normal) definition for putchar()
| int _serial_putchar | ( | int | c | ) |
Transmit a byte out the serial port.
This function transmits a single byte using _serial_tx. The pin and baud rate are selected from the defaults that can be changed by the loader.
| c | The 8-bit character to transmit (upper 24 bits are ignored). |
| int _serial_tx | ( | int | c, |
| unsigned int | txmask, | ||
| unsigned int | bitcycles | ||
| ) |
Transmit a byte out a pin.
This function transmits a single byte. The transmission is half-duplex (i.e. no bytes can be received while it is happening) and uses the current cog.
| c | The 8-bit character to transmit (upper 24 bits must be 0). |
| txmask | A bit mask with a 1 set to indicate the pin to use, 0 elsewhere. |
| bitcycles | Time (in CNT cycles) to wait between transmitting bits. |
1.8.17