satnogs-rotator-firmware
Loading...
Searching...
No Matches
rs485 Class Reference

Class that functions for interacting with a RS485 transceiver. More...

#include <rs485.h>

Public Member Functions

 rs485 (uint8_t pin_dir, uint16_t tx_time)
 
void begin (uint16_t baudrate)
 Initialize the RS485 transceiver.
 
void print (String str)
 Print a string to RS485 bus.
 
uint8_t read ()
 Read a char/uint8_t from RS485 bus.
 
uint8_t available (void)
 The number of chars/uint8_t that are available in RS485 buffer.
 
void flush ()
 Waits for the transmission of outgoing serial data to complete.
 
void end ()
 Disables RS485 communication.
 

Private Attributes

uint8_t _pin_dir
 
uint16_t _tx_time
 

Detailed Description

Class that functions for interacting with a RS485 transceiver.

Parameters
pin_dirDigital pin, to set read or write to RS485 bus
tx_timeTime delay in ms in order to transmit and change the status of direction pin

Definition at line 25 of file rs485.h.

Constructor & Destructor Documentation

◆ rs485()

rs485::rs485 ( uint8_t pin_dir,
uint16_t tx_time )
inline

Definition at line 28 of file rs485.h.

References _pin_dir, and _tx_time.

Member Function Documentation

◆ available()

uint8_t rs485::available ( void )
inline

The number of chars/uint8_t that are available in RS485 buffer.

Returns
A char/uint8_t

Definition at line 75 of file rs485.h.

Referenced by easycomm::easycomm_proc().

◆ begin()

void rs485::begin ( uint16_t baudrate)
inline

Initialize the RS485 transceiver.

Parameters
baudrateSet the baudrate of RS485 bus

Definition at line 40 of file rs485.h.

References _pin_dir.

Referenced by easycomm::easycomm_init().

◆ end()

void rs485::end ( )
inline

Disables RS485 communication.

Definition at line 93 of file rs485.h.

◆ flush()

void rs485::flush ( )
inline

Waits for the transmission of outgoing serial data to complete.

Definition at line 84 of file rs485.h.

Referenced by easycomm::easycomm_proc().

◆ print()

void rs485::print ( String str)
inline

Print a string to RS485 bus.

Parameters
strA String to transmit

Definition at line 52 of file rs485.h.

References _pin_dir, and _tx_time.

Referenced by easycomm::easycomm_proc().

◆ read()

uint8_t rs485::read ( )
inline

Read a char/uint8_t from RS485 bus.

Returns
A char/uint8_t

Definition at line 65 of file rs485.h.

Referenced by easycomm::easycomm_proc().

Member Data Documentation

◆ _pin_dir

uint8_t rs485::_pin_dir
private

Definition at line 98 of file rs485.h.

Referenced by begin(), print(), and rs485().

◆ _tx_time

uint16_t rs485::_tx_time
private

Definition at line 99 of file rs485.h.

Referenced by print(), and rs485().


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