Account
| ArmsysApi 0.12.18 |
BUartBasic Class Reference
#include <BUartBasic.h>
Inheritance diagram for BUartBasic:
Public Member Functions | |
| BUartBasic () | |
| BError | init (BUInt8 dev, Pin pinTx, Pin pinRx, int baudRate=9600, int bits=8, int stopBits=2) |
| Initialise device: 1 to 3. More... | |
| BError | init (BUInt8 dev, int baudRate=9600, int bits=8, int stopBits=2) |
| Initialise device: 1 to 3. More... | |
| BError | setMode485 (Pin txEnablePin, Bool rxDisable=1) |
| Sets the UART to 485 mode with a TX enable pin. More... | |
| BUInt | writeAvailable () |
| Check if can write, returns 0 or 1. More... | |
| BError | write (const void *data, BUInt32 nBytes, BUInt32 &nWritten) |
| Write nBytes, will wait for hardware. More... | |
| BUInt | readAvailable () |
| Check if data is available, returns 0 or 1. More... | |
| BError | read (void *data, BUInt32 nBytes, BUInt32 &nRead) |
| Read nBytes, will wait for hardware. More... | |
| int | printf (const char *fmt,...) |
Public Member Functions inherited from BComms | |
| BComms () | |
| virtual | ~BComms () |
| virtual BError | init () |
| virtual void | close () |
| virtual const char * | name () |
| The name of this interface. More... | |
| virtual BUInt32 | byteRate () |
| The byte rate of this interface. More... | |
| virtual BError | setPacketMode (Bool packetMode) |
| Set packet mode. More... | |
| virtual Bool | packetMode () |
| Device is in packet mode. More... | |
| virtual BError | setTimeout (BTimeout timeoutUs) |
| Set communication timeout. More... | |
| virtual BError | connect (const char *resource) |
| Create a connection. More... | |
| virtual Bool | isConnected () |
| virtual BError | disconnect () |
| Disconnect. More... | |
| virtual void | flush (Flush flush) |
| virtual BError | writeChunks (const BDataChunk *chunks, BUInt nChunks, BUInt32 &nTrans) |
| virtual BError | wait (BUInt32 eventSet, BTimeout timeoutUs=BTimeoutForever, BUInt32 num=1) |
| virtual void | eventQueue (BEventQueue *eventQueue, BUInt32 event, BUInt32 eventSet, BUInt num=1) |
| virtual void | eventEnable (Bool on) |
| Enable events to be sent. More... | |
Protected Attributes | |
| USART_TypeDef * | ouart |
| Pin | otxEnablePin |
| Bool | orxDisable |
Protected Attributes inherited from BComms | |
| Bool | oconnected |
| Bool | opacketMode |
| BTimeout | otimeout |
| BEventQueue * | oeventQueue |
| Bool | oeventEnabled |
| BUInt32 | oevent |
| BUInt32 | oeventSet |
| BUInt | oeventNum |
Additional Inherited Members | |
Public Types inherited from BComms | |
| enum | Flush { FlushRead, FlushWrite, FlushReadWrite } |
Constructor & Destructor Documentation
◆ BUartBasic()
| BUartBasic::BUartBasic | ( | ) |
Member Function Documentation
◆ init() [1/2]
| BError BUartBasic::init | ( | BUInt8 | dev, |
| Pin | pinTx, | ||
| Pin | pinRx, | ||
| int | baudRate = 9600, | ||
| int | bits = 8, | ||
| int | stopBits = 2 | ||
| ) |
Initialise device: 1 to 3.
◆ init() [2/2]
Initialise device: 1 to 3.
◆ printf()
| int BUartBasic::printf | ( | const char * | fmt, |
| ... | |||
| ) |
◆ read()
Read nBytes, will wait for hardware.
Implements BComms.
◆ readAvailable()
| virtual |
Check if data is available, returns 0 or 1.
Reimplemented from BComms.
◆ setMode485()
Sets the UART to 485 mode with a TX enable pin.
◆ write()
Write nBytes, will wait for hardware.
Implements BComms.
◆ writeAvailable()
| virtual |
Check if can write, returns 0 or 1.
Reimplemented from BComms.
Member Data Documentation
◆ orxDisable
| protected |
◆ otxEnablePin
| protected |
◆ ouart
| protected |
The documentation for this class was generated from the following files:
Generated by
1.8.15 
Public Member Functions inherited from