avr-classes
|
#include <notifyingbufferedusart.h>
Public Member Functions | |
NotifyingBufferedUsart (Usart *usart, EventReceiver *receiver, const Event &readableEvent, const Event &writableEvent) | |
bool | read (uint8_t *byte) |
bool | write (uint8_t byte) |
virtual void | onDataRegisterEmpty (void) override |
virtual void | onRxComplete (void) override |
![]() | |
BufferedUsart (Usart *usart) | |
void | enable (bool state) |
bool | read (uint8_t *byte) |
bool | write (uint8_t byte) |
![]() | |
SimpleUsart (Usart *usart) | |
void | enable (bool state) |
uint8_t | read (void) |
void | write (uint8_t byte) |
Additional Inherited Members | |
![]() | |
Usart *const | m_usart |
Extension of the BufferedUsart that sends notifications using the event system when data becomes ready for reading or when there is new capacaity for writing data. The notifications are sent only once the trigger occurs, until the user re-enables them by reading data (for the readable notification) or writing data (for the writable notification).
|
inline |
Constructor.
usart | Pointer to USART device to be used. |
receiver | Pointer to EventReceiver instance to receive notifications. |
readableEvent | Event to be sent when data was added to the incoming buffer (device is readable). |
writableEvent | Event to be sent when data was removed from the outgoing buffer (device is writable). |
|
inlineoverridevirtual |
Calls base class implementation and sends writeable notification, if not already done.
Reimplemented from BufferedUsart< RXQUEUESIZE, TXQUEUESIZE >.
|
inlineoverridevirtual |
Calls base class implementation and sends readable notification, if not already done.
Reimplemented from BufferedUsart< RXQUEUESIZE, TXQUEUESIZE >.
|
inline |
Re-enables readable notification and gets a byte from the buffer, if available.
byte | Pointer to buffer that receives the data byte. |
|
inline |
Re-enables writable notification and puts a byte into the buffer, if possible.
byte | Data byte to send. |