Functions used for sending and receiving serial data.
More...
#include <stdint.h>
#include <stdbool.h>
Go to the source code of this file.
|
#define | ro(...) __attribute__((access(read_only, __VA_ARGS__))) |
|
#define | rw(...) __attribute__((access(read_write, __VA_ARGS__))) |
|
#define | wo(...) __attribute__((access(write_only, __VA_ARGS__))) |
|
|
enum | Serial_Bitrate {
SERIAL_BITRATE_300 = 0
, SERIAL_BITRATE_1200 = 1
, SERIAL_BITRATE_2400 = 2
, SERIAL_BITRATE_4800 = 3
,
SERIAL_BITRATE_9600 = 5
, SERIAL_BITRATE_19200 = 6
, SERIAL_BITRATE_38400 = 7
, SERIAL_BITRATE_57600 = 8
,
SERIAL_BITRATE_115200 = 9
} |
|
enum | Serial_Parity { SERIAL_PARITY_NONE = 0
, SERIAL_PARITY_ODD = 1
, SERIAL_PARITY_EVEN = 2
} |
|
enum | Serial_Data_Length { SERIAL_DATA_LENGTH_8BIT = 0
, SERIAL_DATA_LENGTH_7BIT = 1
} |
|
enum | Serial_Stop_Bits { SERIAL_STOP_BITS_1 = 0
, SERIAL_STOP_BITS_2 = 1
} |
|
|
struct | __attribute__ ((packed)) Serial_Settings |
|
|
int(* | Serial_Open )(const struct Serial_Settings *mode) ro(1) |
|
int(* | Serial_IsOpen )(void) |
|
int(* | Serial_Close )(bool abortPending) |
|
int(* | Serial_Read )(unsigned char *out, int sz, short *count) wo(1 |
|
int(* | wo )(3) |
|
int(* | Serial_ReadSingle )(unsigned char *out) wo(1) |
|
int(* | Serial_Peek )(int idx, unsigned char *out) wo(1) |
|
int(* | Serial_PollRX )(void) |
|
int(* | Serial_ClearRX )(void) |
|
int(* | Serial_Write )(const unsigned char *buf, int count) ro(1 |
|
int(*) int(* | Serial_WriteSingle )(unsigned char x) |
|
int(* | Serial_WriteUnbuffered )(unsigned char x) |
|
int(* | Serial_PollTX )(void) |
|
int(* | Serial_ClearTX )(void) |
|
Functions used for sending and receiving serial data.
◆ Serial_Open
int(* Serial_Open) (const struct Serial_Settings *mode) ro(1) |
( |
const struct Serial_Settings * |
mode | ) |
|
|
extern |
Opens the 3-pin serial port with the specified parameters. see https://prizm.cemetech.net/index.php?title=Serial_Open for more info. mode: 0 always 0 1 bit rate 0=300, 5=9600, 9=115200 2 parity 0=none, 1=odd, 2=even 3 data length 0=8bit, 1=7bit 4 stop bits 0=1bit, 1=2bit 5 always 0 Returns: 0 success 3 already open
- Parameters
-
mode | The mode of the serial port. |
◆ Serial_Write
int(* Serial_Write) (const unsigned char *buf, int count) ro(1 |
( |
const unsigned char * |
buf, |
|
|
int |
count |
|
) |
| |
|
extern |