Arduino-GPIO
General Purpose Input/Output (GPIO) library for Arduino
Software::Serial< TX_PIN > Class Template Reference

#include <Serial.h>

Inheritance diagram for Software::Serial< TX_PIN >:
Inheritance graph
Collaboration diagram for Software::Serial< TX_PIN >:
Collaboration graph

Public Member Functions

 Serial ()
 
void begin (uint32_t baudrate)
 
 operator bool ()
 
virtual size_t write (uint8_t byte)
 
virtual int available ()
 
virtual int peek ()
 
virtual int read ()
 
virtual void flush ()
 

Protected Attributes

GPIO< TX_PIN > m_tx
 
uint16_t m_count
 

Detailed Description

template<BOARD::pin_t TX_PIN>
class Software::Serial< TX_PIN >

Definition at line 31 of file Serial.h.

Constructor & Destructor Documentation

template<BOARD::pin_t TX_PIN>
Software::Serial< TX_PIN >::Serial ( )
inline

Construct Output only Software Serial instance with given template parameters. Initiate GPIO transmit pin to output mode and set default baudrate (57600 bps).

Definition at line 38 of file Serial.h.

Member Function Documentation

template<BOARD::pin_t TX_PIN>
virtual int Software::Serial< TX_PIN >::available ( )
inlinevirtual

Returns always zero(0) as this stream is output only.

Returns
zero(0).

Definition at line 99 of file Serial.h.

template<BOARD::pin_t TX_PIN>
void Software::Serial< TX_PIN >::begin ( uint32_t  baudrate)
inline

Start the Output only Software Serial with the given baudrate.

Parameters
[in]baudratein bits per second.

Definition at line 50 of file Serial.h.

template<BOARD::pin_t TX_PIN>
virtual void Software::Serial< TX_PIN >::flush ( )
inlinevirtual

Output only stream.

Definition at line 128 of file Serial.h.

template<BOARD::pin_t TX_PIN>
Software::Serial< TX_PIN >::operator bool ( )
inline

Check if Serial is ready (see Arduino/HardwareSerial).

Returns
true(1);

Definition at line 63 of file Serial.h.

template<BOARD::pin_t TX_PIN>
virtual int Software::Serial< TX_PIN >::peek ( )
inlinevirtual

Returns always error code(-1) as this stream is output only.

Returns
error code(-1);

Definition at line 109 of file Serial.h.

template<BOARD::pin_t TX_PIN>
virtual int Software::Serial< TX_PIN >::read ( )
inlinevirtual

Returns always error code(-1) as this stream is output only.

Returns
error code(-1);

Definition at line 119 of file Serial.h.

template<BOARD::pin_t TX_PIN>
virtual size_t Software::Serial< TX_PIN >::write ( uint8_t  byte)
inlinevirtual

Write given byte to serial output with one start and stop bit. Interrupts are disabled during the transmission. Returns number of bytes transmitted(1).

Parameters
[in]byteto transmit.
Returns
number of bytes transmitted(1).

Definition at line 76 of file Serial.h.

Member Data Documentation

template<BOARD::pin_t TX_PIN>
uint16_t Software::Serial< TX_PIN >::m_count
protected

Bit delay counter for given baudrate.

Definition at line 137 of file Serial.h.

template<BOARD::pin_t TX_PIN>
GPIO<TX_PIN> Software::Serial< TX_PIN >::m_tx
protected

Asynchronous Serial Output pin.

Definition at line 134 of file Serial.h.


The documentation for this class was generated from the following file: