FastArduino  v1.7
C++ library to build fast but small Arduino/AVR projects
soft_uart.h File Reference

Software-emulated serial API. More...

#include "boards/board.h"
#include "interrupts.h"
#include "utilities.h"
#include "uart_commons.h"
#include "streams.h"
#include "gpio.h"
#include "pci.h"
#include "int.h"
Include dependency graph for soft_uart.h:

Go to the source code of this file.

Classes

class  serial::soft::UATX< TX_ >
 Software-emulated serial transmitter API. More...
 
class  serial::soft::UARX< board::ExternalInterruptPin, RX_ >
 
class  serial::soft::UART< board::ExternalInterruptPin, RX_, TX_ >
 
class  serial::soft::UARX< board::InterruptPin, RX_ >
 
class  serial::soft::UART< board::InterruptPin, RX_, TX_ >
 

Namespaces

 serial
 Defines all API for UART features.
 
 serial::soft
 Defines API types used by software UART features.
 

Macros

#define REGISTER_UARX_PCI_ISR(RX, PCI_NUM)
 Register the necessary ISR (Interrupt Service Routine) for an serial::soft::UARX to work correctly. More...
 
#define REGISTER_UARX_INT_ISR(RX, INT_NUM)
 Register the necessary ISR (Interrupt Service Routine) for an serial::soft::UARX to work correctly. More...
 
#define REGISTER_UART_PCI_ISR(RX, TX, PCI_NUM)
 Register the necessary ISR (Interrupt Service Routine) for an serial::soft::UART to work correctly. More...
 
#define REGISTER_UART_INT_ISR(RX, TX, INT_NUM)
 Register the necessary ISR (Interrupt Service Routine) for an serial::soft::UART to work correctly. More...
 

Typedefs

template<board::ExternalInterruptPin RX_>
using serial::soft::UARX_EXT = UARX< board::ExternalInterruptPin, RX_ >
 Software-emulated serial receiver API. More...
 
template<board::InterruptPin RX_>
using serial::soft::UARX_PCI = UARX< board::InterruptPin, RX_ >
 Software-emulated serial receiver API. More...
 
template<board::ExternalInterruptPin RX_, board::DigitalPin TX_>
using serial::soft::UART_EXT = UART< board::ExternalInterruptPin, RX_, TX_ >
 Software-emulated serial receiver/transceiver API. More...
 
template<board::InterruptPin RX_, board::DigitalPin TX_>
using serial::soft::UART_PCI = UART< board::InterruptPin, RX_, TX_ >
 Software-emulated serial receiver/transceiver API. More...
 

Detailed Description

Software-emulated serial API.

Definition in file soft_uart.h.

Macro Definition Documentation

◆ REGISTER_UARX_PCI_ISR

#define REGISTER_UARX_PCI_ISR (   RX,
  PCI_NUM 
)
Value:
ISR(CAT3(PCINT, PCI_NUM, _vect)) \
{ \
serial::soft::isr_handler::check_uarx_pci<PCI_NUM, RX>(); \
}

Register the necessary ISR (Interrupt Service Routine) for an serial::soft::UARX to work correctly.

This applies to an UARX which RX pin is a PCINT pin.

Parameters
RXthe board::InterruptPin used as RX for the UARX
PCI_NUMthe number of the PCINT vector for the given RX pin

Definition at line 39 of file soft_uart.h.

◆ REGISTER_UARX_INT_ISR

#define REGISTER_UARX_INT_ISR (   RX,
  INT_NUM 
)
Value:
ISR(CAT3(INT, INT_NUM, _vect)) \
{ \
serial::soft::isr_handler::check_uarx_int<INT_NUM, RX>(); \
}

Register the necessary ISR (Interrupt Service Routine) for an serial::soft::UARX to work correctly.

This applies to an UARX which RX pin is an External INT pin.

Parameters
RXthe board::ExternalInterruptPin used as RX for the UARX
INT_NUMthe number of the INT vector for the given RX pin

Definition at line 51 of file soft_uart.h.

◆ REGISTER_UART_PCI_ISR

#define REGISTER_UART_PCI_ISR (   RX,
  TX,
  PCI_NUM 
)
Value:
ISR(CAT3(PCINT, PCI_NUM, _vect)) \
{ \
serial::soft::isr_handler::check_uart_pci<PCI_NUM, RX, TX>(); \
}

Register the necessary ISR (Interrupt Service Routine) for an serial::soft::UART to work correctly.

This applies to an UART which RX pin is a PCINT pin.

Parameters
RXthe board::InterruptPin used as RX for the UART
TXthe board::DigitalPin used as TX for the UART
PCI_NUMthe number of the PCINT vector for the given RX pin

Definition at line 64 of file soft_uart.h.

◆ REGISTER_UART_INT_ISR

#define REGISTER_UART_INT_ISR (   RX,
  TX,
  INT_NUM 
)
Value:
ISR(CAT3(INT, INT_NUM, _vect)) \
{ \
serial::soft::isr_handler::check_uart_int<INT_NUM, RX, TX>(); \
}

Register the necessary ISR (Interrupt Service Routine) for an serial::soft::UART to work correctly.

This applies to an UART which RX pin is an External INT pin.

Parameters
RXthe board::ExternalInterruptPin used as RX for the UART
TXthe board::DigitalPin used as TX for the UART
INT_NUMthe number of the INT vector for the given RX pin

Definition at line 77 of file soft_uart.h.