simulavr
1.1.0
|
Implements the I/O hardware necessary to do USART transfers. More...
#include <hwuart.h>
Public Member Functions | |
HWUsart (AvrDevice *core, HWIrqSystem *, PinAtPort tx, PinAtPort rx, PinAtPort xck, unsigned int rx_interrupt, unsigned int udre_interrupt, unsigned int tx_interrupt, int instance_id=0, bool mxReg=true) | |
Creates a instance of HWUsart class. More... | |
void | SetUcsrc (unsigned char val) |
void | SetUcsrcUbrrh (unsigned char val) |
unsigned char | GetUcsrc () |
unsigned char | GetUcsrcUbrrh () |
![]() | |
HWUart (AvrDevice *core, HWIrqSystem *, PinAtPort tx, PinAtPort rx, unsigned int rx_interrupt, unsigned int udre_interrupt, unsigned int tx_interrupt, int instance_id=0) | |
Creates a instance of HWUart class. More... | |
virtual unsigned int | CpuCycle () |
void | Reset () |
void | SetUdr (unsigned char val) |
void | SetUsr (unsigned char val) |
void | SetUcr (unsigned char val) |
void | SetUbrr (unsigned char val) |
void | SetUbrrhi (unsigned char val) |
unsigned char | GetUdr () |
unsigned char | GetUsr () |
unsigned char | GetUcr () |
unsigned char | GetUbrr () |
unsigned char | GetUbrrhi () |
void | ClearIrqFlag (unsigned int) |
void | CheckForNewSetIrq (unsigned char) |
void | CheckForNewClearIrq (unsigned char) |
![]() | |
Hardware (AvrDevice *core) | |
virtual | ~Hardware () |
virtual bool | IsLevelInterrupt (unsigned int vector) |
virtual bool | LevelInterruptPending (unsigned int vector) |
![]() | |
TraceValueRegister (TraceValueRegister *parent, const std::string &name) | |
Create a TraceValueRegister, with a scope prefix built on parent scope + name. More... | |
TraceValueRegister () | |
Create a TraceValueRegister, with a empty scope name, single device application. More... | |
virtual | ~TraceValueRegister () |
const std::string | GetTraceValuePrefix (void) |
Returns the scope prefix. More... | |
const std::string | GetScopeName (void) |
Returns the scope name. More... | |
void | RegisterTraceValue (TraceValue *t) |
Registers a TraceValue for this register. More... | |
void | UnregisterTraceValue (TraceValue *t) |
Unregisters a TraceValue, remove it from register. More... | |
TraceValueRegister * | GetScopeGroupByName (const std::string &name) |
Get a here registered TraceValueRegister by it's name. More... | |
virtual TraceValue * | GetTraceValueByName (const std::string &name) |
Get a here registered TraceValue by it's name. More... | |
TraceValueRegister * | FindScopeGroupByName (const std::string &name) |
Seek for a TraceValueRegister by it's name. More... | |
TraceValue * | FindTraceValueByName (const std::string &name) |
Seek for a TraceValue by it's name. More... | |
TraceSet * | GetAllTraceValues (void) |
Get all here registered TraceValue's only (not with descending values) More... | |
TraceSet * | GetAllTraceValuesRecursive (void) |
Get all here registered TraceValue's with descending values. More... | |
Public Attributes | |
IOReg< HWUsart > | ucsrc_reg |
IOReg< HWUsart > | ubrrh_reg |
IOReg< HWUsart > | ucsrc_ubrrh_reg |
![]() | |
IOReg< HWUart > | udr_reg |
IOReg< HWUart > | usr_reg |
IOReg< HWUart > | ucr_reg |
IOReg< HWUart > | ucsra_reg |
IOReg< HWUart > | ucsrb_reg |
IOReg< HWUart > | ubrr_reg |
IO register "UBRRxL" - baudrate. More... | |
IOReg< HWUart > | ubrrhi_reg |
IO register "UBRRxH" - baudrate. More... | |
Protected Attributes | |
PinAtPort | pinXck |
Clock pin for synchronous mode. More... | |
![]() | |
unsigned char | udrWrite |
Write stage of UDR register value. More... | |
unsigned char | udrRead |
Read stage of UDR register value. More... | |
unsigned char | usr |
USR register value, also used as UCSRA register value. More... | |
unsigned char | ucr |
UCR register value, also used as UCSRB register value. More... | |
unsigned char | ucsrc |
UCSRC register value. More... | |
unsigned short | ubrr |
Baud rate register value (UBRR) More... | |
bool | readParity |
The read parity flag for usart. More... | |
bool | writeParity |
The write parity flag for usart. More... | |
int | frameLength |
Hold length of UART frame. More... | |
HWIrqSystem * | irqSystem |
Connection to interrupt system. More... | |
PinAtPort | pinTx |
TX pin. More... | |
PinAtPort | pinRx |
RX pin. More... | |
unsigned int | vectorRx |
Interrupt vector ID for receive interrupt. More... | |
unsigned int | vectorUdre |
Interrupt vector ID for UDR empty interrupt. More... | |
unsigned int | vectorTx |
Interrupt vector ID for sent byte interrupt. More... | |
unsigned char | regSeq |
Cycle timer for controling read access to UCSRC/UBRRH combined register. More... | |
int | baudCnt |
T_RxState | rxState |
T_TxState | txState |
int | cntRxSamples |
int | rxLowCnt |
int | rxHighCnt |
unsigned int | rxDataTmp |
int | rxBitCnt |
int | baudCnt16 |
unsigned char | txDataTmp |
int | txBitCnt |
Additional Inherited Members | |
![]() | |
enum | T_RxState { RX_DISABLED, RX_WAIT_FOR_HIGH, RX_WAIT_FOR_LOWEDGE, RX_READ_STARTBIT, RX_READ_DATABIT, RX_READ_PARITY, RX_READ_STOPBIT, RX_READ_STOPBIT2 } |
enum | T_TxState { TX_DISABLED, TX_SEND_STARTBIT, TX_SEND_DATABIT, TX_SEND_PARITY, TX_SEND_STOPBIT, TX_SEND_STOPBIT2, TX_AFTER_STOPBIT, TX_FIRST_RUN, TX_FINISH } |
![]() | |
unsigned int | CpuCycleRx () |
unsigned int | CpuCycleTx () |
void | SetFrameLengthFromRegister () |
![]() | |
virtual size_t | _tvr_getValuesCount (void) |
Get the count of all TraceValues, that are registered here and descending. More... | |
virtual void | _tvr_insertTraceValuesToSet (TraceSet &t) |
Insert all TraceValues into TraceSet, that registered here and descending. More... | |
Implements the I/O hardware necessary to do USART transfers.
HWUsart::HWUsart | ( | AvrDevice * | core, |
HWIrqSystem * | s, | ||
PinAtPort | tx, | ||
PinAtPort | rx, | ||
PinAtPort | xck, | ||
unsigned int | rx_interrupt, | ||
unsigned int | udre_interrupt, | ||
unsigned int | tx_interrupt, | ||
int | instance_id = 0 , |
||
bool | mxReg = true |
||
) |
Creates a instance of HWUsart class.
Definition at line 651 of file hwuart.cpp.
References IOReg< P >::releaseTraceValue(), HWUart::Reset(), ubrrh_reg, ucsrc_reg, and ucsrc_ubrrh_reg.
unsigned char HWUsart::GetUcsrc | ( | ) |
Definition at line 639 of file hwuart.cpp.
References HWUart::ucsrc.
unsigned char HWUsart::GetUcsrcUbrrh | ( | ) |
Definition at line 641 of file hwuart.cpp.
References HWUart::GetUbrrhi(), and HWUart::regSeq.
void HWUsart::SetUcsrc | ( | unsigned char | val | ) |
Definition at line 626 of file hwuart.cpp.
References HWUart::SetFrameLengthFromRegister(), and HWUart::ucsrc.
void HWUsart::SetUcsrcUbrrh | ( | unsigned char | val | ) |
Definition at line 631 of file hwuart.cpp.
References HWUart::SetUbrrhi(), and URSEL.
|
protected |
Definition at line 173 of file hwuart.h.
Referenced by AvrDevice_attiny2313::AvrDevice_attiny2313(), and HWUsart().
Definition at line 173 of file hwuart.h.
Referenced by AvrDevice_at90canbase::AvrDevice_at90canbase(), AvrDevice_atmega1284Abase::AvrDevice_atmega1284Abase(), AvrDevice_atmega128base::AvrDevice_atmega128base(), AvrDevice_atmega2560base::AvrDevice_atmega2560base(), AvrDevice_atmega668base::AvrDevice_atmega668base(), AvrDevice_attiny2313::AvrDevice_attiny2313(), and HWUsart().
Definition at line 173 of file hwuart.h.
Referenced by AvrDevice_atmega16_32::AvrDevice_atmega16_32(), and HWUsart().