Calduino
1.0
|
#include <Calduino.h>
Public Member Functions | |
EMSSerial (volatile uint8_t *ubrrh, volatile uint8_t *ubrrl, volatile uint8_t *ucsra, volatile uint8_t *ucsrb, volatile uint8_t *ucsrc, volatile uint8_t *udr, uint8_t rxen, uint8_t txen, uint8_t rxcie) | |
EMSSerial () | |
bool | begin (unsigned long baud) |
void | end () |
void | writeEOF () |
virtual int | available (void) |
bool | frameError () |
virtual int | peek (void) |
virtual int | read (void) |
virtual void | flush (void) |
virtual size_t | write (uint8_t) |
size_t | write (unsigned long n) |
size_t | write (long n) |
size_t | write (unsigned int n) |
size_t | write (int n) |
operator bool () | |
Public Attributes | |
volatile uint8_t | _rx_buffer_head |
volatile uint8_t | _rx_buffer_tail |
unsigned char | _rx_buffer [SERIAL_BUFFER_SIZE] |
bool | _error_flag [SERIAL_BUFFER_SIZE] |
Hardware Serial class adapted to EMS Buffer characteristics. There is only a reception buffer. WriteEOF will disable reception and change UART parity to send without errors an 11 bits 0 chain. Flush operation will disable and enable reception to erase the buffer.
Definition at line 82 of file Calduino.h.
EMSSerial::EMSSerial | ( | volatile uint8_t * | ubrrh, |
volatile uint8_t * | ubrrl, | ||
volatile uint8_t * | ucsra, | ||
volatile uint8_t * | ucsrb, | ||
volatile uint8_t * | ucsrc, | ||
volatile uint8_t * | udr, | ||
uint8_t | rxen, | ||
uint8_t | txen, | ||
uint8_t | rxcie | ||
) |
EMS Serial Constructor
[in] | ubrrh | USART Baud Rate Register. |
[in] | ubrrl | UBRRL contains the eight least significant bits of the USART baud rate. |
[in] | ucsra | USART Control and Status Register A. |
[in] | ucsrb | USART Control and Status Register B. |
[in] | ucsrc | USART Control and Status Register C. |
[in] | udr | The transmit buffer. |
rxen | Receiver Enable. | |
txen | Transmitter Enable. | |
rxcie | RX Complete Interrupt Enable. |
Definition at line 271 of file Calduino.cpp.
EMSSerial::EMSSerial | ( | ) |
Default constructor
Definition at line 294 of file Calduino.cpp.
|
virtual |
Gets the bytes pending to be read
Definition at line 347 of file Calduino.cpp.
bool EMSSerial::begin | ( | unsigned long | baud | ) |
Start the communication with the EMS Bus – UART Interface Circuit
baud | - baud rate of the UART port. |
Definition at line 305 of file Calduino.cpp.
void EMSSerial::end | ( | ) |
Ends the EMS Serial communication
Definition at line 330 of file Calduino.cpp.
|
virtual |
Flushes the EMS Serial by clearing the buffer contents
Definition at line 393 of file Calduino.cpp.
EMSSerial::operator bool | ( | ) |
Cast that converts the given to a bool
Definition at line 456 of file Calduino.cpp.
|
virtual |
Returns the top-of-stack object without removing it, or -1 otherwise.
Definition at line 359 of file Calduino.cpp.
|
virtual |
Returns the top-of-stack object removing it.
Definition at line 376 of file Calduino.cpp.
|
virtual |
Writes the given character in the EMS Serial
c | The char to write. |
Definition at line 413 of file Calduino.cpp.
void EMSSerial::writeEOF | ( | ) |
Write a EMS end-of-frame character to the port First halt temporarily reception, change parity to even and then send a break-character. Then restore the settings and re-enable reception
Definition at line 435 of file Calduino.cpp.