#include <pas-co2-sbus.hpp>
|
virtual Error_t | init (void)=0 |
| Initializes the serial interface. More...
|
|
virtual Error_t | deinit (void)=0 |
| Deinitializes the serial interface. More...
|
|
virtual Error_t | write (const uint8_t regAddr, const uint8_t *data, uint16_t length=1)=0 |
| Writes data to a register or set of consecutive registers. More...
|
|
virtual Error_t | read (const uint8_t regAddr, uint8_t *data, uint16_t length=1)=0 |
| Reads data from a register or set of consecutive registers. More...
|
|
virtual Proto_t | getProtocol (void)=0 |
| Gets the specific serial protocol. More...
|
|
◆ Proto_t
Enumerator |
---|
BUS_PROTO_I2C | I2C protocol
|
BUS_PROTO_UART | UART protocol
|
◆ init()
virtual Error_t pasco2::SBus::init |
( |
void |
| ) |
|
|
pure virtual |
Initializes the serial interface.
- Returns
- PAS CO2 error code
- Return values
-
OK | if success |
INTF_ERROR | if error |
Implemented in pasco2::UART, and pasco2::I2C.
◆ deinit()
virtual Error_t pasco2::SBus::deinit |
( |
void |
| ) |
|
|
pure virtual |
Deinitializes the serial interface.
- Returns
- PAS CO2 error code
- Return values
-
OK | if success |
INTF_ERROR | if error |
Implemented in pasco2::UART, and pasco2::I2C.
◆ write()
virtual Error_t pasco2::SBus::write |
( |
const uint8_t |
regAddr, |
|
|
const uint8_t * |
data, |
|
|
uint16_t |
length = 1 |
|
) |
| |
|
pure virtual |
Writes data to a register or set of consecutive registers.
- Parameters
-
[in] | regAddr | Register start write address |
[in] | *data | Pointer to the data array to be written |
[in] | length | Number of registers to be written in the bus |
- Returns
- PAS CO2 error code
- Return values
-
OK | if success |
INTF_ERROR | if error |
Implemented in pasco2::UART, and pasco2::I2C.
◆ read()
virtual Error_t pasco2::SBus::read |
( |
const uint8_t |
regAddr, |
|
|
uint8_t * |
data, |
|
|
uint16_t |
length = 1 |
|
) |
| |
|
pure virtual |
Reads data from a register or set of consecutive registers.
- Parameters
-
[in] | regAddr | Register start read address |
[out] | *data | Pointer to the array that will store the read data |
[in] | length | Number of registers to be read from the bus |
- Returns
- PAS CO2 error code
- Return values
-
OK | if success |
INTF_ERROR | if error |
Implemented in pasco2::UART, and pasco2::I2C.
◆ getProtocol()
virtual Proto_t pasco2::SBus::getProtocol |
( |
void |
| ) |
|
|
pure virtual |
Gets the specific serial protocol.
- Returns
- PAS CO2 serial protocol
- Return values
-
BUS_PROTO_I2C | |
BUS_PROTO_UART | |
Implemented in pasco2::I2C, and pasco2::UART.
The documentation for this class was generated from the following file: