rasProject_01 / weSweetHome
R. 240
process control / RasPi software by weinert-automation
|
Functions for Raspberry Pi's serial communication. More...
#include "weSerial.h"
Functions | |
tcflag_t | baudFlag (unsigned int const speed) |
Baud flags by baud rate. More... | |
unsigned int | baudRate (tcflag_t baudFlag) |
Baud rate by baud flags. More... | |
void | closeUART () |
Close the UART. More... | |
int | openUART () |
Open the UART with given settings. More... | |
Variables | |
tcflag_t | baud |
The UART's baud rate as flag bits. | |
struct termios | options |
The UART's setting structure. | |
unsigned int | speed |
The UART's baud rate as value. | |
timespec | startReceive |
Time used for receive timing. | |
int | uartFilestream |
The UART as file (stream). More... | |
char * | uartPath |
The UART's path name. More... | |
Functions for Raspberry Pi's serial communication.
Revision history
This is a (basic) library for serial communications. As far as Modbus is or can be supported this is independent of Stéphane Raimbault's Modbus library libmodbus; weModbus.c on the other hand is.
For documentation see the include file weSerial.h
tcflag_t baudFlag | ( | unsigned int const | speed | ) |
Baud flags by baud rate.
speed | a legal baudrate 300 9600 19200 and so on |
unsigned int baudRate | ( | tcflag_t | baudFlag | ) |
Baud rate by baud flags.
The speed bits of the parameter baudFlag will be evaluated and the corresponding baud rate will be returned. In vase of no valid speed flag value 0 will be returned. 0 may be considered as error and should be defaulted to 9600.
baudFlag | the speed bits of the flags parameter will be evaluated |
int openUART | ( | ) |
Open the UART with given settings.
void closeUART | ( | ) |
Close the UART.
uartFilestream will be set to -1.
int uartFilestream |
The UART as file (stream).
It is > 0 (>2) when open and -1 when closed.
char* uartPath |
The UART's path name.
It will be preset with the architecture's standard UART path.