155 template <
typename T>
Driver to communicate with a TLB digital-analog weight transmitter attached to a loadcell.
void receive(T *buf)
Wrapper to the serial receive method. This also sets the control pins to enable the receiver mode.
MBLoadCellData getMaxWeight()
Returns a copy of the max weight detected.
MBLoadCellData sampleContModTd(void)
Sampling in the "continuous Mod Td" mode.
MBLoadCellData sampleContModT(void)
Sampling in the "continuous Mod T" mode.
void resetMaxMinWeights()
Permits to reset the peak weight value.
MBLoadCellData sampleAsciiModTd(void)
Sampling in the "ASCII Mod Td" mode.
std::string receiveASCII()
Wrapper to the serial recvString method. This also sets the control pins to enable the receiver mode.
MBLoadCellData getMinWeight()
Returns a copy of the min weight detected.
void printData()
Prints the last sample received.
void transmitASCII(const std::string &buf)
Wrapper to the serial sendString method. This also sets the control pins to enable the transmission m...
ReturnsStates asciiRequest(LoadCellValuesEnum r, int value=0)
Generates and sends a request in ASCII mode, waits for the response and updates the lastSample struct...
bool init() override
Initializes the serial communication with the load cell.
void generateRequest(DataAsciiRequest &req, const LoadCellValuesEnum toRequest, int value=0)
Forges a request for the ascii mode.
MBLoadCellData sampleImpl() override
Requests the weight sampled from the load cell or waits for a sample depending on the mode selected (...
bool selfTest() override
Check if the sensor is working.
MBLoadCell(USARTInterface &serial, LoadCellModes mode)
constructor that initializes the serial communication with the load cell
Base sensor class with has to be extended by any sensor driver.
Abstract class that implements the interface for the USART/UART serial communication.
This file includes all the types the logdecoder script will decode.
ReturnsStates
Structure of the errors in the ASCII requests.
LoadCellModes
Enumeration of all the modes supported by the driver.
LoadCellValuesEnum
Enumeration of all the requests in ASCII mode.
Structure that contains all the parameters for the request to be sent.
Structure that stores a data value, with his timestamp and his validity.
Structure of the output of the load cell in [continuous mode -> ModT].