rasProject_01 / weSweetHome
R. 240
process control / RasPi software by weinert-automation
|
Definitions for Raspberry Pi's serial communication. More...
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... | |
Definitions 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.h on the other hand is.
Some structures and utilities are to support smart meters like e.g. SDM230Modbus, SMD630Modbus and SDM538Modbus as servers/slaves, especially their handling of (32 bit) float values.
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.
|
extern |
The UART as file (stream).
It is > 0 (>2) when open and -1 when closed.
|
extern |
The UART's path name.
It will be preset with the architecture's standard UART path.